diff options
-rw-r--r-- | python/servo/package_commands.py | 32 | ||||
-rw-r--r-- | support/windows/Servo.wxs | 19 | ||||
-rw-r--r-- | support/windows/Servo.wxs.mako | 1 |
3 files changed, 51 insertions, 1 deletions
diff --git a/python/servo/package_commands.py b/python/servo/package_commands.py index 9a3c8f62d63..cbbd22596c5 100644 --- a/python/servo/package_commands.py +++ b/python/servo/package_commands.py @@ -18,6 +18,7 @@ import shutil import subprocess import sys import tempfile +import urllib from mach.decorators import ( CommandArgument, @@ -330,7 +331,7 @@ class PackageCommands(CommandBase): import mako.template template_path = path.join(dir_to_root, "support", "windows", "Servo.wxs.mako") template = mako.template.Template(open(template_path).read()) - wxs_path = path.join(dir_to_msi, "Servo.wxs") + wxs_path = path.join(dir_to_msi, "Installer.wxs") open(wxs_path, "w").write(template.render( exe_path=target_dir, dir_to_temp=dir_to_temp_servo, @@ -351,6 +352,35 @@ class PackageCommands(CommandBase): except subprocess.CalledProcessError as e: print("WiX light exited with return value %d" % e.returncode) return e.returncode + print("Packaged Servo into " + path.join(dir_to_msi, "Installer.msi")) + + # Download GStreamer installer. Only once. + dir_to_gst_deps = path.join(dir_to_msi, 'Gstreamer.msi'); + gstreamer_msi_path = path.join(target_dir, 'Gstreamer.msi'); + if os.path.exists(gstreamer_msi_path): + shutil.copy(gstreamer_msi_path, dir_to_gst_deps) + else: + print('Fetching GStreamer installer. This may take a while...') + urllib.urlretrieve('https://gstreamer.freedesktop.org/data/pkg/windows/1.14.2/gstreamer-1.0-x86-1.14.2.msi', gstreamer_msi_path) + + # Generate bundle with GStreamer and Servo installers. + print("Creating bundle") + shutil.copy(path.join(dir_to_root, 'support', 'windows', 'Servo.wxs'), dir_to_msi) + bundle_wxs_path = path.join(dir_to_msi, 'Servo.wxs') + dir_to_bundle_msi = path.join(dir_to_msi, 'Servo.msi') + try: + with cd(dir_to_msi): + subprocess.check_call(['candle', bundle_wxs_path, '-ext', 'WixBalExtension']) + except subprocess.CalledProcessError as e: + print("WiX candle exited with return value %d" % e.returncode) + return e.returncode + try: + wxsobj_path = "{}.wixobj".format(path.splitext(bundle_wxs_path)[0]) + with cd(dir_to_msi): + subprocess.check_call(['light', wxsobj_path, '-ext', 'WixBalExtension']) + except subprocess.CalledProcessError as e: + print("WiX light exited with return value %d" % e.returncode) + return e.returncode print("Packaged Servo into " + path.join(dir_to_msi, "Servo.msi")) print("Creating ZIP") diff --git a/support/windows/Servo.wxs b/support/windows/Servo.wxs new file mode 100644 index 00000000000..d6ef3a04981 --- /dev/null +++ b/support/windows/Servo.wxs @@ -0,0 +1,19 @@ +<?xml version="1.0"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + <Bundle Name="Servo" + Version="1.0" + UpgradeCode="91b09c7e-6c0d-4166-b806-1dc724acf728"> + <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> + <Chain> + <MsiPackage + SourceFile="Gstreamer.msi" + DisplayName="GStreamer" + ForcePerMachine="yes"/> + <MsiPackage + SourceFile="Installer.msi" + Compressed="yes" + DisplayName="Servo" + ForcePerMachine="yes"/> + </Chain> + </Bundle> +</Wix> diff --git a/support/windows/Servo.wxs.mako b/support/windows/Servo.wxs.mako index 69cd69a4a1b..f22fce69dfb 100644 --- a/support/windows/Servo.wxs.mako +++ b/support/windows/Servo.wxs.mako @@ -40,6 +40,7 @@ Advertise="yes"/> </File> ${include_dependencies()} + <Environment Id="PATH" Name="PATH" Value="C:\gstreamer\1.0\x86\bin;C:\gstreamer\1.0\x86_64\bin" Permanent="yes" Part="last" Action="set" System="yes" /> </Component> ${include_directory(resources_path, "resources")} |