diff --git a/SConstruct b/SConstruct index 663cc0a01..6eeedce6b 100644 --- a/SConstruct +++ b/SConstruct @@ -929,7 +929,9 @@ env.Depends(finish_install, installTargets) install_cantera = Alias('install', finish_install) def build_wxs(target, source, env): - wxs = wxsgen.WxsGenerator(env['stage_dir'], env['TARGET_ARCH']=='amd64') + wxs = wxsgen.WxsGenerator(env['stage_dir'], + x64=env['TARGET_ARCH']=='amd64', + includeMatlab=env['matlab_toolbox']=='y') wxs.make_wxs(str(target[0])) if 'msi' in COMMAND_LINE_TARGETS: diff --git a/site_scons/wxsgen.py b/site_scons/wxsgen.py index 571fc1c5a..3ed1d9f98 100644 --- a/site_scons/wxsgen.py +++ b/site_scons/wxsgen.py @@ -3,9 +3,10 @@ import uuid import xml.etree.ElementTree as et class WxsGenerator(object): - def __init__(self, stageDir, x64=False): + def __init__(self, stageDir, includeMatlab=False, x64=False): self.prefix = stageDir self.x64 = x64 + self.includeMatlab = includeMatlab # Use separate UUIDs for 64- and 32-bit components if self.x64: @@ -51,11 +52,11 @@ class WxsGenerator(object): path = path.replace(self.prefix + '/', '', 1).replace('\\', '/') for d in dirs: dpath = '/'.join((path, d)) - ID = dpath.replace('/', '_') + ID = dpath.replace('/', '_').replace('@', 'a') directories[dpath] = self.Directory(directories[path], ID, d) for f in files: - ID = '_'.join((path, f)).replace('/', '_') + ID = '_'.join((path, f)).replace('/', '_').replace('@', 'a') self.FileComponent(directories[path], ID, ID, f, '/'.join((self.prefix, path, f))) et.SubElement(feature, 'ComponentRef', dict(Id=ID)) @@ -120,6 +121,14 @@ class WxsGenerator(object): Display='expand', AllowAdvertise='no')) + if self.includeMatlab: + matlab = et.SubElement(product, 'Feature', + dict(Id='Matlab', Level='1', + Title='Matlab Toolbox', + Description='Cantera Matlab toolbox', + Display='expand', + AllowAdvertise='no')) + # Files includes = self.addDirectoryContents('include', instdir, devel) binaries = self.addDirectoryContents('bin', instdir, core) @@ -128,6 +137,8 @@ class WxsGenerator(object): demos_dir = self.addDirectoryContents('demos', instdir, extras) templates_dir = self.addDirectoryContents('templates', instdir, extras) tutorials_dir = self.addDirectoryContents('tutorials', instdir, extras) + if self.includeMatlab: + matlab_dir = self.addDirectoryContents('matlab', instdir, matlab) # Registry entries reg_key = self.addRegistryKey(core, product, Id='CanteraRegRoot', Root='HKLM', @@ -181,7 +192,6 @@ def indent(elem, level=0): elem.tail = i - def usage(): print "Usage: wxsgen "