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