Commits

Juan Lang committed 1141dd9

Support building with WiX releases after 2.0

Comments (0)

Files changed (3)

 
   From Juan Lang:
     - Fix WiX Tool to use .wixobj rather than .wxiobj for compiler output
+    - Support building with WiX releases after 2.0
 
   From Alexey Klimkin:
     - Fix nested LIBPATH expansion by flattening sequences in subst_path.

src/engine/SCons/Tool/wix.py

 
     # try to find the candle.exe and light.exe tools and 
     # add the install directory to light libpath.
-    #for path in os.environ['PATH'].split(os.pathsep):
     for path in os.environ['PATH'].split(os.pathsep):
         if not path:
             continue
 
         # search for the tools in the PATH environment variable
         try:
-            if env['WIXCANDLE'] in os.listdir(path) and\
-               env['WIXLIGHT']  in os.listdir(path):
-                   env.PrependENVPath('PATH', path)
-                   env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
-                                            '-loc',
-                                            os.path.join( path, 'WixUI_en-us.wxl' ) ]
-                   return 1
+            files = os.listdir(path)
+            if env['WIXCANDLE'] in files and env['WIXLIGHT'] in files:
+                env.PrependENVPath('PATH', path)
+                # include appropriate flags if running WiX 2.0
+                if 'wixui.wixlib' in files and 'WixUI_en-us.wxl' in files:
+                    env['WIXLIGHTFLAGS'] = [ os.path.join( path, 'wixui.wixlib' ),
+                                             '-loc',
+                                             os.path.join( path, 'WixUI_en-us.wxl' ) ]
+                else:
+                    env['WIXLIGHTFLAGS'] = []
+                return 1
         except OSError:
             pass # ignore this, could be a stale PATH entry.
 

src/engine/SCons/Tool/wixTests.py

         env = Environment(tools=['wix'])
         assert env['WIXCANDLE'] is not None
         assert env['WIXCANDLEFLAGS'] is not None
-        assert '-loc' in env['WIXLIGHTFLAGS']
+        assert env['WIXLIGHTFLAGS'] is not None
         assert env.subst('$WIXOBJSUF') == '.wixobj'
         assert env.subst('$WIXSRCSUF') == '.wxs'