simpler comparison using VersionCompare, less labels and more LogicLib
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5406 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
598c3eccec
commit
c04f6795a9
1 changed files with 35 additions and 40 deletions
|
@ -32,6 +32,12 @@ RequestExecutionLevel admin
|
||||||
!include "Sections.nsh"
|
!include "Sections.nsh"
|
||||||
!include "LogicLib.nsh"
|
!include "LogicLib.nsh"
|
||||||
!include "Memento.nsh"
|
!include "Memento.nsh"
|
||||||
|
!include "WordFunc.nsh"
|
||||||
|
|
||||||
|
;--------------------------------
|
||||||
|
;Functions
|
||||||
|
|
||||||
|
!insertmacro VersionCompare
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Definitions
|
;Definitions
|
||||||
|
@ -916,49 +922,38 @@ Function PageReinstall
|
||||||
|
|
||||||
ReadRegStr $R0 HKLM "Software\NSIS" ""
|
ReadRegStr $R0 HKLM "Software\NSIS" ""
|
||||||
|
|
||||||
StrCmp $R0 "" 0 +2
|
${If} $R0 == ""
|
||||||
Abort
|
Abort
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
;Detect version
|
ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
|
||||||
ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMajor"
|
ReadRegDWORD $R1 HKLM "Software\NSIS" "VersionMinor"
|
||||||
IntCmp $R0 ${VER_MAJOR} minor_check new_version older_version
|
ReadRegDWORD $R2 HKLM "Software\NSIS" "VersionRevision"
|
||||||
minor_check:
|
ReadRegDWORD $R3 HKLM "Software\NSIS" "VersionBuild"
|
||||||
ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionMinor"
|
StrCpy $R0 $R0.$R1.$R2.$R3
|
||||||
IntCmp $R0 ${VER_MINOR} revision_check new_version older_version
|
|
||||||
revision_check:
|
|
||||||
ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionRevision"
|
|
||||||
IntCmp $R0 ${VER_REVISION} build_check new_version older_version
|
|
||||||
build_check:
|
|
||||||
ReadRegDWORD $R0 HKLM "Software\NSIS" "VersionBuild"
|
|
||||||
IntCmp $R0 ${VER_BUILD} same_version new_version older_version
|
|
||||||
|
|
||||||
new_version:
|
${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
|
||||||
|
${If} $R0 == 0
|
||||||
StrCpy $R1 "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
|
StrCpy $R1 "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
|
||||||
StrCpy $R2 "Uninstall before installing"
|
StrCpy $R2 "Add/Reinstall components"
|
||||||
StrCpy $R3 "Do not uninstall"
|
StrCpy $R3 "Uninstall NSIS"
|
||||||
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
|
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
|
||||||
StrCpy $R0 "1"
|
StrCpy $R0 "2"
|
||||||
Goto reinst_start
|
${ElseIf} $R0 == 1
|
||||||
|
StrCpy $R1 "An older version of NSIS is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
|
||||||
older_version:
|
StrCpy $R2 "Uninstall before installing"
|
||||||
|
StrCpy $R3 "Do not uninstall"
|
||||||
StrCpy $R1 "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
|
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
|
||||||
StrCpy $R2 "Uninstall before installing"
|
StrCpy $R0 "1"
|
||||||
StrCpy $R3 "Do not uninstall"
|
${ElseIf} $R0 == 2
|
||||||
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
|
StrCpy $R1 "A newer version of NSIS is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
|
||||||
StrCpy $R0 "1"
|
StrCpy $R2 "Uninstall before installing"
|
||||||
Goto reinst_start
|
StrCpy $R3 "Do not uninstall"
|
||||||
|
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install NSIS."
|
||||||
same_version:
|
StrCpy $R0 "1"
|
||||||
|
${Else}
|
||||||
StrCpy $R1 "NSIS ${VERSION} is already installed. Select the operation you want to perform and click Next to continue."
|
Abort
|
||||||
StrCpy $R2 "Add/Reinstall components"
|
${EndIf}
|
||||||
StrCpy $R3 "Uninstall NSIS"
|
|
||||||
!insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
|
|
||||||
StrCpy $R0 "2"
|
|
||||||
|
|
||||||
reinst_start:
|
|
||||||
|
|
||||||
nsDialogs::Create /NOUNLOAD 1018
|
nsDialogs::Create /NOUNLOAD 1018
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue