Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: remoting/candle_and_light.py

Issue 10392172: Move remoting dark/candle/light steps to external script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trailing ., fix defines Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/dark_and_candle_and_light.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/candle_and_light.py
diff --git a/remoting/candle_and_light.py b/remoting/candle_and_light.py
new file mode 100644
index 0000000000000000000000000000000000000000..4416a8390f6d5153b2fc904ad117038f815d38c9
--- /dev/null
+++ b/remoting/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('--platformsdk_path', dest='platformsdk_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=%(platformsdk_path)s/redist/x86/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())
« no previous file with comments | « no previous file | remoting/dark_and_candle_and_light.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698