alan.harriman
Posts: 4
Joined: Mon Dec 21, 2009 7:38 pm

Custom action to retrieve registry subkey

We need to find a particular registry subkey and use its name to populate a session property. So far, we have a custom action under InstallUISequence>>Begin which calls a vb script function. Everything works fine if the VB Script sets an arbitrary value on the session property. But writing vbs code to actually access the registry seems fraught with possible compatibility problems that would cause it to fail on the users machine. What do you recommend? Surely this is a common problem and has been solved before.

Concretely, we want to open the following key, HKLM\Software\JetBrains\ReShaper, and then find the name of the next subkey. This will allow us to construct a registry search that will find a key value like HKLM\Software\JetBrains\ReShaper\v4.5\vs2009\installDir where "v4.5" can be any value.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Custom action to retrieve registry subkey

Hello,

I am afraid Windows Installer does not directly support this. Using a custom action is the only way to achieve what you are trying to do.
It shouldn't raise any compatibility issues however, windows operating systems are not that different in accessing registry keys as far as I know. You should however take the 64-bit registry redirect into consideration.

Also, it is recommended that you thoroughly test your custom action with various operating systems to ensure that it works properly.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”