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

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: add message to unittest rule 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..93dbcc67f25f3227377d6918f2b889c03bd0b3aa
--- /dev/null
+++ b/remoting/candle_and_light.py
@@ -0,0 +1,64 @@
+#!/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."""
+
+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():
+ parameters = {
alexeypa (please no reviews) 2012/05/18 23:46:40 The command line is not validated in any way so it
scottmg 2012/05/19 00:59:55 Switched to use optparse and named parameters inst
+ 'wix_path': os.path.normpath(sys.argv[1]),
+ 'version': sys.argv[2],
+ 'product_dir': os.path.normpath(sys.argv[3]),
+ 'intermediate': os.path.normpath(sys.argv[4]),
+ 'platformsdk_path': os.path.normpath(sys.argv[5]),
+ 'defines': sys.argv[6],
alexeypa (please no reviews) 2012/05/18 23:46:40 This will break as soon as someone adds another de
scottmg 2012/05/19 00:59:55 Oops, yes, it should have been <(wix_defines), not
alexeypa (please no reviews) 2012/05/21 16:24:50 Never mind. optparse should be enough for our need
+ 'input': os.path.normpath(sys.argv[7]),
+ 'output': os.path.normpath(sys.argv[8]),
+ }
+
+ 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)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)s.wixobj ')
+ rc = run(light_template % parameters)
+ if rc:
+ return rc
+
+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