Wildcard registry searches for a value - are they possible? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

dcp-iu
Posts: 2
Joined: Wed Jul 26, 2006 6:44 pm
Location: Bloomington, Indiana

Wildcard registry searches for a value - are they possible?

Hi,

I have an application that I am wanting to optionally install a component of depending on the presence of other software on the system. I have been able to get this working by specifying the exact registry key of the other program. The only problem is is that the other program uses the version number of its program within its registry key. Under that registry key is the value I need, the install path of the program. I then pass this path within the searched variable to my installer program (conditionally, if the value is not zero).

e.g. I search directly for

HKEY_LOCAL_MACHINE\SOFTWARE\Other Program\2.5.6\InstallPath

that is one search and then it has its own install and uninstall custom action. Then again for 2.5.7, then 2.5.8 ... ad infinitum.

There has to be a better way.

What I would REALLY like is if I can search the registry and return the first match to a wildcard expression, thus since only one 2.x.x version of 'Other Program' can be installed at once, and I just want to get whereever they installed it, I could do a search for

HKEY_LOCAL_MACHINE\SOFTWARE\Other Program\2.*\InstallPath

or even

HKEY_LOCAL_MACHINE\SOFTWARE\Other Program\2.?.?\InstallPath

and get that into a variable, and be able to handle many different versions of program (of that family) with my installer/uninstaller actions. Then I don't have to do more work and reissue my installer when 'Other Program' updates.

Any hints/help on this? Is this currently possible? Thanks.

Derek
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I have an application that I am wanting to optionally install a component of depending on the presence of other software on the system.

that is one search and then it has its own install and uninstall custom action. Then again for 2.5.7, then 2.5.8 ... ad infinitum.
My suggestion is to use "File Search" instead of "Registry Search" unless if want to schedule a registry search for each version of the program.

Here is the scenario with the "File Search": your main package will search for a file installed by the other program, if that file exist then install the additional component. So switch to "Search" page and add "New File Search". Now add a location on where to search like this: "Add Location->Folder".

To learn more about how to schedule a file search please take a look here:
http://www.advancedinstaller.com/user-guide/search.html

Please let me know if you encounter any problem.

Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
dcp-iu
Posts: 2
Joined: Wed Jul 26, 2006 6:44 pm
Location: Bloomington, Indiana

Thanks for the suggestion. From reading your response this morning I just decided to write a C program to search the registry keys I need and return the value. I can call it from the batch file run from my custom action. It's done and works.

Maybe AdvancedInstaller could offer the functionality in later versions?, it was trivial to write a program to do it.

I didn't like the idea of a file search since that seems to be a potentially length operation if you don't know where you're starting from.

Return to “Common Problems”