[commit] r1668 - trunk/Install/Build

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Fri Nov 4 17:36:37 CDT 2011


Author: ksmyth
Date: Fri Nov  4 17:36:37 2011
New Revision: 1668

Log:
Split WiX into 2 steps: merge modules, then msi

Modified:
   trunk/Install/Build/build.py
   trunk/Install/Build/tools.py

Modified: trunk/Install/Build/build.py
==============================================================================
--- trunk/Install/Build/build.py	Fri Nov  4 17:36:18 2011	(r1667)
+++ trunk/Install/Build/build.py	Fri Nov  4 17:36:37 2011	(r1668)
@@ -205,8 +205,8 @@
     tools.xmp2mta(UML_XMP, "UML")
 
 
-def build_msi():
-    "Build WiX installer (msi file)"
+def build_msms():
+    "Build WiX merge modules (msm files)"
     
     # Prepare include file with dynamic data
     f = open(os.path.join(GME_ROOT, "Install", "GME_dyn.wxi"), 'w')
@@ -223,12 +223,19 @@
     import glob
     # Build the msi file
     tools.build_WiX([]
-        + glob.glob(os.path.join(GME_ROOT, "Install", "*.wxs"))
-       # + glob.glob(os.path.join(GME_ROOT, "Install", "*.wxi"))
+        + [file for file in glob.glob(os.path.join(GME_ROOT, "Install", "*.wxs")) if file.find('GME.wxs') == -1 ]
         + glob.glob(os.path.join(GME_ROOT, "Install", "PIAs", "*.wxi"))
         + glob.glob(os.path.join(GME_ROOT, "Install", "PIAs_1.0.1.0", "*.wxi"))
         )
 
+def build_msi():
+    "Build WiX installer (msi file)"
+
+    import glob
+    # Build the msi file
+    tools.build_WiX([os.path.join(GME_ROOT, "Install", "GME.wxs")])
+   
+
 def zip_pdb():
     "Collect and zip all debug information (*.pdb)"
     tools.system(r"call install\symbols_source_server.cmd <NUL".split(), GME_ROOT)
@@ -268,6 +275,7 @@
     zip_scriptSDK, 
     generate_meta_files,
     generate_sample_files, 
+    build_msms,
     build_msi,
     zip_pdb,
     publish,

Modified: trunk/Install/Build/tools.py
==============================================================================
--- trunk/Install/Build/tools.py	Fri Nov  4 17:36:18 2011	(r1667)
+++ trunk/Install/Build/tools.py	Fri Nov  4 17:36:37 2011	(r1668)
@@ -190,11 +190,22 @@
         exepath = os.path.join(os.environ['WIX'], 'bin', exepath)
     system([exepath])
     
+
+def _x64_suffix(str):
+    return str + '_x64' if prefs['arch'] == 'x64' else str
+def _get_wixobj(file):
+    return _x64_suffix(os.path.splitext(file)[0]) + ".wixobj"
+
+def _candle(file):
+    exepath = WIX_CANDLE_PRG
+    if 'WIX' in os.environ.keys():
+        exepath = os.path.join(os.environ['WIX'], 'bin', exepath)
+    cmd_line = [exepath] + WIX_CANDLE_ARG.split() + ['-arch', prefs['arch'], '-out', _get_wixobj(file), file]
+    system(cmd_line, os.path.dirname(file))
+
 def build_WiX(wix_files):
     """
     Builds a WiX project.
-    params
-        wxs_file : full path to the WiX source (.wxs)
     """
     fullpath = os.path.normpath(os.path.abspath(wix_files[0]))
     dirname = os.path.dirname(fullpath)
@@ -202,27 +213,16 @@
     (projectname, ext) = os.path.splitext(filename)
     
     toolmsg("Building " + filename + " in " + dirname)
-    def x64_suffix(str):
-        return str + '_x64' if prefs['arch'] == 'x64' else str
-    def get_wixobj(file):
-        return x64_suffix(os.path.splitext(file)[0]) + ".wixobj"
     wxi_files = filter(lambda file: file.find(".wxi") != -1, wix_files)
-    mm_files = filter(lambda file: file.find(".wxs") != -1 and file.find("GME.wxs") == -1, wix_files)
-    gme_wxs_file = filter(lambda file: file.find("GME.wxs") != -1, wix_files)[0]
+    mm_files = filter(lambda file: file.find(".wxs") != -1, wix_files)
     
-    exepath = WIX_CANDLE_PRG
-    if 'WIX' in os.environ.keys():
-        exepath = os.path.join(os.environ['WIX'], 'bin', exepath)
     for file in wix_files:
-        cmd_line = [exepath] + WIX_CANDLE_ARG.split() + ['-arch', prefs['arch'], '-out', get_wixobj(file), file]
-        system(cmd_line, dirname)
+        _candle(file)
     
     exepath = WIX_LIGHT_PRG
     if 'WIX' in os.environ.keys():
         exepath = os.path.join(os.environ['WIX'], 'bin', exepath)
     for wxs in mm_files:
-        cmd_line = [exepath] + WIX_LIGHT_ARG.split() + ['-o', x64_suffix(os.path.splitext(wxs)[0]) + ".msm", get_wixobj(wxs)]
+        ext = ('.msm' if wxs.find('GME.wxs') == -1 else '.msi')
+        cmd_line = [exepath] + WIX_LIGHT_ARG.split() + ['-o', _x64_suffix(os.path.splitext(wxs)[0]) + ext] + [ _get_wixobj(file) for file in wxi_files ] + [ _get_wixobj(wxs)]
         system(cmd_line, dirname)
-        
-    cmd_line = [exepath] + WIX_LIGHT_ARG.split() + ['-o', x64_suffix('GME') + '.msi'] + [ get_wixobj(file) for file in wxi_files ] + [ get_wixobj(gme_wxs_file) ]
-    system(cmd_line, dirname)


More information about the gme-commit mailing list