pillairohit
27th March 2009 12:30 UTC
Incorrect Windows Version during Uninstallation
Hi.
I have an application that checks for the windows version during its installation & un-installation.
The logic used for finding the windows version is the same as in Windows_Version_Detection.
I'm running Windows Vista SP1 and NSIS 2.44.
During installation phase, the version is being detected correctly.
However, the same function during un-installation is returning the version as Win XP.
I even tried the methods used in Version_plug-in and NSIS-OS_plug-in but to no avail.
I'm stuck @ this issue since quite a few days. I would really appreciate any help in this matter.
Thanks & regards.
Rohit.
Anders
27th March 2009 15:46 UTC
Have you set it to emulate WinXP? (Check the uninstaller.exe properties)
If not, try using WinVer.nsh
pillairohit
31st March 2009 10:22 UTC
uninstaller.exe is not emulating XP, if thats what you mean by Compatibility Mode.
Moreover, i'm using Winver.nsh. Its not working in the uninstallation phase.
Animaether
2nd April 2009 11:09 UTC
Have you tried with simple code?
!addplugindir "."
!addincludedir "."
RequestExecutionLevel user
!include "nsDialogs.nsh"
!include "winmessages.nsh"
!include "logiclib.nsh"
!include "winver.nsh"
OutFile "test.exe"
Function .onInit
FunctionEnd
Section
${If} ${IsWin95}
MessageBox MB_OK "Windows 95"
${ElseIf} ${IsWin98}
MessageBox MB_OK "Windows 98"
${ElseIf} ${IsWinME}
MessageBox MB_OK "Windows ME"
${ElseIf} ${IsWinNT4}
MessageBox MB_OK "Windows NT"
${ElseIf} ${IsWin2000}
MessageBox MB_OK "Windows 2000"
${ElseIf} ${IsWinXP}
MessageBox MB_OK "Windows XP"
${ElseIf} ${IsWin2003}
MessageBox MB_OK "Windows 2003"
${ElseIf} ${IsWinVista}
MessageBox MB_OK "Windows Vista"
${ElseIf} ${IsWin2008}
MessageBox MB_OK "Windows 2008"
${EndIf}
WriteUninstaller "$DESKTOP\UninstallerTest.exe"
SectionEnd
Section "un."
${If} ${IsWin95}
MessageBox MB_OK "Windows 95"
${ElseIf} ${IsWin98}
MessageBox MB_OK "Windows 98"
${ElseIf} ${IsWinME}
MessageBox MB_OK "Windows ME"
${ElseIf} ${IsWinNT4}
MessageBox MB_OK "Windows NT"
${ElseIf} ${IsWin2000}
MessageBox MB_OK "Windows 2000"
${ElseIf} ${IsWinXP}
MessageBox MB_OK "Windows XP"
${ElseIf} ${IsWin2003}
MessageBox MB_OK "Windows 2003"
${ElseIf} ${IsWinVista}
MessageBox MB_OK "Windows Vista"
${ElseIf} ${IsWin2008}
MessageBox MB_OK "Windows 2008"
${EndIf}
SectionEnd
( okay, not so simple - couldn't find a command to get -just- the windows string out of winver.nsh ? I must be blind. Anyway, that's what the select/case is for. )
pillairohit
8th April 2009 10:06 UTC
Hi.
Thanks for the sample code. The code works on it own. However, when i try to integrate the same code with my script, the un-installer still returns XP as the windows version.
I even tried by calling the sample code by keeping it in a header file, and then calling it from my script.
However, in all cases, the version being returned is XP.
Is there any direction you may be able to point me, to find out what could be reason that my un-installer is still returning the incorrect version.
Thanks and regards.
Rohit.
Animaether
8th April 2009 11:01 UTC
haven't the foggiest, I'm afraid.. :\ unless something in your uninstaller is overwriting defines used by WinVer.nsh.
If you can share the code of the uninstaller, that would be a tremendous help.