cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
FluffyNapkins
Level 3

Registry searching and retrieving values

I'm new to InstallShield...
I'm wondering... can I tell installshield to search a branch of the registry and all its values until it finds a pair of values or a value.
then use that value (which is info to modify another part of the registry) to go to another part of the registry and modify it's values.
(the OS randomly creates registry branch names and keys when i install the device so i need it to search one part to find a value that leads to the other)

so in short.. I'm wondering how do I point to a branch of the registry and find a value... then take another value out of that same branch that leads it to another value in a totally different branch...
is this possible and what kind of template and settings do i need to use and start out with?
Labels (1)
0 Kudos
(7) Replies
Christopher_Pai
Level 16

MSI's built in AppSearch/RegLocator pattern doesn't support recursive searches. You would have to write a custom action to find your data. Once found and stored in a property, the Registry table can be used to record that data to another registry key/value.
0 Kudos
FluffyNapkins
Level 3

Okay so how do i go about accomplishing this and writing my own function to do this?
what do i need to do that?
(keep in mind i'm completely new but i've worked a little bit with other installer software such as installer vise and Wise for Windows Installer)
0 Kudos
Christopher_Pai
Level 16

That's a tall order to explain, espcially without knowing your programming background. First pick a language.... C++, InstallScript, VBScript
0 Kudos
FluffyNapkins
Level 3

I'll pick C++ and InstallScript...
though... wouldnt installer scripting be better for writing functions for an installer? (since it's the company's language for the product)
0 Kudos
Christopher_Pai
Level 16

They all have their ups and downs. C++ is going to take the most amount of work, require external tools and wiring and a more complicated debugging story. But it'll also be very small and likely bullet proof and portable to other vendor tools.

InstallScript will add about 1.5mb to the package ( scripting runtime ), be alot easiest to develop with less plumbing, a very high degree of reliability, not very portable and an easy debugging story.

VBScript would be very easy to develop, require little plumbing but be several orders of magnatiude less reliable with a horrible debugging story.

Since you mentioned C++ and InstallScript... have you coded in either before? Are you familiar with the concept of recursion?
0 Kudos
FluffyNapkins
Level 3

I'm in the process of learning C++ but i havent mastered it...
so InstallScript probably would be the way to go for now.

and no i'm not really familiar with recursion.. although i'm sure i will get to it eventually in the learning process.
0 Kudos
Christopher_Pai
Level 16

Are you familiar with recursion? If so, you'll need ( atleast ) these InstallScript functions


RegDBSetDefaultRoot
RegDBQueryKey ()
RegDBGetKeyValueEx

finally... MsiSetProperty()


The concept is you have a function that takes a Key as an argument. Examines that key for the value you are looking for and if it finds it, calls MsiSetProperty and exists the CA.

If it doesn't find it, it enumerates the subkeys for that key and the recursively calls itself to repeat the whole process of each of those keys.

In this way you `walk` the registry tree until you either a) find what you are looking for or b) exhaust the search.

Wire the CA up as immeadiate execution in both the UI and Execute sequence conditioned to execute only once. Assign it to a PUBLIC (caps) proeprty and put that property in the SecureCustomProperties property.
0 Kudos