SubZero
Posts: 63
Joined: Mon Mar 14, 2011 10:29 am

Determining the Old Version during upgrade/update :).

Is it possible to determine the old version during an upgrade (e.g. Update from 2.0 -> 2.1 I would like to get 2.0)? We have a registry key containing that version so I can use that, but If some user deletes the entry for some reason I won't get it using that way so is there a less error prone way?

Thanks again and sorry for asking that many questions ;).
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Determining the Old Version during upgrade/update :).

Hi,

All packages registered with Windows Installer have an entry in this location.
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{guid}
Please note that this location can also be found under "Wow6432Node" on 64 bit machines. The following article from MSDN can give you more details.

Approach you can try if you know the old version product code:
Simply add a registry search from the Search page using the old version Product Code using one of the appropriate registry values( above article ) that holds the old version:
http://www.advancedinstaller.com/user-guide/search.html

Approach you can try if you don't know the old version product code:
You can use the information from the registry key in your own custom action to get the installed old version. In the same custom action you can get a list with the Product Codes of the older versions of your installation package from the OLDPRODUCTS property. This property is set only in a package which upgrades another package. The custom action should also be conditioned using OLDPRODUCTS.

We are here to help, please don't hesitate to ask any questions.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”