summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Packaging/nsis')
-rw-r--r--Swift/Packaging/nsis/swift.nsi11
1 files changed, 10 insertions, 1 deletions
diff --git a/Swift/Packaging/nsis/swift.nsi b/Swift/Packaging/nsis/swift.nsi
index cff4a92..f8e592d 100644
--- a/Swift/Packaging/nsis/swift.nsi
+++ b/Swift/Packaging/nsis/swift.nsi
@@ -33,12 +33,20 @@ SetCompressor lzma
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
-Function .onInit
+!macro checkNotRunning
FindProcDLL::FindProc "Swift.exe"
IntCmp $R0 1 0 notRunning
MessageBox MB_OK|MB_ICONEXCLAMATION "Swift is running. Please close it first" /SD IDOK
Abort
notRunning:
+!macroend
+
+Function .onInit
+!insertmacro checkNotRunning
+FunctionEnd
+
+Function un.onInit
+!insertmacro checkNotRunning
FunctionEnd
# default section start
@@ -122,6 +130,7 @@ sectionEnd
# create a section to define what the uninstaller does.
# the section will always be named "Uninstall"
section "Uninstall"
+
# Always delete uninstaller first
delete $INSTDIR\uninstaller.exe