Is it possible to have a setup project create a registry value without overwriting an existing one?
Question
I know it can be done with a custom action, but can it be done without it?
Solution
Found the solution myself:
- Under Launch Conditions, go to Search Target Machine and create a new Registry Search. This will set an MSI property (e.g.
MY_PROPERTY
) to that registry value. - In the Registry window, specify the registry key you want to create and, as the Condition, enter
MY_PROPERTY = ""
.
OTHER TIPS
You probably want something like:
WiX toolset's "Remember Property" pattern
The advantage is you could then use the property in UI in case you want to give the user a chance to see the existing value and then decide to change it or not.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow