Repository navigation
Windows: add script to build a .msi package - #8579
laszlocsomor wants to merge 6 commits into
Conversation
Also add a test, though there's no build rule to wrap it yet. The generated installer: - is a standard .msi installer that users are familiar with - installs Bazel at a short and safe path (no space in path) - updates the PATH envvar - handles upgrades and parallel installs: backwards-compatible versions can be upgraded (but not downgraded), while incompatible versions may be installed side by side (see guids.txt comments) Example use: ``` c:\src\bazel>powershell scripts\packages\wix\make_msi.ps1 ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.exe (...) INFO[make_msi_lib.ps1 11:41:33] Creating wixobj INFO[make_msi_lib.ps1 11:41:33] Creating msi INFO[make_msi_lib.ps1 11:41:42] Done: ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi c:\src\bazel>start ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi ``` TODO(@laszlocsomor) before we can use this: - figure out if we should bundle vc_redist with the Bazel installer - figure out the UpgradeCode for such a combined bundle
This way the most recently installed Bazel version will be the first on the PATH.
|
Awesome! Maybe this installer could help us installing extra dependencies of Bazel. For example, any dependencies of the future Windows sandbox. |
|
You left a very thorny TODO
I think the answer is no. Do not bundle it IF you want to a .MSI installer built with Wix. When you try to get two things in the MSI it leads to odd rollback cases if both do not cleanly install/update/delete together. An alternative to bundling is to say we require vc_redist and let MSI decide where to get it.\ Another thing to consider is if you want to write the script to run Wix in powershell or Python. We might find it easier to maintain the script in Python, since only a few people know powershell. You put this in scripts/packages/wix, but is wix really the important thing in the path? I think scripts/packages/msi would be the clearer meaning. |
aiuto
left a comment
There was a problem hiding this comment.
This is a great start at a Windows installer. I have some concerns, but they should not get in the way of starting with this and trying to see how it goes.
|
Thanks for your insights @aiuto ! Re: bundling vc_redist: I don't think we need to, for now. Most Bazel users will probably install VC++ which installs these DLLs. Arguably not everyone will, sure, but if people complain about this requirement then we can revisit this question. Re: UpgradeCode: if we don't bundle vc_redist, then this is moot. Re: package path: good idea, I'll rename the "wix" directory to "msi". Re: python: I prefer to stay with PowerShell. I agree more Bazel core developers know Python than PS, but:
|
|
@aiuto : PTAL |
|
oh wait, you already approved, thanks :) @meteorcloudy , does this LGTY? |
Also add a test, though there's no build rule to wrap it yet. The generated installer: - is a standard .msi installer that users are familiar with - installs Bazel at a short and safe path (no space in path) - updates the PATH envvar - handles uninstall, upgrading, parallel installs: backwards-compatible versions can be upgraded (but not downgraded), while incompatible versions may be installed side by side (see `guids.txt` comments) Example use: ``` c:\src\bazel>powershell scripts\packages\msi\make_msi.ps1 ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.exe (...) INFO[make_msi_lib.ps1 11:41:33] Creating wixobj INFO[make_msi_lib.ps1 11:41:33] Creating msi INFO[make_msi_lib.ps1 11:41:42] Done: ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi c:\src\bazel>start ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi ``` TODO(@laszlocsomor) before we can use this: - figure out if we should bundle vc_redist with the Bazel installer - figure out the UpgradeCode for such a combined bundle Closes bazelbuild#8579. PiperOrigin-RevId: 254744890
Also add a test, though there's no build rule to wrap it yet. The generated installer: - is a standard .msi installer that users are familiar with - installs Bazel at a short and safe path (no space in path) - updates the PATH envvar - handles uninstall, upgrading, parallel installs: backwards-compatible versions can be upgraded (but not downgraded), while incompatible versions may be installed side by side (see `guids.txt` comments) Example use: ``` c:\src\bazel>powershell scripts\packages\msi\make_msi.ps1 ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.exe (...) INFO[make_msi_lib.ps1 11:41:33] Creating wixobj INFO[make_msi_lib.ps1 11:41:33] Creating msi INFO[make_msi_lib.ps1 11:41:42] Done: ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi c:\src\bazel>start ..\bazel-releases\0.26.1\bazel-0.26.1-windows-x86_64.msi ``` TODO(@laszlocsomor) before we can use this: - figure out if we should bundle vc_redist with the Bazel installer - figure out the UpgradeCode for such a combined bundle Closes bazelbuild#8579. PiperOrigin-RevId: 254744890





Also add a test, though there's no build rule to
wrap it yet.
The generated installer:
familiar with
space in path)
backwards-compatible versions can be upgraded
(but not downgraded), while incompatible
versions may be installed side by side
(see
guids.txtcomments)Example use:
TODO(@laszlocsomor) before we can use this:
the Bazel installer
bundle