mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-05 08:03:58 +00:00
Uninstall previous install when running Windows installer
This commit is contained in:
@@ -184,16 +184,34 @@ Function un.onInit
|
||||
FunctionEnd
|
||||
|
||||
Function .onInit
|
||||
; Abort installation if this is not a 64 bit system
|
||||
${IfNot} ${RunningX64}
|
||||
MessageBox MB_ICONSTOP|MB_OK "This version of ${PRODUCT_NAME} requires a 64-bit Windows system."
|
||||
Abort
|
||||
${EndIf}
|
||||
|
||||
; Abort installation if Picard is currently running
|
||||
FindWindow $0 "${WNDCLASS}" "${WNDTITLE}"
|
||||
StrCmp $0 0 continueInstall
|
||||
MessageBox MB_ICONSTOP|MB_OK "The application you are trying to install is running. Close it and try again."
|
||||
Abort
|
||||
continueInstall:
|
||||
|
||||
; Uninstall previous installation
|
||||
ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
|
||||
StrCmp $R0 "" skipUninstall
|
||||
|
||||
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
|
||||
"${PRODUCT_NAME} is already installed. $\n$\nClick `OK` to remove the \
|
||||
previous version or `Cancel` to cancel this upgrade." \
|
||||
IDOK uninstall
|
||||
Abort
|
||||
|
||||
uninstall:
|
||||
ClearErrors
|
||||
Exec $R0
|
||||
|
||||
skipUninstall:
|
||||
!insertmacro UnselectSection ${desktop}
|
||||
FunctionEnd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user