Added uninstaller check for running game

This commit is contained in:
DeadlySurprise
2015-02-20 21:02:17 +01:00
parent d3dab83de8
commit c50feeb4e2

View File

@@ -18,6 +18,7 @@
!include "MUI2.nsh"
!include "FileFunc.nsh"
!include "WordFunc.nsh"
!include "nsProcess.nsh"
Name "OpenRA"
OutFile "OpenRA.Setup.exe"
@@ -211,6 +212,7 @@ Function ${UN}Clean
Delete $INSTDIR\eluant.dll
Delete $INSTDIR\freetype6.dll
Delete $INSTDIR\zlib1.dll
Delete $INSTDIR\SDL2-CS.dll
RMDir /r $INSTDIR\Support
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA"
Delete $INSTDIR\uninstaller.exe
@@ -227,7 +229,19 @@ FunctionEnd
!insertmacro Clean "un."
Section "Uninstall"
${nsProcess::FindProcess} "OpenRa.Game.exe" $R0
IntCmp $R0 0 gameRunning
${nsProcess::FindProcess} "OpenRa.exe" $R0
IntCmp $R0 0 gameRunning
${nsProcess::FindProcess} "OpenRa.Editor.exe" $R0
IntCmp $R0 0 gameRunning
${nsProcess::Unload}
Call un.Clean
Goto end
gameRunning:
MessageBox MB_OK|MB_ICONEXCLAMATION "OpenRa is running. Please close it first" /SD IDOK
abort
end:
SectionEnd
;***************************