applied hide_doc.patch from Ricardo Pedroso
[swftools.git] / wx / gui / plugin.py
index f58cc50..ad52e45 100644 (file)
@@ -55,11 +55,23 @@ class Plugin:
         #print 'basedir', basedir
 
         opj = os.path.join
-        locations = [os.path.normpath(opj(basedir, '..', prog))]
+        locations = [
+                     os.path.normpath(opj(basedir, prog)),
+                     os.path.normpath(opj(basedir, "..", "src", prog)),
+                    ]
         if "wxMSW" in wx.PlatformInfo:
+            try:
+                system_drive = os.environ['SYSTEMDRIVE']
+            except KeyError:
+                system_drive = 'c:'
+            try:
+                program_files = os.environ['PROGRAMFILES']
+            except KeyError:
+                program_files = ''
             locations.extend([
-                              opj("c:", "swftools", prog),
-                              opj("c:", "Program Files", "SWFTools", prog)
+                              opj("c:", os.sep, "swftools", prog),
+                              opj("c:", os.sep, "Program Files", "SWFTools", prog),
+                              opj(system_drive, os.sep, program_files, "SWFTools", prog),
                              ])
         else:
             locations.extend([
@@ -105,7 +117,9 @@ class Plugin:
                 # To avoid an ugly "DOS Window" to show up
                 flags = win32process.CREATE_NO_WINDOW
             except ImportError:
-                flags = 0
+                # See http://msdn.microsoft.com/en-us/library/ms684863(VS.85).aspx
+                # for this flag (CREATE_NO_WINDOW) value
+                flags = 0x08000000
         else:
             flags = 0
         output = Popen(cmd, stdin=PIPE, stdout=PIPE,