Remove some (but not all) U3 remnants.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Oct 2013 22:11:51 +0000 (22:11 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Oct 2013 22:11:51 +0000 (22:11 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@52935 f5534014-38df-0310-8fa8-9805f1628bb7

epan/filesystem.c
packaging.vcproj
packaging/portableapps/win32/Makefile.nmake
packaging/portableapps/win32/WiresharkPortable.nsi
ui/gtk/file_dlg.c

index e5fc395fe3fb3dc68691e73a16bd8c757f0f707c..1d60c9ab8ef373ebb49e8277c1008980cba90b1d 100644 (file)
@@ -87,8 +87,6 @@
 #define PROFILES_DIR    "profiles"
 #define PLUGINS_DIR_NAME    "plugins"
 
-#define U3_MY_CAPTURES  "\\My Captures"
-
 char *persconffile_dir = NULL;
 char *persdatafile_dir = NULL;
 char *persconfprofile = NULL;
@@ -859,9 +857,6 @@ get_progfile_dir(void)
 const char *
 get_datafile_dir(void)
 {
-#ifdef _WIN32
-    char *u3deviceexecpath;
-#endif
     static const char *datafile_dir = NULL;
 
     if (datafile_dir != NULL)
@@ -869,39 +864,27 @@ get_datafile_dir(void)
 
 #ifdef _WIN32
     /*
-     * See if we are running in a U3 environment.
+     * Do we have the pathname of the program?  If so, assume we're
+     * running an installed version of the program.  If we fail,
+     * we don't change "datafile_dir", and thus end up using the
+     * default.
+     *
+     * XXX - does NSIS put the installation directory into
+     * "\HKEY_LOCAL_MACHINE\SOFTWARE\Wireshark\InstallDir"?
+     * If so, perhaps we should read that from the registry,
+     * instead.
      */
-    u3deviceexecpath = getenv_utf8("U3_DEVICE_EXEC_PATH");
-
-    if (u3deviceexecpath != NULL) {
+    if (progfile_dir != NULL) {
         /*
-         * We are; use the U3 device executable path.
+         * Yes, we do; use that.
          */
-        datafile_dir = u3deviceexecpath;
+        datafile_dir = progfile_dir;
     } else {
         /*
-         * Do we have the pathname of the program?  If so, assume we're
-         * running an installed version of the program.  If we fail,
-         * we don't change "datafile_dir", and thus end up using the
-         * default.
-         *
-         * XXX - does NSIS put the installation directory into
-         * "\HKEY_LOCAL_MACHINE\SOFTWARE\Wireshark\InstallDir"?
-         * If so, perhaps we should read that from the registry,
-         * instead.
+         * No, we don't.
+         * Fall back on the default installation directory.
          */
-        if (progfile_dir != NULL) {
-            /*
-             * Yes, we do; use that.
-             */
-            datafile_dir = progfile_dir;
-        } else {
-            /*
-             * No, we don't.
-             * Fall back on the default installation directory.
-             */
-            datafile_dir = "C:\\Program Files\\Wireshark\\";
-        }
+        datafile_dir = "C:\\Program Files\\Wireshark\\";
     }
 #else
     if (running_in_build_directory_flag) {
@@ -1341,46 +1324,35 @@ get_persconffile_dir_no_profile(void)
     }
 
     /*
-     * See if we are running in a U3 environment.
+     * Use %APPDATA% or %USERPROFILE%, so that configuration
+     * files are stored in the user profile, rather than in
+     * the home directory.  The Windows convention is to store
+     * configuration information in the user profile, and doing
+     * so means you can use Wireshark even if the home directory
+     * is an inaccessible network drive.
      */
-    altappdatapath = getenv_utf8("U3_APP_DATA_PATH");
-    if (altappdatapath != NULL) {
+    appdatadir = getenv_utf8("APPDATA");
+    if (appdatadir != NULL) {
         /*
-         * We are; use the U3 application data path.
+         * Concatenate %APPDATA% with "\Wireshark".
          */
-        persconffile_dir = altappdatapath;
+        persconffile_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
+                           appdatadir, PF_DIR);
     } else {
         /*
-         * Use %APPDATA% or %USERPROFILE%, so that configuration
-         * files are stored in the user profile, rather than in
-         * the home directory.  The Windows convention is to store
-         * configuration information in the user profile, and doing
-         * so means you can use Wireshark even if the home directory
-         * is an inaccessible network drive.
+         * OK, %APPDATA% wasn't set, so use
+         * %USERPROFILE%\Application Data.
          */
-        appdatadir = getenv_utf8("APPDATA");
-        if (appdatadir != NULL) {
-            /*
-             * Concatenate %APPDATA% with "\Wireshark".
-             */
-            persconffile_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s",
-                               appdatadir, PF_DIR);
+        userprofiledir = getenv_utf8("USERPROFILE");
+        if (userprofiledir != NULL) {
+            persconffile_dir = g_strdup_printf(
+                "%s" G_DIR_SEPARATOR_S "Application Data" G_DIR_SEPARATOR_S "%s",
+                userprofiledir, PF_DIR);
         } else {
             /*
-             * OK, %APPDATA% wasn't set, so use
-             * %USERPROFILE%\Application Data.
+             * Give up and use "C:".
              */
-            userprofiledir = getenv_utf8("USERPROFILE");
-            if (userprofiledir != NULL) {
-                persconffile_dir = g_strdup_printf(
-                    "%s" G_DIR_SEPARATOR_S "Application Data" G_DIR_SEPARATOR_S "%s",
-                    userprofiledir, PF_DIR);
-            } else {
-                /*
-                 * Give up and use "C:".
-                 */
-                persconffile_dir = g_strdup_printf("C:" G_DIR_SEPARATOR_S "%s", PF_DIR);
-            }
+            persconffile_dir = g_strdup_printf("C:" G_DIR_SEPARATOR_S "%s", PF_DIR);
         }
     }
 #else
@@ -1685,9 +1657,7 @@ copy_persconffile_profile(const char *toname, const char *fromname, gboolean fro
 /*
  * Get the (default) directory in which personal data is stored.
  *
- * On Win32, this is the "My Documents" folder in the personal profile,
- * except that, if we're running from a U3 device, this is the
- * "$U3_DEVICE_DOCUMENT_PATH\My Captures" folder.
+ * On Win32, this is the "My Documents" folder in the personal profile.
  * On UNIX this is simply the current directory.
  */
 /* XXX - should this and the get_home_dir() be merged? */
@@ -1695,7 +1665,6 @@ extern const char *
 get_persdatafile_dir(void)
 {
 #ifdef _WIN32
-    char *u3devicedocumentpath;
     TCHAR tszPath[MAX_PATH];
     char *szPath;
     BOOL bRet;
@@ -1705,32 +1674,17 @@ get_persdatafile_dir(void)
         return persdatafile_dir;
 
     /*
-     * See if we are running in a U3 environment.
+     * Hint: SHGetFolderPath is not available on MSVC 6 - without
+     * Platform SDK
      */
-    u3devicedocumentpath = getenv_utf8("U3_DEVICE_DOCUMENT_PATH");
-
-    if (u3devicedocumentpath != NULL) {
-        /* the "My Captures" sub-directory is created (if it doesn't
-           exist) by u3util.exe when the U3 Wireshark is first run */
-
-        szPath = g_strdup_printf("%s%s", u3devicedocumentpath, U3_MY_CAPTURES);
-
+    bRet = SHGetSpecialFolderPath(NULL, tszPath, CSIDL_PERSONAL,
+        FALSE);
+    if(bRet == TRUE) {
+        szPath = utf_16to8(tszPath);
         persdatafile_dir = szPath;
         return szPath;
     } else {
-        /*
-         * Hint: SHGetFolderPath is not available on MSVC 6 - without
-         * Platform SDK
-         */
-        bRet = SHGetSpecialFolderPath(NULL, tszPath, CSIDL_PERSONAL,
-            FALSE);
-        if(bRet == TRUE) {
-            szPath = utf_16to8(tszPath);
-            persdatafile_dir = szPath;
-            return szPath;
-        } else {
-            return "";
-        }
+        return "";
     }
 #else
     return "";
index 38131b2dbd194214400aba5e0884ca18fe5485dd..f30af6662d53471da0d02d02b44b471f06669d17 100644 (file)
                                CompileAsManaged=""
                        />
                </Configuration>
-               <Configuration
-                       Name="U3|Win32"
-                       OutputDirectory="$(ConfigurationName)"
-                       IntermediateDirectory="$(ConfigurationName)"
-                       ConfigurationType="0"
-                       >
-                       <Tool
-                               Name="VCNMakeTool"
-                               BuildCommandLine="nmake -f Makefile.nmake packaging"
-                               ReBuildCommandLine=""
-                               CleanCommandLine=""
-                               Output=""
-                               PreprocessorDefinitions="WIN32;NDEBUG"
-                               IncludeSearchPath=""
-                               ForcedIncludes=""
-                               AssemblySearchPath=""
-                               ForcedUsingAssemblies=""
-                               CompileAsManaged=""
-                       />
-               </Configuration>
                <Configuration
                        Name="zip_gtk1|Win32"
                        OutputDirectory="$(ConfigurationName)"
        <References>
        </References>
        <Files>
-               <Filter
-                       Name="u3.win32"
-                       >
-                       <File
-                               RelativePath=".\packaging\u3\win32\makefile.nmake"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\win32\manifest.tmpl"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\win32\README.txt"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\win32\u3util.c"
-                               >
-                       </File>
-               </Filter>
-               <Filter
-                       Name="u3.tools"
-                       >
-                       <File
-                               RelativePath=".\packaging\u3\tools\makefile.nmake"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\README.txt"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\sysdep.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\sysdep.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\utest.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\uuid.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\packaging\u3\tools\uuid.h"
-                               >
-                       </File>
-               </Filter>
                <Filter
                        Name="nsis"
                        >
index aebe11f805b3482c8e83b5d57f8045cc314ff387..f889ce8d651bf4a61a72ce3057d043641e8a48d0 100644 (file)
@@ -19,7 +19,6 @@ NSIS_PLUGINS  = nsis-plugins
 FINDPROCDLL    = $(WIRESHARK_LIB_DIR)\$(NSIS_PLUGINS)\FindProcDLL.dll
 
 TOPDIR         = ..\..\..
-U3DIST         = ..\..\u3\win32
 COPY           = xcopy
 MKDIR          = mkdir
 COPY_FLAGS     = /d /y
index 50538ac646762b7cd78fbad3f7c6944d5f6b6b2b..9732f06518bf5149f13887ddef1de33110c62afc 100755 (executable)
@@ -151,7 +151,9 @@ Section "Main"
                Abort
                
        FoundProgramEXE:
-               ;=== Check if Wireshark running from somwehere else (e.g. U3 device)
+               ;=== Check if Wireshark running from somwehere else
+                ; XXX We might be able to use the Wireshark-is-running mutex here.
+                ; See IsWiresharkRunning in packaging\nsis\common.nsh for details.
                ; if the following step fails, you'll need the FindProcDLL plug-in from:
                ; http://nsis.sourceforge.net/Find_Process_By_Name 
                ;FindProcDLL::FindProc "${PROGRAMEXECUTABLE}"
index 88b3f84660f928da72254f60851c8fbab563ada6..e215f9fc907dc6147adcc7514be9f6afbdbf1f2d 100644 (file)
@@ -75,9 +75,6 @@ file_selection_new(const gchar *title, GtkWindow *parent,
 {
     GtkWidget *win;
     GtkFileChooserAction gtk_action;
-#ifdef _WIN32
-    char *u3devicedocumentpath;
-#endif
     const gchar *ok_button_text;
 
     switch (action) {
@@ -128,14 +125,6 @@ file_selection_new(const gchar *title, GtkWindow *parent,
        in which that file resided. */
     if (last_open_dir)
         file_selection_set_current_folder(win, last_open_dir);
-#ifdef _WIN32
-    else {
-        u3devicedocumentpath = getenv_utf8("U3_DEVICE_DOCUMENT_PATH");
-        if(u3devicedocumentpath != NULL)
-            file_selection_set_current_folder(win, u3devicedocumentpath);
-
-    }
-#endif
     return win;
 }