Getting the name of the Product mentioned in OLDPRODUCTS - Advanced Installer Community
Ralf Jansen
Posts: 4
Joined: Wed May 14, 2014 12:05 pm

Getting the name of the Product mentioned in OLDPRODUCTS

Hi,

i have a custom launch conditions that checks the OLDPRODUCT variable and stops installing when a previous version was detected. Because of some changes in Product naming in the past (but upgradecode didn't change) it might not be clear what product is meant. So i would like to confront the user with the name of the product that needs to be uninstalled. But it seems the only thing i have is the upgradecode but not the name of the product. Is it possible to get the name of the old product?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Getting the name of the Product mentioned in OLDPRODUCTS

Hi and welcome to Advanced Installer forums.

In order to achieve what you want, you can create you own custom action that searches for the name of the old installed version.

First, you can search for that name in the registry. For example, a package created with Advanced Installer stores the name of the product to the following registry path: Software\[Manufacturer]\[ProductName] (where [ProductName] is the key that contains the name of the product)

Secondly, if the name of the product was not stored to the registry as mentioned above, you can search it by its Upgrade Code.

All the Upgrade Codes are stored in the registry at the following path:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\{GUID}
Where {GUID} is the Upgrade Code of the product, encrypted as it is described in the Packed GUID’s article.

That {GUID} key contains all the Product Codes related to it, also encrypted as described in the article mentioned above.

Also, you can use the MsiEnumRelatedProducts function which returns the Product Codes related to an Upgrade Code. Then, you can go to the following registry path and take the name of the application related to the returned Product Code:

Code: Select all

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ProductCode}\DisplayName
Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ralf Jansen
Posts: 4
Joined: Wed May 14, 2014 12:05 pm

Re: Getting the name of the Product mentioned in OLDPRODUCTS

Hi Eusebiu,

thats a starter thanks ;)
i assume the last mentioned method would be the way to go. When fiddling in the registry this way i have to also respect the Wow6432Node thing on a 64Bit OS in the registry and if its installed per user or for all (aka looking in HKCU or HKLM) right?
Then this gets nasty :(
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Getting the name of the Product mentioned in OLDPRODUCTS

Hi,

Indeed, I'm afraid that you have to search in the "Wow6432Node" registry key, on a 64-bit machine, but you don't need to look under the HKCU section because all the Product Codes are registered under the HKLM key.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”