Check for both 32 and 64bit cockatrice when uninstalling (#3323)

This commit is contained in:
ctrlaltca 2018-07-12 23:58:56 +02:00 committed by GitHub
parent c01aad6767
commit b61c07a205
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,17 +154,39 @@ FunctionEnd
Function componentsPagePre Function componentsPagePre
${If} $PortableMode = 0 ${If} $PortableMode = 0
SetShellVarContext all SetShellVarContext all
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst # uninstall 32bit version
SetRegView 32
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done32
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst32
Abort Abort
uninst: uninst32:
ClearErrors ClearErrors
ExecWait "$R0" ExecWait "$R0"
done: done32:
# uninstall 64bit version
${If} ${NSIS_IS_64_BIT} == 1
SetRegView 64
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done64
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64
Abort
uninst64:
ClearErrors
ExecWait "$R0"
done64:
${EndIf}
${Else} ${Else}
Abort Abort
${EndIf} ${EndIf}