aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-02-20 01:19:42 +0000
committerGerald Combs <gerald@wireshark.org>2013-02-20 01:19:42 +0000
commitbd4cffae586b5207aae62dcb8a55690b23e42dd0 (patch)
tree5f89150713a57eb73ee3e5721481a6ac4637eb27 /wsutil
parentcf1070b4b12e97a7b2c233bdc966e7ff3972acb5 (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 'wsutil')
-rw-r--r--wsutil/file_util.c7
-rw-r--r--wsutil/file_util.h7
-rw-r--r--wsutil/libwsutil.def1
3 files changed, 15 insertions, 0 deletions
diff --git a/wsutil/file_util.c b/wsutil/file_util.c
index c9186c423d..1efc7cc39c 100644
--- a/wsutil/file_util.c
+++ b/wsutil/file_util.c
@@ -614,3 +614,10 @@ getenv_utf8(const char *varname)
return envvar;
}
+
+/** Create or open a "Wireshark is running" mutex.
+ */
+#define WIRESHARK_IS_RUNNING_UUID "9CA78EEA-EA4D-4490-9240-FC01FCEF464B"
+void create_app_running_mutex() {
+ CreateMutex(NULL, FALSE, _T("Wireshark-is-running-{") _T(WIRESHARK_IS_RUNNING_UUID) _T("}"));
+}
diff --git a/wsutil/file_util.h b/wsutil/file_util.h
index 4710aa6a15..af5f94d996 100644
--- a/wsutil/file_util.h
+++ b/wsutil/file_util.h
@@ -113,6 +113,7 @@ gboolean ws_init_dll_search_path();
*/
void *ws_load_library(gchar *library_name);
+
/** Load a DLL using g_module_open.
* Only the system and program directories are searched.
*
@@ -127,6 +128,12 @@ GModule *ws_module_open(gchar *module_name, GModuleFlags flags);
*/
extern char *getenv_utf8(const char *varname);
+/** Create or open a "Wireshark is running" mutex.
+ * Create or open a mutex which signals that Wireshark or its associated
+ * executables is running. Used by the installer to test for a running application.
+ */
+extern void create_app_running_mutex();
+
#else /* _WIN32 */
/*
diff --git a/wsutil/libwsutil.def b/wsutil/libwsutil.def
index 49b9a39286..bc30c3ab36 100644
--- a/wsutil/libwsutil.def
+++ b/wsutil/libwsutil.def
@@ -52,6 +52,7 @@ crc32_mpeg2_seed
crc_drm
; file_util.c
+create_app_running_mutex
getenv_utf8
ws_stdio_fopen
ws_stdio_freopen