Hi all,
I've figured out how to prompt a user for a value for a custom environment variable through a textbox, and have it set during installation. Essentially, if a text box in a custom dialog box is named txtUserProvidedEnvVarValue, then under System Changes/Environment, I have an entry with "Name" set to the name of the environment variable to be defined, and "Value" set to "[txtUserProvidedEnvVarValue]". That works great.
In the dialog box, I'm assigning a fixed/hardcoded default value (under Property / Default Value after selecting the text box) so the user has a sample he can work with (and often, the user can just keep the default value suggested). However, **if** the environment variable already exists when the installer is run (or re-run), I'd like to pre-fill the default value in the textbox with the value of the existing environment variable instead of the hardcoded one - because it's already been set, and it should take precedence over the default value I might otherwise suggest.
Similarly, I have another dialog box that prompts the user for a port number to open in the Windows firewall (with a default of 5000). In this case, the Port value (under System Changes/Windows Firewall/Exceptions) is set to [txtUserProvidedPortValue]. Easy enough. However, if the port has already been opened (there's already an Inbound Rule with the Display Name I use in the installer), I'd like to pre-fill the textbox with the port number that the user had supplied when the installer was run the first time around (or else, keep my default).
How do I go about telling the respective text boxes to use these values if they already exist on a system?
Thanks
- Dan