summaryrefslogtreecommitdiffstats
path: root/remoting/tools
diff options
context:
space:
mode:
authoralexeypa@google.com <alexeypa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-03 14:59:09 +0000
committeralexeypa@google.com <alexeypa@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-03 14:59:09 +0000
commit5b806e1ee9241dc3f48250258a8b3170bf4d4457 (patch)
tree958f744e7e4c53ad115cadf33f7c22c64347fbfa /remoting/tools
parent327ca9544a15410565dc219ce677a1c235cfcb5a (diff)
downloadchromium_src-5b806e1ee9241dc3f48250258a8b3170bf4d4457.zip
chromium_src-5b806e1ee9241dc3f48250258a8b3170bf4d4457.tar.gz
chromium_src-5b806e1ee9241dc3f48250258a8b3170bf4d4457.tar.bz2
[Chromoting] Moving Windows-only host installation script to remoting/host/win. Moving scripts to remoting/tools.
Review URL: https://chromiumcodereview.appspot.com/10832124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools')
-rwxr-xr-xremoting/tools/candle_and_light.py73
-rwxr-xr-xremoting/tools/dark_and_candle_and_light.py67
2 files changed, 140 insertions, 0 deletions
diff --git a/remoting/tools/candle_and_light.py b/remoting/tools/candle_and_light.py
new file mode 100755
index 0000000..056bffd
--- /dev/null
+++ b/remoting/tools/candle_and_light.py
@@ -0,0 +1,73 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Run 'candle' and 'light' to transform .wxs to .msi."""
+
+from optparse import OptionParser
+import os
+import subprocess
+import sys
+
+def run(command, filter=None):
+ popen = subprocess.Popen(
+ command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ out, _ = popen.communicate()
+ for line in out.splitlines():
+ if filter and line.strip() != filter:
+ print line
+ return popen.returncode
+
+def main():
+ parser = OptionParser()
+ parser.add_option('--wix_path', dest='wix_path')
+ parser.add_option('--version', dest='version')
+ parser.add_option('--product_dir', dest='product_dir')
+ parser.add_option('--intermediate_dir', dest='intermediate_dir')
+ parser.add_option('--sas_dll_path', dest='sas_dll_path')
+ parser.add_option('-d', dest='define_list', action='append')
+ parser.add_option('--input', dest='input')
+ parser.add_option('--output', dest='output')
+ options, args = parser.parse_args()
+ if args:
+ parser.error("no positional arguments expected")
+ parameters = dict(options.__dict__)
+
+ parameters['basename'] = os.path.splitext(os.path.basename(options.input))[0]
+ parameters['defines'] = '-d' + ' -d'.join(parameters['define_list'])
+
+ common = (
+ '-nologo '
+ '-ext "%(wix_path)s\\WixFirewallExtension.dll" '
+ '-ext "%(wix_path)s\\WixUIExtension.dll" '
+ '-ext "%(wix_path)s\\WixUtilExtension.dll" '
+ '-dVersion=%(version)s '
+ '"-dFileSource=%(product_dir)s" '
+ '-dIconPath=resources/chromoting.ico '
+ '"-dSasDllPath=%(sas_dll_path)s/sas.dll" '
+ '%(defines)s '
+ )
+
+ candle_template = ('"%(wix_path)s\\candle" ' +
+ common +
+ '-out "%(intermediate_dir)s/%(basename)s.wixobj" ' +
+ '"%(input)s" ')
+ rc = run(candle_template % parameters, os.path.basename(parameters['input']))
+ if rc:
+ return rc
+
+ light_template = ('"%(wix_path)s\\light" ' +
+ common +
+ '-cultures:en-us ' +
+ '-sw1076 ' +
+ '-out "%(output)s" ' +
+ '"%(intermediate_dir)s/%(basename)s.wixobj" ')
+ rc = run(light_template % parameters)
+ if rc:
+ return rc
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/remoting/tools/dark_and_candle_and_light.py b/remoting/tools/dark_and_candle_and_light.py
new file mode 100755
index 0000000..c3858cc
--- /dev/null
+++ b/remoting/tools/dark_and_candle_and_light.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Run 'dark', 'candle', and 'light', to confirm that an msi can be unpacked
+repacked successfully."""
+
+from optparse import OptionParser
+import os
+import subprocess
+import sys
+
+def run(command, filter=None):
+ popen = subprocess.Popen(
+ command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ out, _ = popen.communicate()
+ for line in out.splitlines():
+ if filter and line.strip() != filter:
+ print line
+ return popen.returncode
+
+def main():
+ parser = OptionParser()
+ parser.add_option('--wix_path', dest='wix_path')
+ parser.add_option('--input', dest='input')
+ parser.add_option('--intermediate_dir', dest='intermediate_dir')
+ parser.add_option('--output', dest='output')
+ options, args = parser.parse_args()
+ if args:
+ parser.error("no positional arguments expected")
+ parameters = dict(options.__dict__)
+
+ parameters['basename'] = os.path.splitext(os.path.basename(options.output))[0]
+
+ dark_template = ('"%(wix_path)s\\dark" ' +
+ '-nologo ' +
+ '"%(input)s" ' +
+ '-o "%(intermediate_dir)s/%(basename)s.wxs" ' +
+ '-x "%(intermediate_dir)s"')
+ rc = run(dark_template % parameters)
+ if rc:
+ return rc
+
+ candle_template = ('"%(wix_path)s\\candle" ' +
+ '-nologo ' +
+ '"%(intermediate_dir)s/%(basename)s.wxs" ' +
+ '-o "%(intermediate_dir)s/%(basename)s.wixobj" ' +
+ '-ext "%(wix_path)s\\WixFirewallExtension.dll"')
+ rc = run(candle_template % parameters, parameters['basename'] + '.wxs')
+ if rc:
+ return rc
+
+ light_template = ('"%(wix_path)s\\light" ' +
+ '-nologo ' +
+ '"%(intermediate_dir)s/%(basename)s.wixobj" ' +
+ '-o "%(output)s" ' +
+ '-ext "%(wix_path)s\\WixFirewallExtension.dll" ' +
+ '-sw1076 ')
+ rc = run(light_template % parameters)
+ if rc:
+ return rc
+
+ return 0
+
+if __name__ == "__main__":
+ sys.exit(main())