Page 1 of 1

Previous version uninstallation

Posted: Thu Mar 17, 2011 9:20 am
by aviaw
Hello,

I use Install Aware version 8 (developer).
I have a program (executable) that I want to run before uninstall.
I added a "Run Program" command with program = $TARGETDIR$\olsync.exe.
When I run the uninstall from the start menu this works fine.
But when I run an installation of a new version, and get the "Uninstall previous version" message, this program doesn't run.
I understand that this is because the uninstall is done by the "Install/Remove MSI Package" command, that runs the uninstall of windows installer.
What is the proper way to cause the $TARGETDIR$\olsync.exe program to run also when I reach "Uninstall previous version"?

Thanks,
Avia Weiner,
Eshbel Technologies

Re: Previous version uninstallation

Posted: Thu Mar 17, 2011 10:31 am
by giaviv
Dear Avia,

First of all, since you are uninstalling, I wouldn't recommend placing your olsync.exe file in the TARGETDIR. Instead, consider placing it in the Support Files or in a File Bag (both are features that allow you to make files available to your installer at runtime without having the need to physically install them).
Secondly, the previous version uninstall is done by the MSIcode. If you were to look at your MSIcode (in case you built your setup with a template), you will find the section that checks if your program was previously installed (namely, If Variable NEEDSUPGRADE Equals TRUE). Assuming you did not play around with the code too much, it will be around line 30. Before the code there calls Install/Remove MSI Package, add your Run Program command!