Page 1 of 1
Read currently installed Product Version
Posted: Fri Oct 16, 2020 4:40 am
by kimatunit4
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
Re: Read currently installed Product Version
Posted: Fri Oct 16, 2020 12:04 pm
by FrancescoT
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.
Re: Read currently installed Product Version
Posted: Sat Oct 17, 2020 3:08 pm
by kimatunit4
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
...[*]