Mark
Posts: 10
Joined: Thu Mar 05, 2009 11:42 am

Avoiding application (print spooler) restart

Hi,

I am installing and uninstalling a print monitor via a custom action (triggered from InstallInitialise).

Install works fine however during uninstall I get the message

"The following applications should be closed before continuing the install"
"Print Spooler"

The reason for this message is that a check is carried out to see the consequences or removing my monitor dll (installed in the system32 directory) before I have had a chance to delete the monitor and hence break the link.

How do I run my custom action before this check is carried out? I guess the 'begin' installed action would be a good place but I cannot associate a custom action with it.

I haev tried suppresing the reboot requests using the dropdown in Install parameters ->reboot propmpts but this does not do the trick.

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

Re: Avoiding application (print spooler) restart

Hi Mark,

The running process is detected by the "InstallExecuteSequence" -> "InstallValidate" standard action. Therefore, your custom action can be scheduled before "InstallValidate". However, this may be a problem on Vista. The custom action requires Administrator privileges, so it should be set as "Deferred with no impersonation". But this can be used only after "InstallInitialize".

An easy solution is to choose to not close the application when the dialog is shown by the uninstall. A more complex solution would be to somehow stop the process of the application before the uninstall runs.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mark
Posts: 10
Joined: Thu Mar 05, 2009 11:42 am

Re: Avoiding application (print spooler) restart

Cosmin,

Thanks for your prompt reply.

I am going to copy the dll to system32 in a custom action. This will give me full control over the behaviour and enable me to avoid the nasty re-start message.

It will also enable me to select which dll to copy (a previous question)

Again many thanks
Mark

Return to “Common Problems”