This commit is contained in:
tooomm 2026-07-06 13:41:13 +02:00 committed by GitHub
parent 93c55202e4
commit 1d825112b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,7 @@ Page Custom PortableModePageCreate PortableModePageLeave
Function .onInit Function .onInit
${If} ${NSIS_IS_64_BIT} == 1 #NSIS 64bit ${If} ${NSIS_IS_64_BIT} == 1 # NSIS 64bit
${IfNot} ${RunningX64} ${IfNot} ${RunningX64}
MessageBox MB_OK|MB_ICONSTOP "This version of Cockatrice requires a 64-bit Windows system." MessageBox MB_OK|MB_ICONSTOP "This version of Cockatrice requires a 64-bit Windows system."
Abort Abort
@ -170,11 +170,11 @@ SetShellVarContext all
SetRegView 64 SetRegView 64
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString" ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "QuietUninstallString"
StrCmp $R0 "" done StrCmp $R0 "" done64
DetailPrint "Removing previous version..." DetailPrint "Removing previous version..."
ExecWait '$R0' ExecWait '$R0'
done: done64:
FunctionEnd FunctionEnd
@ -226,7 +226,7 @@ ${If} $PortableMode = 0
SetRegView 64 SetRegView 64
ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString" ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "UninstallString"
StrCmp $R0 "" done StrCmp $R0 "" done64
${If} $ReinstallMode = 0 ${If} $ReinstallMode = 0
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "A previous version of Cockatrice must be uninstalled before installing the new one." IDOK uninst64
@ -235,11 +235,11 @@ ${If} $PortableMode = 0
Goto uninst64 Goto uninst64
${EndIf} ${EndIf}
uninst: uninst64:
ClearErrors ClearErrors
ExecWait "$R0" ExecWait "$R0"
done: done64:
${Else} ${Else}
Abort Abort
@ -302,13 +302,13 @@ ${If} $PortableMode = 0
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMajor" "@CPACK_PACKAGE_VERSION_MAJOR@"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice" "VersionMinor" "@CPACK_PACKAGE_VERSION_MINOR@"
IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedistExists PastVcRedistCheck IfFileExists "$INSTDIR\vc_redist.x64.exe" VcRedist64Exists PastVcRedist64Check
VcRedistExists: VcRedist64Exists:
ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart' ExecWait '"$INSTDIR\vc_redist.x64.exe" /passive /norestart'
DetailPrint "Sleep to ensure unlock of vc_redist file after installation..." DetailPrint "Sleep to ensure unlock of vc_redist file after installation..."
Sleep 3000 Sleep 3000
Delete "$INSTDIR\vc_redist.x64.exe" Delete "$INSTDIR\vc_redist.x64.exe"
PastVcRedistCheck: PastVcRedist64Check:
${Else} ${Else}
; Create the file the application uses to detect portable mode ; Create the file the application uses to detect portable mode