Run exe on uninstall - 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!

pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Run exe on uninstall

I am installing a printer driver with my application. I have a small exe which I run to initialise the printer on first install and another exe which I am trying to run on the uninstall. I have created a custom action "exe with working directory" the path to the executable and the custom action is created under the standard action "uninstall" with the condition for Windows XP REMOVE="ALL" AND (VersionNT=501) however when I run the uninstall I get an error message "a program required could not be run" obviously because the program has been removed during the uninstall. The custom action is set to run asynchronous with the immediate execution. How can I run this before it is removed?

regards
Paul
pauldennis
Posts: 50
Joined: Fri Oct 31, 2008 11:36 am

Re: Run exe on uninstall

The second problem is that I am using the persistent data Wizard, this means the new version is installed and then the old one removed. This means on removal of the older version the exe will be run which will delete the printer. how can I ensure exe is only run when the program is removed completely.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Run exe on uninstall

Hi Paul,

Simply add the exe as an attached custom action. This ensures the exe is available throughout the entire install process.
To ensure you are removing your printer after the uninstall completes, place the custom action that launches your exe under InstallFinalize standard action.

Let me know if this helped.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”