mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Sequence of Search operations has changed?

Hi,

We've got a problem that seems to have arisen since an earlier version of AI than 6.4, but not sure what version of AI this might have been introduced.

We are doing a search in the registry to setting a property with the result. Then we're doing another search that makes use of the first property, and finally doing a folder search based on that second property. (Which contains a path name). The overall result of this is no longer behaving itself at install time. We suspect it has something to do with the sequence of searches, given that there is a dependency order between them. Does MSIEXEC care about this, or is it smart enough to work it out?

Reading a KB article on this suggests that there is no inherent order in the AppSearch table, and that something might randomly work for a while and not later on. Perhaps this is what's happening to us.

Are we doing this the recommended way? Can't see how else you could search the registry for something that another registry key is pointing to.

Thanks for you help/...

MCT
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Sequence of Search operations has changed?

Hi,

Please note that the order of the searches is not guaranteed by Windows Installer. This means that it is not recommended to use a search which depends on another search.
Can't see how else you could search the registry for something that another registry key is pointing to.
This can be done by using a custom action. Note that in a VBScript custom action you can use the EnumKey method to enumerate registry keys. This way, you can test each key until you find the one you need (or you go through all the keys).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Re: Sequence of Search operations has changed?

Thanks Cosmin, I figured that would probably be the case.

We haven't done much with custom actions ... what is the right place in the installer sequence for the sort of action that would query the registry in this way?

Cheers,
MT
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Sequence of Search operations has changed?

Hi,
what is the right place in the installer sequence for the sort of action that would query the registry in this way?
This depends on when you need the results of the search. Windows Installer performs it's searches during the "InstallExecuteSequence" -> "AppSearch" standard action. Therefore, you can add your custom action under "AppSearch".

Note that you can see a standard action by using the "Show Standard Action" button on the toolbar of the Custom Actions page. Also, you should set your custom action as "Immediate" in order to allow it to have access to installer properties.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”