More robust uninstall handling on the "Already Installed" page in the installer
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6374 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9ebabcd509
commit
4a221a8995
1 changed files with 17 additions and 16 deletions
|
@ -953,11 +953,10 @@ Function PageLeaveReinstall
|
||||||
|
|
||||||
${NSD_GetState} $R2 $R1
|
${NSD_GetState} $R2 $R1
|
||||||
|
|
||||||
StrCmp $R0 "1" 0 +2
|
StrCmp $R0 "1" 0 +2 ; Existing install is not the same version?
|
||||||
StrCmp $R1 "1" reinst_uninstall reinst_done
|
StrCmp $R1 "1" reinst_uninstall reinst_done
|
||||||
|
|
||||||
StrCmp $R0 "2" 0 reinst_done
|
StrCmp $R1 "1" reinst_done ; Same version, skip to add/reinstall components?
|
||||||
StrCmp $R1 "1" reinst_done reinst_uninstall
|
|
||||||
|
|
||||||
reinst_uninstall:
|
reinst_uninstall:
|
||||||
ReadRegStr $R1 HKLM "${MEMENTO_REGISTRY_KEY}" "UninstallString"
|
ReadRegStr $R1 HKLM "${MEMENTO_REGISTRY_KEY}" "UninstallString"
|
||||||
|
@ -966,25 +965,27 @@ Function PageLeaveReinstall
|
||||||
HideWindow
|
HideWindow
|
||||||
|
|
||||||
ClearErrors
|
ClearErrors
|
||||||
ExecWait '$R1 _?=$INSTDIR'
|
ExecWait '$R1 _?=$INSTDIR' $0
|
||||||
|
|
||||||
BringToFront
|
BringToFront
|
||||||
|
|
||||||
IfErrors no_remove_uninstaller
|
${IfThen} ${Errors} ${|} StrCpy $0 2 ${|} ; ExecWait failed, set fake exit code
|
||||||
IfFileExists "$INSTDIR\Bin\makensis.exe" no_remove_uninstaller
|
|
||||||
|
|
||||||
Delete $R1
|
${If} $0 <> 0
|
||||||
RMDir $INSTDIR
|
${OrIf} ${FileExists} "$INSTDIR\Bin\makensis.exe"
|
||||||
StrCpy $R1 ""
|
${If} $0 = 1 ; User aborted uninstaller?
|
||||||
|
StrCmp $R0 "2" 0 +2 ; Is the existing install the same version?
|
||||||
no_remove_uninstaller:
|
Quit ; ...yes, already installed, we are done
|
||||||
|
Abort
|
||||||
StrCmp "" $R1 0 +3
|
${EndIf}
|
||||||
MessageBox MB_ICONEXCLAMATION "Unable to uninstall!"
|
MessageBox MB_ICONEXCLAMATION "Unable to uninstall!"
|
||||||
Abort
|
Abort
|
||||||
|
${Else}
|
||||||
StrCmp $R0 "2" 0 +2
|
StrCpy $0 $R1 1
|
||||||
Quit
|
${IfThen} $0 == '"' ${|} StrCpy $R1 $R1 -1 1 ${|} ; Strip quotes from UninstallString
|
||||||
|
Delete $R1
|
||||||
|
RMDir $INSTDIR
|
||||||
|
${EndIf}
|
||||||
|
|
||||||
reinst_done:
|
reinst_done:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue