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

Get PC name as property default

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.39 KiB) Viewed 5093 times
Liviu
Posts: 1077
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Get PC name as property default

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.21 KiB) Viewed 5080 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.75 KiB) Viewed 5080 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”