-
Notifications
You must be signed in to change notification settings - Fork 239
Building the msi package
- Windows box with
make
andgit
installed. (the msi can only be built on a windows machine since it uses wixtoolset. not tested on other platforms!) - powerhshell core is installed (Makefile targets for msi makes use of
pwsh
) - WixTool Set is installed
- The Hyperv bundle that needs to be in the msi
Following commands are tested in PowerShell
, PowerShell Core
and Cygwin
- To build the msi run:
make BUNDLE_DIR=<path_to_dir_containing_hyperv_bundle> out/windows-amd64/crc-windows-amd64.msi
- To build the zip archive (release artifact) run:
make BUNDLE_DIR=<path_to_dir_containing_hyperv_bundle> out/windows-amd64/crc-windows-installer.zip
For testing purposes the msi can be built without including the bundle using make MOCK_BUNDLE=true BUNDLE_DIR=./ out/windows-amd64/crc-windows-amd64.msi
The msi is built using the candle.exe
and light.exe
tools provided by the wixtoolset, the product.wxs.in file is the main wxs file that describe the msi product, among other things it mentions the files that needs to be put in C:\Program Files\CodeReady Containers, the LicenseAgreementDlg_HK.wxs and WixUI_HK.wxs files respectively describe the look of the license agreement dialog and the overall installer flow. These boilerplate files were first obtained by using mh-cbon/go-msi and later modifying them to our need.
We include crc-admin-helper
, crc-tray
, and crc_hyperv
bundle in the msi, these files are converted to cab archives during the msi build process by light.exe
. (Note: there's a limit to how big a cab file can be, therefore we split the hyperv bundle into chunks of 1GB using the code at split.go)
Finally after the msi is built, we package the cab files and msi together in a zip file, the Makefile target out/windows-amd64/crc-installer-windows.zip
generates the final releasable artifact which can be found in the folder out/windows-amd64/
.
- WixTool set official tutorial (https://www.firegiant.com/wix/tutorial)
- Examples of wxs files on github
- Wix Custom Action (Quitely execute) https://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
- Enable Windows Optional Feature https://stackoverflow.com/questions/18126502/wix-enable-windows-feature