summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-12-20 14:23:17 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-12-20 14:27:56 (GMT)
commit5fb907768fb3bfbd095564146b19a3a8492b91ec (patch)
tree79f900b271579058e76cd7f7577311e92a305a48 /Swift/Packaging/nsis
parentf47bbd8381981f34c0ede1184b14995951a68593 (diff)
downloadswift-5fb907768fb3bfbd095564146b19a3a8492b91ec.zip
swift-5fb907768fb3bfbd095564146b19a3a8492b91ec.tar.bz2
Refuse to run the uninstaller while Swift is still running
Resolves: #686
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