From cec99abac97a583959cee07bb8826a7b8eda61e2 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 7 Apr 2015 11:56:36 -0700 Subject: 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 Reviewed-by: Graham Bloice Petri-Dish: Graham Bloice Reviewed-by: Gerald Combs --- wsutil/filesystem.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'wsutil/filesystem.c') 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) { /* -- cgit v1.2.1