canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Refusing to upgrade too old a version?

Hello everyone.

Is there a way to refuse an upgrade to a version that is "too old"? I could probably set a property in case a version that is too old is found, and then in a custom action abort the installation. But then I would have to tell the user what went wrong, etc. and if there is a mechanism for this already I'd rather use that.

By the way, Is there documentation of the properties such as AI_NEWERPRODUCTFOUND?



With best regards

Clemens Anhuth
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Re: Refusing to upgrade too old a version?

Hi,
Is there a way to refuse an upgrade to a version that is "too old"?
This can be done defining your own custom upgrades in "Upgrades" page:
http://www.advancedinstaller.com/user-g ... rades.html
By the way, Is there documentation of the properties such as AI_NEWERPRODUCTFOUND?
This is the default property used by Advanced Installer to store products ("Product Code") that are newer than the installed one. You can use any property you want in your custom upgrades.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Refusing to upgrade too old a version?

Hello gig,
gigi wrote:
Is there a way to refuse an upgrade to a version that is "too old"?
This can be done defining your own custom upgrades in "Upgrades" page:
http://www.advancedinstaller.com/user-g ... rades.html
I read the page a few times, but I do not see how it offers a way to deny upgrades.

My understanding of the "Upgrades" functionality is that it sets properties based on minimal, maximum and range matches of the version number. Is this correct?

I used this to conditionally set my own property which I later check in a custom action. The custom action displays a Shell.Popup() with text to inform these user about this and then returns 2 to abort the installation.

This works, but looks odd because of the popup dialog.

For me the ideal approach would be to show another "wizard" page with the text that informs the user and then ends the installation.

I hoped there was an already existing mechanism for this, so that I'd only need to set for example AI_PRODUCTFOUNDNOTUPGRADABLE and have AI do the rest for me automatically.

I was going to suggest to add this as a feature request, but now I am not so sure how common this case is anyway, because the installer can do the "complete" deinstallation of the existing installation for the user anyway, it would only have to display another page warning the user about the fact the he'll loose all settings (or data stored in the installation folder). So it would go like this:

- In the Upgrades page set a property if the existing version is too old

- After selecting to install into the folder of the existing installation show a wizard page warning about the fact that all existing settings and data will be lost if the user proceeds

- Let AI deinstall the existing installation as usual (the deinstaller of the old version will think that it is being deinstalled for an upgrade and as a result leave data and configuration files in the installation directory, instead of deleting them)

- In a custom action (script) remove all configuration and data files from the installation directory

- Let AI go about the installation as usual

Does that sound about right?

By the way, Is there documentation of the properties such as AI_NEWERPRODUCTFOUND?
This is the default property used by Advanced Installer to store products ("Product Code") that are newer than the installed one. You can use any property you want in your custom upgrades.[/quote]

Do any other properties like AI_NEWERPRODUCTFOUND exist that trigger a certain behavior of AI?



With best regards

Clemens Anhuth
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Re: Refusing to upgrade too old a version?

Hi Clemens,
My understanding of the "Upgrades" functionality is that it sets properties based on minimal, maximum and range matches of the version number. Is this correct?
Yes, the Upgrades page allows you to detect other Windows Installer products based on UpgradeCode and ProductVersion. Optionally, you can uninstall the detected products or choose to migrate the Feature states. Basically, this page allows you to edit the Windows Installer Upgrade table.
This works, but looks odd because of the popup dialog.
You could also use an "Error Message" Custom Action, which will have the same effect.
Does that sound about right?
After detecting a specific product using the Upgrades page you can proceed in whatever way best suits your needs. The approach you have described sounds right to me.
Do any other properties like AI_NEWERPRODUCTFOUND exist that trigger a certain behavior of AI?
See this page for a list of Properties used by Advanced Installer.

Hope this helps.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”