Ending a running application at uninstall on Vista - 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!

jpetty
Posts: 1
Joined: Wed Apr 25, 2007 5:45 pm

Ending a running application at uninstall on Vista

Our app has an exe that runs in the background that should be automatically killed on uninstall. We've written an exe to terminate the app and call it as a custom action at uninstall. However, on Vista it fails to execute.

Can you tell me how to execute the custom action as early as possible in the uninstall routine, what privileges the exe needs, and what impersonations the custom action needs?

Thanks,

JP
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

If one or more files to be overwritten or removed are currently in use by an active process the FileInUse dialog will appear. This is checked under InstallValidate standard action.

Regarding the automatically close of the application on uninstall Windows VISTA offers support for Restart Manager. Read more about restart manager here:
http://www.advancedinstaller.com/user-g ... nager.html

However if you don't want to use the Restart Manager then schedule that custom action under "InstallExecuteSequence->CostFinalize" and use (REMOVE="ALL") as "Execution Condition".

Let me know if you encounter any problems.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
cpdohert
Posts: 10
Joined: Tue Sep 16, 2008 5:28 pm

Re: Ending a running application at uninstall on Vista

I am having a similar problem. I am using a VBscripted custom action to kill the process that is my installed program. It uses WMI to issue a Terminate method call on the process name of the running application. The VBScript runs successfully on XP and 2003, but fails on Vista. When the objProcess.Terminate method runs, it returns Error 2: Access Denied on Vista.

Is there any way of terminating a running process on Vista via a custom action that does not require modifying the application's code?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Ending a running application at uninstall on Vista

Hi,

Pleas note that on Vista the custom action which affect the system should run without impersonation. Therefore, you can try scheduling your custom action as "Deferred with no impersonation". Please note that deferred custom actions cannot access installer properties, therefore you should make sure that your script doesn't use any installer properties.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cpdohert
Posts: 10
Joined: Tue Sep 16, 2008 5:28 pm

Re: Ending a running application at uninstall on Vista

Yes, the custom action has been set to run as "Deferred with no impersonation".
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Ending a running application at uninstall on Vista

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it? Also, please attach the custom action you are using.

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

Return to “Common Problems”