mirror of https://github.com/OpenTTD/OpenTTD
(svn r21146) -Fix [FS#4212]: make sure to be upgraded openttd is not running when installing (Win32)
parent
67d071d033
commit
6543339f91
|
@ -102,6 +102,9 @@ Page custom SelectCDEnter SelectCDExit ": TTD folder"
|
||||||
;--------------------------------------------------------------
|
;--------------------------------------------------------------
|
||||||
; (Core) OpenTTD install section. Copies all internal game data
|
; (Core) OpenTTD install section. Copies all internal game data
|
||||||
Section "!OpenTTD" Section1
|
Section "!OpenTTD" Section1
|
||||||
|
; Make sure to be upgraded OpenTTD is not running
|
||||||
|
Call CheckOpenTTDRunning
|
||||||
|
|
||||||
; Overwrite files by default, but don't complain on failure
|
; Overwrite files by default, but don't complain on failure
|
||||||
SetOverwrite try
|
SetOverwrite try
|
||||||
|
|
||||||
|
@ -517,7 +520,6 @@ Abort:
|
||||||
Done:
|
Done:
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; Check whether we're not running an installer for NT on 9x and vice versa
|
; Check whether we're not running an installer for NT on 9x and vice versa
|
||||||
Function CheckWindowsVersion
|
Function CheckWindowsVersion
|
||||||
|
@ -537,6 +539,23 @@ Abort:
|
||||||
Done:
|
Done:
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; Check whether OpenTTD is running
|
||||||
|
Function CheckOpenTTDRunning
|
||||||
|
IfFileExists "$INSTDIR\openttd.exe" 0 Done
|
||||||
|
Retry:
|
||||||
|
FindProcDLL::FindProc "openttd.exe"
|
||||||
|
Pop $R0
|
||||||
|
IntCmp $R0 1 0 Done
|
||||||
|
ClearErrors
|
||||||
|
Delete "$INSTDIR\openttd.exe"
|
||||||
|
IfErrors 0 Done
|
||||||
|
ClearErrors
|
||||||
|
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "OpenTTD is running. Please close it and retry." IDRETRY Retry
|
||||||
|
Abort
|
||||||
|
Done:
|
||||||
|
FunctionEnd
|
||||||
|
|
||||||
Var OLDVERSION
|
Var OLDVERSION
|
||||||
Var UninstallString
|
Var UninstallString
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue