Skip to content


Browse files Browse the repository at this point in the history
Package: Update Windows packaging
  • Loading branch information
UK992 committed Dec 1, 2018
1 parent c4b5c94 commit 0691045
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions python/servo/
Expand Up @@ -147,26 +147,9 @@ def copy_dependencies(binary_path, lib_path):

def copy_windows_dependencies(binary_path, destination):
deps = [
for d in deps:
shutil.copy(path.join(binary_path, d), destination)

# Search for the generated nspr4.dll
build_path = path.join(binary_path, "build")
nspr4 = "nspr4.dll"
nspr4_path = None
for root, dirs, files in os.walk(build_path):
if nspr4 in files:
nspr4_path = path.join(root, nspr4)

if nspr4_path is None:
print("WARNING: could not find nspr4.dll")
shutil.copy(nspr4_path, destination)
for f in os.listdir(binary_path):
if os.path.isfile(path.join(binary_path, f)) and f.endswith(".dll"):
shutil.copy(path.join(binary_path, f), destination)

def change_prefs(resources_path, platform, vr=False):
Expand Down Expand Up @@ -397,11 +380,10 @@ def package(self, release=False, dev=False, android=None, magicleap=None, debug=

print("Copying files")
dir_to_temp = path.join(dir_to_msi, 'temp')
dir_to_temp_servo = path.join(dir_to_temp, 'servo')
dir_to_resources = path.join(dir_to_temp_servo, 'resources')
dir_to_resources = path.join(dir_to_temp, 'resources')
shutil.copytree(path.join(dir_to_root, 'resources'), dir_to_resources)
shutil.copy(binary_path, dir_to_temp_servo)
copy_windows_dependencies(target_dir, dir_to_temp_servo)
shutil.copy(binary_path, dir_to_temp)
copy_windows_dependencies(target_dir, dir_to_temp)

change_prefs(dir_to_resources, "windows")

Expand All @@ -412,7 +394,7 @@ def package(self, release=False, dev=False, android=None, magicleap=None, debug=
wxs_path = path.join(dir_to_msi, "Installer.wxs")
open(wxs_path, "w").write(template.render(

# run candle and light
Expand Down Expand Up @@ -460,8 +442,9 @@ def package(self, release=False, dev=False, android=None, magicleap=None, debug=
print("Packaged Servo into " + path.join(dir_to_msi, "Servo.msi"))

print("Creating ZIP")
shutil.make_archive(path.join(dir_to_msi, "Servo"), "zip", dir_to_temp)
print("Packaged Servo into " + path.join(dir_to_msi, ""))
zip_path = path.join(dir_to_msi, "")
archive_deterministically(dir_to_temp, zip_path, prepend_path='servo/')
print("Packaged Servo into " + zip_path)

print("Cleaning up")
Expand Down

0 comments on commit 0691045

Please sign in to comment.