h353655
Posts: 29
Joined: Wed Jun 21, 2017 2:51 pm

Get PC name as property default

Wed Mar 13, 2024 4:43 pm

I have a property, where the default value must be the windows PC name. I saw something about using "ComputerName", but that doesn't seem to work.

Edit: I tried using [%COMPUTERNAME], as that supposedly should be the environment variable %COMPUTERNAME%. Alas, it is then set to the computername of the machine who built the installer rather than the name on the machine running the installer. :roll: Not sure in which world that makes sense. Doh....
Attachments
properties.png
properties.png (9.39KiB)Viewed 207 times

Liviu
Posts: 1026
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Get PC name as property default

Thu Mar 14, 2024 1:45 pm

Hello,

The value field of properties does not support Formatted data type properties.

If you add the value like this, it won't work:
not correct.png
not correct.png (42.21KiB)Viewed 194 times

You need to add a "Set installer property" custom action to set the property to the value of another property. You can add the custom action after or before the Searches action group:
set property.png
set property.png (81.75KiB)Viewed 194 times

Hope this helps! If you have any other questions, please don’t hesitate to contact us.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”