Page 1 of 1

Compare previous version and new installation verion

Posted: Tue Mar 04, 2014 10:40 am
by tbushell
Hi, Guys

I am currently working on a project of modifying the installer. The idea is to check the previously installed version, then compare with the new installation version. If it's a major upgrade, then show user it's a major upgrade, blah blah blah...
I am using the Get File Version command to get the older version from user selected path. But the issue I had is during the installation, in the step progressprereq, it detects NEEDSUPGRADE, and then it remove all the files in the target folder. So I always get file version 0.0.0.0

Is there a way to get the installed version without requesting user selecting the path of installation folder. Or is there a way to get installed version directly?
Thanks for your time.

Re: Compare previous version and new installation verion

Posted: Tue Mar 04, 2014 1:00 pm
by FrancescoT
Dear User,

I am not quite sure to follow correctly which is your effective target, anyway you could read the target system registry to acquire the installed app version.

This is data is stored with the values; "DisplayVersion" or "VersionMajor" and "VersionMinor" under the registry path;

- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<PRODUCTCODE>

on x64 OS platforms, if the installed product is a native 32 bit application, those values are stored under;

- HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\<PRODUCTCODE>

Hope this helps you.

Regards

Re: Compare previous version and new installation verion

Posted: Tue Mar 11, 2014 11:51 am
by tbushell
Thanks Francesco. All I want to do is compare previous version number with the new version number. If the new version number higher than the previous installed one, I will warn the user with certain information.
And your solution solve the problem. Thank you very much.

Re: Compare previous version and new installation verion

Posted: Tue Mar 11, 2014 1:34 pm
by FrancescoT
:D