Repository navigation
{Packaging} Migrate Windows MSI build to WiX v7 - #34273
Open
Dennis Ameling (dennisameling) wants to merge 2 commits into
Open
Dennis Ameling (dennisameling) wants to merge 2 commits into
Dennis Ameling (dennisameling) wants to merge 2 commits into
Conversation
WiX v3 is out of support, needs .NET Framework 3.5 and was downloaded from a blob mirror. Move to WiX v7 as an SDK-style project restored from NuGet and built with `dotnet build`: - Convert Product.wxs to the v4+ schema. UpgradeCodes, component GUIDs, layout and upgrade logic are unchanged. - Harvest the CLI folder with the Files element instead of heat.exe. - Drop the WiX download and the hard-coded MSBuild path from build.cmd. - Install the .NET 8 SDK in the MSI build job. WiX v7 requires accepting its OSMF EULA (https://wixtoolset.org/osmf/), e.g. by setting AcceptEula=wix7. This change doesn't accept it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add test_msi_upgrade.ps1 to the TestMsiInstallation job: it installs the latest released MSI older than the artifact, upgrades it with the artifact MSI and checks that exactly one Azure CLI install of the artifact version remains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Thank you for your contribution Dennis Ameling (@dennisameling)! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Team EULA acceptance and production-pipeline validation of NuGet restore and downstream signing remain outstanding.
No open issues 🎉
What changed in this PR
Migrates Azure CLI’s Windows MSI packaging from unsupported WiX v3 to WiX v7, modernizing the build tooling while preserving installer behavior and removing a blocker for native Windows arm64 packaging.
Changes:
- Replaces downloaded WiX binaries and legacy MSBuild tooling with an SDK-style project built through
dotnet build. - Converts installer authoring to the v4+ schema and replaces heat.exe with built-in file harvesting.
- Adds previous-release upgrade testing to CI and documents the new prerequisites and EULA requirement.
| File | Description |
|---|---|
| build_scripts/windows/scripts/test_msi_upgrade.ps1 | Adds previous-release installation, upgrade, and version checks. |
| build_scripts/windows/scripts/build.cmd | Switches MSI builds to dotnet build and removes legacy WiX setup. |
| build_scripts/windows/README.md | Documents .NET SDK and WiX EULA prerequisites. |
| build_scripts/windows/Product.wxs | Migrates installer schema, extensions, and file harvesting. |
| build_scripts/windows/azure-cli.wixproj | Adopts the WiX v7 SDK and NuGet extension references. |
| build_scripts/windows/azure-cli.sln | Updates the WiX project type GUID. |
| azure-pipelines.yml | Installs the .NET SDK and runs the upgrade test. |
Review effort: Balanced
Contributor
|
Hi Dennis Ameling (@dennisameling), |
3 tasks done
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation — ️✔️ All clear
Related command
N/A (Windows MSI packaging)
Description
Close #34272
Migrates the Windows MSI build from WiX 3.10, which is out of community support, to WiX v7. It also removes WiX v3 as a blocker for native Windows arm64 MSIs (#29317).
azure-cli.wixproj: now an SDK-style project (WixToolset.Sdk/7.0.0, with the UI and Util extensions as package references). WiX is restored from NuGet, sobuild.cmdbuilds withdotnet buildand no longer downloads WiX. The .NET Framework 3.5 requirement and the hard-coded VS 2022 MSBuild path are gone too.Product.wxs: converted to the v4+ schema. The authoring is otherwise unchanged: same UpgradeCodes, component GUIDs, install layout, upgrade and downgrade logic, PATH and registry entries, and UI. heat.exe is replaced by WiX's<Files Include="artifacts\cli\**" />harvesting.azure-pipelines.yml:UseDotNet@2(.NET 8 SDK) in the MSI build job, assync-alias.ymlalready does.TestMsiInstallationjob runs the newtest_msi_upgrade.ps1first. It installs the latest released MSI older than the artifact (2.90.0 for a 2.91.0 build), upgrades it with the artifact MSI, and checks that exactly one Azure CLI install of the artifact version remains.azure-cli.sln(the SDK-style WiX project type) and the prerequisites inbuild_scripts/windows/README.md.Important
WiX v7 requires accepting the Open Source Maintenance Fee (OSMF) EULA, and organizations with more than $10k annual revenue are expected to sponsor the project. This PR deliberately doesn't accept it on the team's behalf. Until a pipeline variable
AcceptEulais set towix7(MSBuild reads it from the environment), the "Build Windows MSI" job fails withWIX7015. If the team prefers not to accept it, the authoring also works with WiX v6 (same OSMF terms, just not enforced) or v5 (no OSMF, but out of support) by changing the SDK version.Other open points for the team:
pool-windows-2022restoreWixToolset.*packages from nuget.org, or does it need a feed?Does upgrading from existing installs work?
Yes. The UpgradeCodes and the
Upgrade,LaunchConditionandInstallExecuteSequencetables are unchanged. The old version is still fully removed before the new one is installed (RemoveExistingProductsbeforeInstallInitialize), so the different component layout that<Files>produces doesn't matter. Downgrades are still blocked.Verified in CI (fork run,
windows-latest), for both x86 and x64:test_msi_upgrade.ps1. Exactly oneMicrosoft Azure CLI (32-bit|64-bit)2.91.0 entry remained.test_msi_installation.ps1passed: version check,az extension add -n account, andaz self-test(CLI self-test completed: OK).Comparison with the official 2.91.0 x64 MSI:
Upgrade,LaunchCondition,Environment,Registry,FeatureandInstallExecuteSequencematch. The only differences come from WiX v4+ itself:Wix4BroadcastEnvironmentChange_X64);CreateFolderrows.8.3 short names are still generated, and
wix msi validate(ICE) is clean. The MSI is ~13 MB smaller (57 vs 70 MB) because WiX v7 packs the CAB into fewer, larger folders. The compression is the same (LZX:21) and no content is missing.A pre-existing issue, not caused by this PR: uninstalling leaves the runtime-generated
pip\**\__pycache__files behind (319 files), with WiX v3 and v7 builds alike. pip is shipped as.pysources, so running it creates__pycache__files the MSI doesn't know about.Testing Guide
Prerequisites: the .NET SDK 8 or later, and the OSMF EULA accepted (see above).
Build the MSI. This also works on a Windows arm64 machine, since WiX v7 runs natively there.
Test upgrading from the previous WiX v3-built release, in an elevated Windows PowerShell on a test machine or VM. The script uninstalls any Azure CLI already on the machine, installs the previous release, then upgrades it:
Or by hand:
msiexec /i "build_scripts\windows\out\Microsoft Azure CLI.msi";az self-testshould pass in a new terminal.Then run
build_scripts\windows\scripts\test_msi_installation.ps1with the same environment variables for the existing fresh-install test.In Azure Pipelines, the
TestMsiInstallationjob runs both scripts (under its existing condition: CI, manual and scheduled builds).History Notes
N/A, not customer-facing. Installs and upgrades behave as before.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.
🤖 Generated with Claude Code