Read currently installed Product Version

Got a problem you cannot solve? Try here.
kimatunit4
Posts: 7
Joined: Tue Jul 28, 2020 5:07 am

Read currently installed Product Version

Postby kimatunit4 » Fri Oct 16, 2020 4:40 am

Hi,

In the Project Options -> Product Version

I would like to know if there is away to compare Product Version of already installed (older) product with a newer that is being installed. So I can do a simple check to prevent an older version to uninstall a newer.

Thanks,

Kim

FrancescoT
Site Admin
Posts: 5047
Joined: Sun Aug 22, 2010 4:28 am

Re: Read currently installed Product Version

Postby FrancescoT » Fri Oct 16, 2020 12:04 pm

The PRODUCTCODE is unique in each different product, and it doesn't change when building different versions of the same product.

You may eventually query the version number of the installed product, and which gets stored into the local system registry.

For example:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PRODUCTCODE}\Version

Hope this helps you.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

kimatunit4
Posts: 7
Joined: Tue Jul 28, 2020 5:07 am

Re: Read currently installed Product Version

Postby kimatunit4 » Sat Oct 17, 2020 3:08 pm

Thanks,

I was hoping there was something that was built in like NEEDSUPGRADE and could be used to compare to VERSION in a simple way.

But reading from Windows registry goes as well like below:

if Variable NEEDSUPGRADE Equals TRUE
Set Variable INSTALLED_VERSION to
Read Registry Key HKLM\SOFTWARE\...\Uninstall\$PRODUCTCODE$\DisplayVersion into INSTALLED_VERSION
if Variable INSTALLED_VERSION Greater Than $VERSION$
MessageBox: Newer xxx version detected, A newer version of xxx is installed already.
Terminate Installation
else
Comment: Do what needs to be done if an older installation is in place already
end
...[*]


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 27 guests