Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

selecting install path through a cascade

Hello,

I'm trying to implement the following for suggesting an installation location (new install only):

- Search for a registry key pointing at a folder. If it exists, use that.
- Do the same for a second registry key.
- If none of the above was true, then use a default installation path.

How should I proceed? I'm using 14.5.2. (professional)
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: selecting install path through a cascade

Hello Fulgan,

This scenario could be implemented using the following method:

- go to "Search" page and create a new search. Right click on it and select "Add search Location" - "Registry". Then configure the registry location properties according to the registry key you need to search. The "Type" of the search should be set to "Retrieve the raw value". Also depending of the location of the registry value you need to search (if it's stored in the WOW6432NODE hive or not) you should check/uncheck the "Search the 64-bit portion of the registry" option
- repeat the above step for the second registry key you need to search.
- these two searches will store their results in two properties (default names are RESULT_PROPERTY and RESULT_PROPERTY_1)
- go to "Custom Actions" page and create two new "Set Installer Property" custom actions with sequence, placed after searches in the "Install Execution Stage".
- the first custom action should be configured in the following way:

Code: Select all

"Property:" "APPDIR"
"Value:" "[RESULT_PROPERTY]"
"Execution stage Condition" : only "Install"
"Condition" : "RESULT_PROPERTY"
The second custom action should be configured as follows:

Code: Select all

"Property:" "APPDIR"
"Value:" "[RESULT_PROPERTY_1]"
"Execution stage Condition" : only "Install"
"Condition" : "RESULT_PROPERTY_1"
This will ensure the installation folder will be set to the second path if both registry values exists. If the second value doesn't exist the APPDIR will be set to the first registry value. Finally if none of the registry values is found the APPDIR will be set to the default one.

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fulgan
Posts: 101
Joined: Mon Feb 27, 2012 10:42 am

Re: selecting install path through a cascade

Excellent, thank you.
Sorin
Posts: 663
Joined: Mon May 08, 2017 1:03 pm

Re: selecting install path through a cascade

Hello,

You are welcome!

Best regards,
Sorin
Sorin Stefan - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”