Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 16th May 2017, 06: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
Old 16th May 2017, 11:05   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,533
Are you using InstalldirRegKey?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th May 2017, 11:13   #3
Zni
Junior Member
 
Join Date: May 2017
Posts: 2
As a matter of fact, I was using InstallDirRegKey, but not anymore! Thanks for pointing to the right direction.
Zni is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump