View Single Post
Old 16th May 2017, 07:42   #1
Zni
Junior Member
 
Join Date: May 2017
Posts: 2
Version information oddly comes from the version-to-be-uninstalled

I'm trying to uninstall the previous version off my application I installed with NSIS installer before installing the new version. In the .nsi script of the new version I define
code:
!define AppVersion "1.1.3"


The previous version is 1.1.2. I call the uninstaller of previous version with
code:
ExecWait
although the new installer is started before the old uninstaller finishes (but that's another topic). I uninstall the old version successfully and continue with the installer of the new version. To my astonishment, AppVersion gets the old value from the uninstalled version, i.e. 1.1.2! Almost everywhere I use the version number, e.g.
code:
InstallDir "C:\foo\bar\${AppVersion}"
the version number is 1.1.2. However, the version number I write to the registry is the correct new one, 1.1.3, although I use AppVersion for that, too:
code:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${RegistryName}" "DisplayVersion" "${AppVersion}"


If I do not have the old version installed, the new version installer works fine with the correct AppVersion 1.1.3.

What's the problem here?
Zni is offline   Reply With Quote