padavid
Posts: 2
Joined: Thu Apr 27, 2023 8:10 am

Block upgrade from a too old version

Thu Apr 27, 2023 8:53 am

I want to prevent upgrades from before a specific version.

When I install version 5.1 it should check the previous version and only continue with the new installer if there isn't a previous version installed or if the previous version is above a 5.0.

I've looked into Requirements --> Launch Conditions --> Custom where I found OLDPRODUCTS.
Then I went to Product Information --> Upgrades where I checked "Customize Advanced Installer upgrade rules" and changed Min version from 0.0.1 to 5.0.0.

This however didn't block the installation, but rather generated parallel installations.

Next I unchecked "Customize Advanced Installer upgrade rules" and added a custom rule:
[|UpgradeCode] Min: 4.0.0 Property: UPGRADE_OK
I haven't found any documentation on these fields but my assumption is that it checks the old upgrade code whether it is within the range and sets the propery UPGRADE_OK. Is this correct?

Then under Launch Conditions I added the condition:
(Not Installed) OR (UPGRADE_OK)

This however didn't prevent an upgrade.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Block upgrade from a too old version

Fri Apr 28, 2023 1:00 pm

Hello David and welcome to our forums,

To be fully honest with you, this scenario does not really sound that good from a UX POV.

However, if you want to prevent your setup from installing if an older version is installed, here's how you can proceed:
  • go to "Searches" page and create a "Product Version (identify by UpgradeCode)" extended search
Screenshot_114.png
Screenshot_114.png (22.78KiB)Viewed 5247 times

This search should return the ProductVersion of your previously installed setup, based on the UpgradeCode.
Unlike the ProductCode, the UpgradeCode is a GUID representing a related set of products. A set of different versions of your application will have the same UpgradeCode. This enables newer versions of your application to search and upgrade previous versions installed on the same computer.

The UpgradeCode property is stored within the .aip project file.
You can find the UpgradeCode in the "Product Details" page --> "Product IDs" tab.
  • you can then create launch condition based on the result of that search (using the search property, e.g. RESULT_PROPERTY)
You can also give a message like this:
This setup requires at least version 5 in order to upgrade. Please uninstall the older version < 5.0 and then proceed with the installation once again.
Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

padavid
Posts: 2
Joined: Thu Apr 27, 2023 8:10 am

Re: Block upgrade from a too old version

Tue May 02, 2023 9:58 am

Thanks,

I ended up using two search parameters, one to detect the threshold version and one to detect any version (because "Not Installed" meant something else)

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Block upgrade from a too old version

Tue May 02, 2023 2:37 pm

You're always welcome!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”