diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-12-12 13:07:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 13:07:25 -0800 |
commit | ced1199c61ef93e56269fbe803cb6d7ee4df25c7 (patch) | |
tree | 905f4c6e50688065ff68855f608d890f3dc96962 /python/servo/package_commands.py | |
parent | 1993b6e812de30de06100e7d52c1d90af929f24f (diff) | |
parent | 10cf2e1f39f3ac57044612aa394631b58b9cb818 (diff) | |
download | servo-ced1199c61ef93e56269fbe803cb6d7ee4df25c7.tar.gz servo-ced1199c61ef93e56269fbe803cb6d7ee4df25c7.zip |
Auto merge of #14531 - UK992:win32-installer, r=larsbergstrom
Various Windows installer fixes and improvements
r? @metajack or @larsbergstrom
---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14531)
<!-- Reviewable:end -->
Diffstat (limited to 'python/servo/package_commands.py')
-rw-r--r-- | python/servo/package_commands.py | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 91151725fc5..19935e13f4a 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -329,33 +329,44 @@ class PackageCommands(CommandBase): print("Packaged Servo into " + tar_path) @Command('install', - description='Install Servo (currently, Android only)', + description='Install Servo (currently, Android and Windows only)', category='package') @CommandArgument('--release', '-r', action='store_true', help='Install the release build') @CommandArgument('--dev', '-d', action='store_true', help='Install the dev build') - def install(self, release=False, dev=False): + @CommandArgument('--android', + action='store_true', + help='Install on Android') + def install(self, release=False, dev=False, android=False): try: - binary_path = self.get_binary_path(release, dev, android=True) + binary_path = self.get_binary_path(release, dev, android=android) except BuildNotFound: print("Servo build not found. Building servo...") result = Registrar.dispatch( - "build", context=self.context, release=release, dev=dev + "build", context=self.context, release=release, dev=dev, android=android ) if result: return result try: - binary_path = self.get_binary_path(release, dev, android=True) + binary_path = self.get_binary_path(release, dev, android=android) except BuildNotFound: print("Rebuilding Servo did not solve the missing build problem.") return 1 - apk_path = binary_path + ".apk" - if not path.exists(apk_path): - result = Registrar.dispatch("package", context=self.context, release=release, dev=dev) + if android: + pkg_path = binary_path + ".apk" + exec_command = ["adb", "install", "-r", pkg_path] + elif is_windows(): + pkg_path = path.join(path.dirname(binary_path), 'msi', 'Servo.msi') + exec_command = ["msiexec", "/i", pkg_path] + + if not path.exists(pkg_path): + result = Registrar.dispatch( + "package", context=self.context, release=release, dev=dev, android=android + ) if result != 0: return result - print(["adb", "install", "-r", apk_path]) - return subprocess.call(["adb", "install", "-r", apk_path], env=self.build_env()) + print(" ".join(exec_command)) + return subprocess.call(exec_command, env=self.build_env()) |