mrdcs92
Posts: 7
Joined: Wed Jul 10, 2019 10:43 pm

Check previous version upon new installation

Tue Aug 20, 2019 2:14 am

Hello,

My current problem is that I wish to display the currently installed version of my product before installing a newer version. Currently, my product will silently uninstall the current version and then display the new installation when running my exe. I would like to display a prompt before this step so that the user can see what version they have currently installed, and have the option to accept or refuse the new installation.

Is there a way I can accomplish this?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Check previous version upon new installation

Tue Aug 20, 2019 1:14 pm

Hi,

When an old version of your product is found on current machine during an upgrade installation the OLDPRODUCTS property is set to the product code of the old version. Therefore you could create your own custom action to be displayed only when the OLDPRODUCTS property is set (that actually means the current installation is an upgrade installation).

For instance you can go to "Custom Actions" page and add a new "Display message box" custom action using the following condition:

Code: Select all

OLDPRODUCTS
Hope this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

mrdcs92
Posts: 7
Joined: Wed Jul 10, 2019 10:43 pm

Re: Check previous version upon new installation

Tue Aug 20, 2019 1:49 pm

Hi Daniel,

Thank you for your response! I will try it out right now. Is there a way I can detect the version number of that older version?

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Check previous version upon new installation

Thu Aug 22, 2019 1:55 pm

Hello,

Yes, we have a predefined extended search in our "Search" page. This is "New Extended Search -> Product Version (identify by Upgrade Code)" search type, but currently due to an issue in our product such a search type cannot be configured into a setup project. This issue will be fixed in our next version of Advanced Installer which should be out by the end of next month.

In the meantime, as a workaround you could try to create your own custom action to search the "ProductVersion" property by "ProductCode" (this value is set in the OLDPRODUCTS property) of your old product. For instance you could use the "MsiGetProductInfoW" function.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Kai
Posts: 7
Joined: Fri Oct 02, 2020 10:02 am

Re: Check previous version upon new installation

Mon Mar 15, 2021 2:05 pm

Hi,

we're also trying to fetch the number of the currently installed version during an update.

The search 'Product Version (identify by Upgrade Code)' returns '1' when we pass the Upgrade Code. (Expected would be something like '2.0.0'...)

Are we doing it wrong?

Also, is there an example on how to use "MsiGetProductInfoW" from the Custom Actions alternatively?

Kind regards,
Kai

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Check previous version upon new installation

Thu Mar 18, 2021 8:22 am

Hi Kai,

Indeed it seems our 'Product Version (identify by Upgrade Code)' extended search always returns 1 if a product version with the specified UpgradeCode is found. I apologize for my previous misleading info.

In what regards an example on how to use "MsiGetProductInfoW", I am afraid we do not have any such example, but as a starting point you can have a look over "Determining Installation Context" article.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”