Upgrading and Custom Action - 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!

Stardraw
Posts: 14
Joined: Thu Oct 16, 2008 12:39 pm

Upgrading and Custom Action

I need to run an executable if I am upgrading an old version of my product.
This executable will convert some data stored in the old program so it must be run before the old program is uninstalled.
I figure that this exe will write out to a well known temporary file, then complete the uninstall and then when the new program has been installed I can have another executable that reads in that file and updates the newly installed program.
The problem I'm having is getting my initial exe to be run before the old program is uninstalled.
Where should I put this custom action in the sequence?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Upgrading and Custom Action

Hi,

Older versions of the package are detected during the "InstallExecuteSequence" -> "FindRelatedProducts" standard action. Therefore, a custom action which runs only if an older version is found can be scheduled after "FindRelatedProducts". Since the standard action will run as deferred, your custom action should also be deferred.

If an older version of the package is found, its Product Code will be added to the OLDPRODUCTS property. Therefore, this property can be used to condition the custom action (if OLDPRODUCTS is not empty an older version was found so the custom action should run).

Please note that this works only for packages which use the automated upgrade feature or use the Upgrade Code of the older MSI in the "Upgrades" page.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stardraw
Posts: 14
Joined: Thu Oct 16, 2008 12:39 pm

Re: Upgrading and Custom Action

That worked great.

Thanks a lot for your great support

Return to “Common Problems”