forked from osmocom/wireshark
Add support for WIRESHARK_EXTCAP_DIR environment variable on Windows
This can be useful when a user cannot modify the Wireshark installation folder (due to UAC restriction for example) This is already supported on Linux / OSX Change-Id: Icfcb43908de1fd8cd415cd31a98219eab1c757c8 Reviewed-on: https://code.wireshark.org/review/7809 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
9a9413f9f4
commit
786a7ea42c
|
@ -1057,6 +1057,8 @@ static const char *extcap_dir = NULL;
|
||||||
|
|
||||||
static void init_extcap_dir(void) {
|
static void init_extcap_dir(void) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
char *alt_extcap_path;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On Windows, the data file directory is the installation
|
* On Windows, the data file directory is the installation
|
||||||
* directory; the extcap hooks are stored under it.
|
* directory; the extcap hooks are stored under it.
|
||||||
|
@ -1065,7 +1067,15 @@ static void init_extcap_dir(void) {
|
||||||
* on Windows, the data file directory is the directory
|
* on Windows, the data file directory is the directory
|
||||||
* in which the Wireshark binary resides.
|
* in which the Wireshark binary resides.
|
||||||
*/
|
*/
|
||||||
|
alt_extcap_path = getenv_utf8("WIRESHARK_EXTCAP_DIR");
|
||||||
|
if (alt_extcap_path) {
|
||||||
|
/*
|
||||||
|
* The user specified a different directory for extcap hooks.
|
||||||
|
*/
|
||||||
|
extcap_dir = g_strdup(alt_extcap_path);
|
||||||
|
} else {
|
||||||
extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir());
|
extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir());
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
if (running_in_build_directory_flag) {
|
if (running_in_build_directory_flag) {
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue