Stopping a process on install not working - 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!

cpdohert
Posts: 10
Joined: Tue Sep 16, 2008 5:28 pm

Stopping a process on install not working

One of the requirements for my installer is that it has to be possible to re-run the (same) installer after an initial install to recreate all the files (config files, executables). This also has to be doable without user interaction. The package has the Limit to Basic User Interface option checked. Upon install, the installed program is immediately launched.

If I simply re-run the foo.msi package a second time, the files are not replaced.

If I run a repair install using msiexec /fa foo.msi, then I get the pop-up "The following applications should be closed before continuing the install".

I tried adding a custom action to stop the installed program's process using the instructions here. The VBScript works correctly; if I run it by itself it stops the process. I have added the script as an Attached Custom Action to the FindRelatedProducts Standard Action.

Now, if I re-run the .msi package a second time, the files are not replaced, and the original installed program's process is not stopped.

If I run a repair install using msiexec /fa foo.msi, then I still get the pop-up "The following applications should be closed before continuing the install".

It does not appear that the VBScript is running.
cpdohert
Posts: 10
Joined: Tue Sep 16, 2008 5:28 pm

Re: Stopping a process on install not working

Update: it appears that it actually is working, just not in the way I expect. I tried running the installed program manually as a separate executable, and on execution of the actual MSI installer, the installer did correctly kill the foo.exe process. It still doesn't work if the initial install was done via the MSI package, though. I assume that the Windows Installer service is detecting that the package is already installed and is somehow short-circuiting the custom action.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Stopping a process on install not working

Hi,

Please note that a silent repair is performed only if important resources in the application are missing. If all resources are present on the target machine, Windows Installer considers that the application doesn't need to be repaired.

A solution for this would be to use the "/fa" parameter in the msiexec command line. This parameter makes sure that all files are reinstalled, even if they are present on the target machine.

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

Return to “Common Problems”