philk
Posts: 5
Joined: Tue Mar 24, 2009 8:47 am

Let the user specify a variable for Registry entry

Hello,

I want the user to provide a text that will be used in a Registry setting. For instance: HKLM\Software\My app\title={userText}. The UI should provide a textbox that the user can enter a text for "userText". If its left empty, a default value should be used. The (default-)value for the variable should be also provided by a commandline parameter like ie. "msiexec myinstall.msi /vuserText=newDefault"

Is something like this possible with Advanced Installer?

Thanks,
Phil
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Let the user specify a variable for Registry entry

Hi Phil,

Yes, this can be done by using an installer property. First, you can create a custom dialog which retrieves the information from the user. Please note that the User Guide contains a dialog tutorial which may help you.

The property of the edit box on this dialog can be used for a registry value in the Registry page. To set the property to a default value if it's empty, you can use a Property set with Formatted custom action scheduled under "InstallExecuteSequence" -> "Begin" (you can show this standard action by using the "Show Standard Action" button on the toolbar of the "Custom Actions" page). The custom action can be conditioned to run only if the property is empty (for example, "NOT MY_PROP").

Since you are using an installer property, it can be set through the MSI command line.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”