#ifdef USE_GOPTION
static gboolean cap_help = FALSE;
static gboolean table_report = FALSE;
-
+
static GOptionEntry general_entries[] =
{
/* General */
}
if (cap_packet_size) printf ("Average packet size: %.2f bytes\n", cf_info->packet_size);
if (cf_info->times_known) {
- if (cap_packet_rate)
+ if (cap_packet_rate)
print_value("Average packet rate: ", 2, " packets/sec", cf_info->packet_rate);
}
#ifdef HAVE_LIBGCRYPT
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/*
/* Process the options */
#ifdef USE_GOPTION
ctx = g_option_context_new(" <infile> ... - print information about capture file(s)");
- general_grp = g_option_group_new("gen", "General infos:",
+ general_grp = g_option_group_new("gen", "General infos:",
"Show general options", NULL, NULL);
size_grp = g_option_group_new("size", "Size infos:",
"Show size options", NULL, NULL);
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
-#endif /* _WIN32 */
+ create_app_running_mutex();
-#ifdef _WIN32
/*
* Initialize our DLL search path. MUST be called before LoadLibrary
* or g_module_open.
#endif
#ifdef _WIN32
+#include <wsutil/file_util.h>
#include <wsutil/unicode-utils.h>
#include <process.h> /* getpid */
#ifdef HAVE_WINSOCK2_H
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/*
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/* Process the options first */
${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}" \
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
while ((opt = getopt(argc, argv, "b:c:ht:")) != -1) {
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/*
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/* Scan CLI parameters */
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#if !GLIB_CHECK_VERSION(2,31,0)
g_thread_init(NULL);
#endif
setlocale(LC_ALL, "");
#ifdef _WIN32
arg_list_utf_16to8(argc, argv);
+ create_app_running_mutex();
#endif /* _WIN32 */
/*
#endif
software_update_init();
-
+
/* we'll enter the GTK loop now and hand the control over to GTK ... */
gtk_main();
/* ... back from GTK, we're going down now! */
int status;
//initialize language !
+ create_app_running_mutex();
QString locale = QLocale::system().name();
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("}"));
+}
*/
void *ws_load_library(gchar *library_name);
+
/** Load a DLL using g_module_open.
* Only the system and program directories are searched.
*
*/
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 */
/*
crc_drm
; file_util.c
+create_app_running_mutex
getenv_utf8
ws_stdio_fopen
ws_stdio_freopen