Created
June 28, 2016 15:01
-
-
Save metajack/78217183533dc4ebd965f46a45197a07 to your computer and use it in GitHub Desktop.
Windows MSI WIP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, unicode_literals | |
import os | |
from os import path | |
import sys | |
sys.path.insert(0, "Mako-0.9.1.zip") | |
from mako.template import Template | |
def listfiles(directory): | |
return [f for f in os.listdir(directory) | |
if path.isfile(path.join(directory, f))] | |
resource_files = listfiles("resources") | |
ahem_resource_files = listfiles(path.join("resources", "ahem")) | |
shader_resource_files = listfiles(path.join("resources", "shaders")) | |
useragentjs_resource_files = listfiles(path.join("resources", "user-agent-js")) | |
template = Template(open("Servo.wxs.mako").read()) | |
print(template.render(resource_files=resource_files, | |
ahem_resource_files=ahem_resource_files, | |
shader_resource_files=shader_resource_files, | |
useragentjs_resource_files=useragentjs_resource_files)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
<Product Name="Servo Tech Demo" | |
Manufacturer="Mozilla Research" | |
Id="5807391a-3a17-476b-a5d2-5f1912569762" | |
UpgradeCode="060cd15d-eab1-4614-b438-3988e3efdcf1" | |
Language="1033" | |
Codepage="1252" | |
Version="1.0.0"> | |
<Package Id="*" | |
Keywords="Installer" | |
Description="Servo Tech Demo Installer" | |
Manufacturer="Mozilla Research" | |
InstallerVersion="200" | |
Platform="x64" | |
Languages="1033" | |
SummaryCodepage="1252" | |
Compressed="yes"/> | |
<Media Id="1" | |
Cabinet="Servo.cab" | |
EmbedCab="yes"/> | |
<Directory Id="TARGETDIR" Name="SourceDir"> | |
<Directory Id="ProgramFiles64Folder" Name="PFiles"> | |
<Directory Id="MozResearch" Name="Mozilla Research"> | |
<Directory Id="INSTALLDIR" Name="Servo Tech Demo"> | |
<Component Id="Servo" | |
Guid="95bcea71-78bb-4ec8-9766-44bc01443840" | |
Win64="yes"> | |
<File Id="ServoEXE" | |
Name="servo.exe" | |
DiskId="1" | |
Source="servo.exe" | |
KeyPath="yes"> | |
<Shortcut Id="StartMenuServoTechDemo" | |
Directory="ProgramMenuDir" | |
Name="Servo Tech Demo" | |
WorkingDirectory="INSTALLDIR" | |
Icon="Servo.ico" | |
IconIndex="0" | |
Arguments="-w --resolution=1024x720 --pref dom.mozbrowser.enabled --pref dom.builtin-key-shortcuts.enabled=false c:\users\jack\src\browserhtml\dist\index.html" | |
Advertise="yes"/> | |
</File> | |
<File Id="StdcxxDLL" | |
Name="libstdc++-6.dll" | |
Source="C:\msys64\mingw64\bin\libstdc++-6.dll" | |
DiskId="1"/> | |
<File Id="WinpthreadDll" | |
Name="libwinpthread-1.dll" | |
Source="C:\msys64\mingw64\bin\libwinpthread-1.dll" | |
DiskId="1"/> | |
<File Id="Bzip2Dll" | |
Name="libbz2-1.dll" | |
Source="C:\msys64\mingw64\bin\libbz2-1.dll" | |
DiskId="1"/> | |
<File Id="GccsehDll" | |
Name="libgcc_s_seh-1.dll" | |
Source="C:\msys64\mingw64\bin\libgcc_s_seh-1.dll" | |
DiskId="1"/> | |
<File Id="ExpatDll" | |
Name="libexpat-1.dll" | |
Source="C:\msys64\mingw64\bin\libexpat-1.dll" | |
DiskId="1"/> | |
<File Id="ZlibDll" | |
Name="zlib1.dll" | |
Source="C:\msys64\mingw64\bin\zlib1.dll" | |
DiskId="1"/> | |
<File Id="PngDll" | |
Name="libpng16-16.dll" | |
Source="C:\msys64\mingw64\bin\libpng16-16.dll" | |
DiskId="1"/> | |
<File Id="IconvDll" | |
Name="libiconv-2.dll" | |
Source="C:\msys64\mingw64\bin\libiconv-2.dll" | |
DiskId="1"/> | |
<File Id="GlibDll" | |
Name="libglib-2.0-0.dll" | |
Source="C:\msys64\mingw64\bin\libglib-2.0-0.dll" | |
DiskId="1"/> | |
<File Id="GraphiteDll" | |
Name="libgraphite2.dll" | |
Source="C:\msys64\mingw64\bin\libgraphite2.dll" | |
DiskId="1"/> | |
<File Id="IntlDll" | |
Name="libintl-8.dll" | |
Source="C:\msys64\mingw64\bin\libintl-8.dll" | |
DiskId="1"/> | |
<File Id="PcreDll" | |
Name="libpcre-1.dll" | |
Source="C:\msys64\mingw64\bin\libpcre-1.dll" | |
DiskId="1"/> | |
<File Id="Eay32Dll" | |
Name="libeay32.dll" | |
Source="C:\msys64\mingw64\bin\libeay32.dll" | |
DiskId="1"/> | |
<File Id="Ssleay32Dll" | |
Name="ssleay32.dll" | |
Source="C:\msys64\mingw64\bin\ssleay32.dll" | |
DiskId="1"/> | |
<File Id="HarfbuzzDll" | |
Name="libharfbuzz-0.dll" | |
Source="C:\msys64\mingw64\bin\libharfbuzz-0.dll" | |
DiskId="1"/> | |
<File Id="FreetypeDll" | |
Name="libfreetype-6.dll" | |
Source="C:\msys64\mingw64\bin\libfreetype-6.dll" | |
DiskId="1"/> | |
<File Id="FontconfigDll" | |
Name="libfontconfig-1.dll" | |
Source="C:\msys64\mingw64\bin\libfontconfig-1.dll" | |
DiskId="1"/> | |
</Component> | |
<Directory Id="ResourceDir" Name="resources"> | |
<Component Id="ResourceDir" | |
Guid="b66f3e19-c2b9-434f-920b-08b47961d634" | |
Win64="yes"> | |
% for file in resource_files: | |
<File Id="Resource__${file | make_id}" | |
Name="${file}" | |
Source="resources\${file}" | |
DiskId="1"/> | |
% endfor | |
</Component> | |
<Directory Id="AhemResourceDir" Name="ahem"> | |
<Component Id="AhemResourceDir" | |
Guid="d90edf22-ba07-4358-b0f3-fef25c863a2a" | |
Win64="yes"> | |
% for file in ahem_resource_files: | |
<File Id="AhemResource__${file | make_id}" | |
Name="${file}" | |
Source="resources\ahem\${file}" | |
DiskId="1"/> | |
% endfor | |
</Component> | |
</Directory> | |
<Directory Id="ShaderResourceDir" Name="shaders"> | |
<Component Id="ShaderResourceDir" | |
Guid="edd63f39-d295-467f-92ba-ceeb0df441c8" | |
Win64="yes"> | |
% for file in shader_resource_files: | |
<File Id="ShaderResource__${file | make_id}" | |
Name="${file}" | |
Source="resources\shaders\${file}" | |
DiskId="1"/> | |
% endfor | |
</Component> | |
</Directory> | |
<Directory Id="UseragentjsResourceDir" Name="user-agent-js"> | |
<Component Id="UseragentjsResourceDir" | |
Guid="63e0f7f0-228a-4e3b-8a76-36fed1778139" | |
Win64="yes"> | |
% for file in useragentjs_resource_files: | |
<File Id="UseragentjsResource__${file | make_id}" | |
Name="${file}" | |
Source="resources\user-agent-js\${file}" | |
DiskId="1"/> | |
% endfor | |
</Component> | |
</Directory> | |
</Directory> | |
</Directory> | |
</Directory> | |
</Directory> | |
<Directory Id="ProgramMenuFolder" Name="Programs"> | |
<Directory Id="ProgramMenuDir" Name="Servo Tech Demo"> | |
<Component Id="ProgramMenuDir" Guid="e04737ce-16eb-4977-9b4c-ed2db8a5a77d"> | |
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/> | |
<RegistryValue Root="HKCU" | |
Key="Software\Mozilla Research\Servo Tech Demo" | |
Type="string" | |
Value="" | |
KeyPath="yes"/> | |
</Component> | |
</Directory> | |
</Directory> | |
</Directory> | |
<Feature Id="Complete" Level="1"> | |
<ComponentRef Id="Servo"/> | |
<ComponentRef Id="ResourceDir"/> | |
<ComponentRef Id="AhemResourceDir"/> | |
<ComponentRef Id="ShaderResourceDir"/> | |
<ComponentRef Id="UseragentjsResourceDir"/> | |
<ComponentRef Id="ProgramMenuDir"/> | |
</Feature> | |
<Icon Id="Servo.ico" SourceFile="Servo.ico"/> | |
</Product> | |
</Wix> | |
<%! | |
def make_id(s): | |
return s.replace("-", "_") | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment