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
Read currently installed Product Version
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Read currently installed Product Version
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.
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
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
-
- Posts: 18
- Joined: Tue Jul 28, 2020 5:07 am
Re: Read currently installed Product Version
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
...[*]
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
...[*]
Who is online
Users browsing this forum: No registered users and 119 guests