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

Unified Diff: remoting/dark_and_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
Index: remoting/dark_and_candle_and_light.py
diff --git a/remoting/dark_and_candle_and_light.py b/remoting/dark_and_candle_and_light.py
new file mode 100644
index 0000000000000000000000000000000000000000..32d0e889db6943003ce899738dbd90c89a79fd86
--- /dev/null
+++ b/remoting/dark_and_candle_and_light.py
@@ -0,0 +1,61 @@
+#!/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."""
+
+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 = {
+ 'wix_path': os.path.normpath(sys.argv[1]),
+ 'input': os.path.normpath(sys.argv[2]),
+ 'intermediate_root': os.path.normpath(sys.argv[3]),
+ 'intermediate_dir': os.path.normpath(sys.argv[4]),
+ 'output': os.path.normpath(sys.argv[5]),
+ }
+
+ dark_template = ('%(wix_path)s\\dark ' +
+ '-nologo ' +
+ '%(input)s ' +
+ '-o %(intermediate_root)s.wxs ' +
+ '-x %(intermediate_dir)s')
+ rc = run(dark_template % parameters)
+ if rc:
+ return rc
+
+ candle_template = ('%(wix_path)s\\candle ' +
+ '-nologo ' +
+ '%(intermediate_root)s.wxs ' +
+ '-o %(intermediate_root)s.wixobj ' +
+ '-ext %(wix_path)s\\WixFirewallExtension.dll')
+ rc = run(candle_template % parameters,
+ os.path.basename(parameters['intermediate_root']) + '.wxs')
+ if rc:
+ return rc
+
+ light_template = ('%(wix_path)s\\light ' +
+ '-nologo ' +
+ '%(intermediate_root)s.wixobj ' +
+ '-o %(output)s ' +
+ '-ext %(wix_path)s\\WixFirewallExtension.dll ' +
+ '-sw1076 ')
+ rc = run(light_template % parameters)
+ if rc:
+ return rc
+
+if __name__ == "__main__":
+ sys.exit(main())

Powered by Google App Engine
This is Rietveld 408576698