Uninstall previous versions - with strings! - 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!

PhilB
Posts: 95
Joined: Fri Jul 06, 2007 4:13 pm

Uninstall previous versions - with strings!

Normally we distribute our product(s) as major upgrades. Following a major re-design I would like to force the product to be completely uninstalled prior to the new install if the existing version number is below a certain value. I'm thinking along the lines of using the "Uninstall previous versions" CA with the version number check as a condition. I'm having a bit of trouble finding out how to retrieve the version number and was hoping you could either point me in the right direction or alternatively suggest a different approach.

Thanks,

Phil
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Uninstall previous versions - with strings!

Hi Phil,

This is the default behavior of packages created with Advanced Installer. The following article has more details.

If the product you wish to uninstall has is different, i.e. has different upgradecode, then you can add it to the list from the same Upgrades page, mentioned in the above article.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
PhilB
Posts: 95
Joined: Fri Jul 06, 2007 4:13 pm

Re: Uninstall previous versions - with strings!

Bogdan wrote:This is the default behavior of packages created with Advanced Installer.
I should have mentioned that for the product in question we have had to reverse the default behaviour, i.e. install the new product and then uninstall the old one to get around some custom action issues. I need to retain this functionality except when upgrading from a specific version or earlier, hence my original question.

Regards,

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

Re: Uninstall previous versions - with strings!

Hi Phil,

Since you are upgrading after install, the only solution for determining the installed version is a custom action. You can find older versions through MsiEnumRelatedProducts function and get the version for each one through MsiGetProductInfo.

To condition the uninstall older versions custom action you can use a property. So the custom action which finds older versions should set a property based on what it finds. For a custom action to set a property it needs to have access to the installer session. Our user guide contains a sample C++ DLL custom action which may get you started.

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

Return to “Common Problems”