diff options
-rw-r--r-- | packaging/nsis/wireshark.nsi | 6 | ||||
-rw-r--r-- | wsutil/filesystem.c | 25 |
2 files changed, 27 insertions, 4 deletions
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi index e24bb2e7e3..69d67af095 100644 --- a/packaging/nsis/wireshark.nsi +++ b/packaging/nsis/wireshark.nsi @@ -888,7 +888,7 @@ SectionGroup "Plugins & Extensions" SecPluginsGroup Section "Dissector Plugins" SecPlugins ;------------------------------------------- -SetOutPath '$INSTDIR\plugins' +SetOutPath '$INSTDIR\plugins\${VERSION}' File "${STAGING_DIR}\plugins\docsis.dll" File "${STAGING_DIR}\plugins\ethercat.dll" File "${STAGING_DIR}\plugins\gryphon.dll" @@ -905,13 +905,13 @@ SectionEnd Section "Tree Statistics Plugin" SecStatsTree ;------------------------------------------- -SetOutPath '$INSTDIR\plugins' +SetOutPath '$INSTDIR\plugins\${VERSION}' File "${STAGING_DIR}\plugins\stats_tree.dll" SectionEnd Section "Mate - Meta Analysis and Tracing Engine" SecMate ;------------------------------------------- -SetOutPath '$INSTDIR\plugins' +SetOutPath '$INSTDIR\plugins\${VERSION}' File "${STAGING_DIR}\plugins\mate.dll" SectionEnd diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index f23c19325a..0b23aec1ee 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -979,7 +979,30 @@ init_plugin_dir(void) * on Windows, the data file directory is the directory * in which the Wireshark binary resides. */ - plugin_dir = g_strdup_printf("%s\\plugins", get_datafile_dir()); + plugin_dir = g_strdup_printf("%s\\plugins\\%s", get_datafile_dir(), + VERSION); + + /* + * Make sure that pathname refers to a directory. + */ + if (test_for_directory(plugin_dir) != EISDIR) { + /* + * Either it doesn't refer to a directory or it + * refers to something that doesn't exist. + * + * Assume that means we're running a version of + * Wireshark we've built in a build directory, + * in which case {datafile dir}\plugins is the + * top-level plugins source directory, and use + * that directory and set the "we're running in + * a build directory" flag, so the plugin + * scanner will check all subdirectories of that + * directory for plugins. + */ + g_free( (gpointer) plugin_dir); + plugin_dir = g_strdup_printf("%s\\plugins", get_datafile_dir()); + running_in_build_directory_flag = TRUE; + } #else if (running_in_build_directory_flag) { /* |