-
Notifications
You must be signed in to change notification settings - Fork 1k
Windows Mailpile Package Build
Mailpile uses the WIX toolset to generate an MSI package for windows. To do so, it has to gather and prepare Mailpile's dependencies for packaging. A small python framework aptly named provide
addresses those needs and serves as a scripting glue to automate generating a package. This page describes how to invoke, configure, and maintain the provide
framework.
There are READMEs in the code base that describe how various components work, and detailed help screens for the tools in use. This page aims to stitch them all together at a high level.
Generating a package requires python (either 2.7 or 3.x), git, and a checkout of mailpile(~1.0.0rc3 or later). The build script is very configurable in effort to be portable/reproducible. Assuming git
is on your PATH, building is as simple as changing directory to where you'd like the output, and invoking the build script:
python.exe path\to\mailpile\packages\windows-wix\provide -i path\to\mailpile\packages\windows-wix\provide-example-fork.json
If git isn't on your path, you can specify it's location:
python.exe path\to\mailpile\packages\windows-wix\provide -i path\to\mailpile\packages\windows-wix\provide-example-fork.json --configure-git=path\to\git.exe
It will download, process, and package dependencies, preparing a "package" directory in your current directory. You will need to manually grant privileges to unpack win4gpg when prompted. The directory will contain several files:
-
mailpile-<version>-<lang>.msi
the created mailpile package. -
mailpile-<version>-<lang>.wixpdb
debugging symbols for the package. -
mailpile.uuid.json
the UUIDs and sha1 hashes for ALL packaged files. This should be committed as part of the release process, updating/replacingmailpile\packages\windows-wix\package_uuid_db.json
, so that identical files share a single UUID across package versions. -
mailpile.package.json
the inflated template formailpile\packages\windows-wix\package.py
. -
mailpile.wxs
the wix configuration script generated byprovide
. -
mailpile.wixobj
the wixobj file made from themailpile.wxs
configuration.
The first should be sufficient to install mailpile. If making a release, it is recommended to keep the remainder for troubleshooting/archival purposes.
The provide
script supports signing all PDE package content if signtool.exe
and a code signing certificate is available. To secure signtool.exe
, install the windows SDK(if only installing the code-signing checkbox, the install size is only a few MB). 'providewill attempt to find the most recent version of
signtool.exeinstalled (the SDK version bumps very regularly)--you can check if it's found it by invoking
python.exe mailpile\packages\windows-wix\provide -hand looking for the default value of
--config_signtool: If it is not simply
signtool.exe,
providewas able to find a version of the windows SDK. If need you can manually specify
signtool.exe` on the command line:
python.exe path\to\mailpile\packages\windows-wix\provide -i path\to\mailpile\packages\windows-wix\provide-example-fork.json --config_signtool="C:\Program Files(x86)\Windows Kits\10\bin\10.0.17134.0\x86\signtool.exe"
To actually sign the build, you must provide the path to the code signing certificate and password for the certificate:
python.exe path\to\mailpile\packages\windows-wix\provide -i path\to\mailpile\packages\windows-wix\provide-example-fork.json --config_signing_key=path\to\code_signing_key.p12 --config_signing_passwd=a_very_secure_passwd
The build proceeds exactly like a regular build, except that all PDE (exe, dll, msi) content is signed.