summaryrefslogtreecommitdiff
path: root/packaging/u3
diff options
context:
space:
mode:
authorGraeme Lunt <graeme.lunt@smhs.co.uk>2007-01-15 19:11:29 +0000
committerGraeme Lunt <graeme.lunt@smhs.co.uk>2007-01-15 19:11:29 +0000
commit4ea1d12df809d70e1dba202508d1e71a60ca02d6 (patch)
treefdaf0b58f1b50242abb187b374291d68a99a3c68 /packaging/u3
parent165354a3f54064094746e171b9e6269fa50c4ade (diff)
downloadwireshark-4ea1d12df809d70e1dba202508d1e71a60ca02d6.tar.gz
Update to get_persdatafile_dir() to choose a default directory on the U3 device that Wireshark is being run from.
The U3 Deployment Guide recommends a sub-directory of U3_DEVICE_DOCUMENT_PATH, so the u3util creates a "My Captures" sub-directory to use as the personal data file directory. svn path=/trunk/; revision=20441
Diffstat (limited to 'packaging/u3')
-rw-r--r--packaging/u3/win32/u3util.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/packaging/u3/win32/u3util.c b/packaging/u3/win32/u3util.c
index 2888f95487..172d3b2537 100644
--- a/packaging/u3/win32/u3util.c
+++ b/packaging/u3/win32/u3util.c
@@ -51,6 +51,8 @@
#define WINPCAP_UNINSTALL "UninstallString"
#define WINPCAP_U3INSTALLED "U3Installed" /* indicate the U3 device that installed WinPcap */
+#define MY_CAPTURES "\\My Captures"
+
#define BUFSIZ 256
static char *extensions[] = {
@@ -392,7 +394,7 @@ void disassociate(char *extension)
Configure the host for the U3 Wireshark. This involves:
1) registering the U3 Wireshark with capture file types
2) installing WinPcap if not already installed
-
+3) create a "My Captures" folder on the U3 device if it doesn't already exist
*/
void host_configure(void)
@@ -403,8 +405,10 @@ void host_configure(void)
char *u3_host_exec_path;
char *u3_device_exec_path;
char *u3_device_serial;
+ char *u3_device_document_path;
char wireshark_path[MAX_PATH+1];
char winpcap_path[MAX_PATH+1];
+ char my_captures_path[MAX_PATH+1];
char reg_key[BUFSIZ];
char buffer[BUFSIZ];
int buflen = BUFSIZ;
@@ -494,6 +498,16 @@ void host_configure(void)
}
}
+
+ /* CREATE THE "My Captures" FOLDER IF IT DOESN'T ALREADY EXIST */
+
+ u3_device_document_path = getenv("U3_DEVICE_DOCUMENT_PATH");
+ strncpy(my_captures_path, u3_device_document_path, strlen(u3_device_document_path) + 1);
+ strncat(my_captures_path, MY_CAPTURES, strlen(MY_CAPTURES) + 1);
+
+ /* don't care if it succeeds or fails */
+ (void) CreateDirectory(my_captures_path, NULL);
+
}
/* host_cleanup