summaryrefslogtreecommitdiff
path: root/wsutil/filesystem.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-04-07 11:56:36 -0700
committerGerald Combs <gerald@wireshark.org>2015-04-07 23:01:40 +0000
commitcec99abac97a583959cee07bb8826a7b8eda61e2 (patch)
treefa26f82a366ebf8e0f0c8089d2c4fca1fb01419a /wsutil/filesystem.c
parent461666bcd1aacc8f360fca76129fe4a545819fc9 (diff)
downloadwireshark-cec99abac97a583959cee07bb8826a7b8eda61e2.tar.gz
Win32: Restore the versioned plugin installation path.
Revert parts of g2ef72cb and g7710da4 so that the NSIS installer once again places plugins in $INSTDIR\plugins\$VERSION. This matches the behavior of Autotools and previous Windows installers, and reduces the chances of a version mismatch if the user happens to install a custom plugin. Leave the development plugin path unversioned. Leave the extcap path unversioned for now. Change-Id: I861d4ee12975fba4b642e391871c5e852d92a2fe Reviewed-on: https://code.wireshark.org/review/7976 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wsutil/filesystem.c')
-rw-r--r--wsutil/filesystem.c25
1 files changed, 24 insertions, 1 deletions
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) {
/*