phainge
Posts: 13
Joined: Fri May 29, 2009 9:53 am

File search custom action expression condition

Hi,

We use an EXE bootstrapper, separate from the main application MSI, to allow installation of prequisites. However, this can be bypassed by simply launching the main application MSI - we've done this because we want our users to have the option of installing the prequisites either using the bootstrapper EXE or themselves manually, but at the same time we want to warn them if they launch the MSI without installing the prequisites first.

To achieve this I have added a custom action under the Begin standard action of the InstalUISequence, which launches an attached EXE that checks if the software prequisites have been installed and if not it displays a warning dialog and gives the user the option to continue or cancel the install. The EXE passes back a return code so that the install will continue or abort depending on the user's selection. The expression condition of the custom action is "(Not Installed)". This works fine and the EXE is launched and the return code is handled correctly. However, the attached EXE is written in VB6 and is thus dependant on the VB6 runtime being present on the machine (file "msvbvm60.dll" in the Windows System folder), if it is not present then the custom action fails and the install is aborted. The VB6 runtime is one of the prequisites that is optionally installed by the bootstrapper EXE.

We want to bypass the prequisites check custom action if the VB6 runtime is not already present on the machine, so to ensure that the custom action EXE is launched only if the VB6 runtime is present, I have added a file search with a property name of VB6_RUNTIME", which searches for the file "msvbvm60.dll" in the Windows System folder. I have tested the search and it works correctly. The problem comes when I alter the expression condition of the custom action to also check the result of the file search, and I am finding that the attached EXE is no longer being launched even though the VB6 runtime is present. The modified expression condition of the custom action is "(Not Installed) And (VB6_RUNTIME)". I have tried everything I can think of but the EXE will no longer launch if the expression condition includes the VB6_RUNTIME property, if I take this property out then everything works again. Using 'msiexec' I have generated a log file which shows the file search being performed and returning a result of '1'.

Thanks.

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

Re: File search custom action expression condition

Hi Peter,

Please note that the searches are performed by the "AppSearch" standard action. Therefore, the property of the search will be set only after "InstallUISequence" -> "AppSearch". Please try moving the custom action after "AppSearch" and let me know if the problem persists.

The condition which uses the search property is correct:

Code: Select all

(Not Installed) And (VB6_RUNTIME)
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
phainge
Posts: 13
Joined: Fri May 29, 2009 9:53 am

Re: File search custom action expression condition

Hi Cosmin,

That works. Thanks for your help.

Peter

Return to “Common Problems”