diff options
author | Gerald Combs <gerald@wireshark.org> | 2013-02-20 01:19:42 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2013-02-20 01:19:42 +0000 |
commit | bd4cffae586b5207aae62dcb8a55690b23e42dd0 (patch) | |
tree | 5f89150713a57eb73ee3e5721481a6ac4637eb27 /packaging/nsis | |
parent | cf1070b4b12e97a7b2c233bdc966e7ff3972acb5 (diff) |
When any of our executables start on Windows create or open a "Wireshark
is running" mutex. Have the NSIS installer check for this mutex and ask
the user to close Wireshark if it's found. While not perfect this makes
the WinSparkle update process much less annoying.
svn path=/trunk/; revision=47758
Diffstat (limited to 'packaging/nsis')
-rw-r--r-- | packaging/nsis/wireshark.nsi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index d432933e1b..d7d2f69609 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -210,6 +210,17 @@ Function .onInit ${EndIf} !endif +; See if Wireshark is running +; http://nsis.sourceforge.net/Check_whether_your_application_is_running +checkRunning: +System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' + IntCmp $R0 0 notRunning + System::Call 'kernel32::CloseHandle(i $R0)' + ; You'd better go catch it. + MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one is associated programs is running. Please close it first" /SD IDCANCEL IDRETRY checkRunning + Quit +notRunning: + ; Copied from http://nsis.sourceforge.net/Auto-uninstall_old_before_installing_new ReadRegStr $OLD_UNINSTALLER HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ |