From a6c7682c84c444931b2253dd3eb843349b13f1aa Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Wed, 20 Apr 2022 14:25:36 -0700 Subject: [PATCH] nsis windows installer detect running, ask to not, abort --- windows/nsis/cwtch-installer.nsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/windows/nsis/cwtch-installer.nsi b/windows/nsis/cwtch-installer.nsi index d0288de3..a2406028 100644 --- a/windows/nsis/cwtch-installer.nsi +++ b/windows/nsis/cwtch-installer.nsi @@ -45,6 +45,17 @@ InstallDirRegKey HKCU "Software\Cwtch" "installLocation" ShowInstDetails show +; Init / make sure isn't running +; https://nsis.sourceforge.io/Check_whether_your_application_is_running + +Function .onInit +FindProcDLL::FindProc "Cwtch.exe" +StrCmp $R0 "1" found not_found +found: + MessageBox MB_ICONEXCLAMATION|MB_OK "Cwtch is still running, please exit it before running installer" /SD IDOK + Abort +not_found: + ; Pages --------