-
Notifications
You must be signed in to change notification settings - Fork 66
[release/10.0] Adopt WiX v5 installer for WindowsDesktop #5324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+3,010
−1,159
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f621175
Adopt WiX v5 installer with deterministic upgrades
merriemcgaw a0e7cbd
Address Will's review feedback
merriemcgaw 1dc7743
Address joeloff's PR feedback: Add upgrade policy registry search re…
merriemcgaw b6a4d8d
Bundle.wxl localization files (#5328)
Shyam-Gupta a04738d
Fix SWID tag location, indentation, and enable backwards compatible G…
merriemcgaw d0a6d92
Fix localization: Remove duplicate LCID 1033 from Payload loop
merriemcgaw 59d41ae
Merge upstream/release/10.0 dependency flow updates
merriemcgaw cafc967
Fix architecture-specific ProviderKey for side-by-side installations
merriemcgaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.2.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{7525B257-249C-EE79-B10A-65D0BC27ABA9}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{C3C130B5-2C3F-D4B2-E3F3-EC385075C7AB}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "eng\common\internal\Tools.csproj", "{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft.Windows.Compatibility", "Microsoft.Windows.Compatibility", "{292A50E1-7820-1638-6BA6-14FBE6B99F15}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "runtime.native.System.IO.Ports", "src\Microsoft.Windows.Compatibility\package\runtime.native.System.IO.Ports.csproj", "{E47F785E-FA7A-58A1-D296-8C8F02432E6F}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Windows.Compatibility", "src\Microsoft.Windows.Compatibility\src\Microsoft.Windows.Compatibility.csproj", "{B4E26156-D23F-346E-920D-DB46A8C16C8E}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windowsdesktop", "windowsdesktop", "{B1DEBE5E-C067-B350-5F22-0DD39AD9FFE8}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.WindowsDesktop.App.Tests", "src\windowsdesktop\tests\Microsoft.WindowsDesktop.App.Tests.csproj", "{DDF86961-3AF2-FBA0-E08B-F367E1ABC517}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{E47F785E-FA7A-58A1-D296-8C8F02432E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{E47F785E-FA7A-58A1-D296-8C8F02432E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{E47F785E-FA7A-58A1-D296-8C8F02432E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{E47F785E-FA7A-58A1-D296-8C8F02432E6F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B4E26156-D23F-346E-920D-DB46A8C16C8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B4E26156-D23F-346E-920D-DB46A8C16C8E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B4E26156-D23F-346E-920D-DB46A8C16C8E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B4E26156-D23F-346E-920D-DB46A8C16C8E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{DDF86961-3AF2-FBA0-E08B-F367E1ABC517}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DDF86961-3AF2-FBA0-E08B-F367E1ABC517}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DDF86961-3AF2-FBA0-E08B-F367E1ABC517}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DDF86961-3AF2-FBA0-E08B-F367E1ABC517}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{C3C130B5-2C3F-D4B2-E3F3-EC385075C7AB} = {7525B257-249C-EE79-B10A-65D0BC27ABA9} | ||
{4F21FD48-C11F-D5EF-ADE2-1691A92E45C5} = {C3C130B5-2C3F-D4B2-E3F3-EC385075C7AB} | ||
{292A50E1-7820-1638-6BA6-14FBE6B99F15} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} | ||
{E47F785E-FA7A-58A1-D296-8C8F02432E6F} = {292A50E1-7820-1638-6BA6-14FBE6B99F15} | ||
{B4E26156-D23F-346E-920D-DB46A8C16C8E} = {292A50E1-7820-1638-6BA6-14FBE6B99F15} | ||
{B1DEBE5E-C067-B350-5F22-0DD39AD9FFE8} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} | ||
{DDF86961-3AF2-FBA0-E08B-F367E1ABC517} = {B1DEBE5E-C067-B350-5F22-0DD39AD9FFE8} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B96CF507-B5D5-4809-9C1C-7948C55C80FB} | ||
EndGlobalSection | ||
EndGlobal |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
param( | ||
[string]$target = "Build", | ||
[Parameter(ValueFromRemainingArguments = $true)] | ||
[string[]]$args | ||
) | ||
|
||
Write-Host "Building Windows Desktop Runtime for all architectures..." | ||
|
||
$architectures = @("x86", "x64", "arm64") | ||
$failed = @() | ||
|
||
if ($target -eq "pack") { | ||
$target = "Build" # The 'Pack' target is part of the 'Build' target in Build.proj | ||
} | ||
|
||
$extraArgs = $args -join " " | ||
|
||
foreach ($arch in $architectures) { | ||
Write-Host "Building for architecture: $arch" -ForegroundColor Green | ||
|
||
# Build the main projects with specific architecture | ||
$command = "dotnet build Build.proj -t:$target -c Release -p:Platform=$arch -p:TargetArchitecture=$arch $extraArgs" | ||
Write-Host "Executing: $command" | ||
Invoke-Expression -Command $command | ||
|
||
if ($LASTEXITCODE -ne 0) { | ||
$failed += $arch | ||
Write-Host "Failed to build $arch architecture" -ForegroundColor Red | ||
} else { | ||
Write-Host "Successfully built $arch architecture" -ForegroundColor Green | ||
} | ||
} | ||
|
||
if ($failed.Count -gt 0) { | ||
Write-Host "Failed architectures: $($failed -join ', ')" -ForegroundColor Red | ||
exit 1 | ||
} else { | ||
Write-Host "All architectures built successfully!" -ForegroundColor Green | ||
|
||
# Show the results | ||
Write-Host "`nGenerated installers:" -ForegroundColor Yellow | ||
Get-ChildItem -Path artifacts -Recurse -Filter "windowsdesktop-runtime-*-win-*.exe" -ErrorAction SilentlyContinue | Select-Object Name, FullName | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@echo off | ||
setlocal | ||
|
||
echo Cleaning up any existing build processes... | ||
for /f "tokens=2" %%i in ('tasklist /fi "imagename eq dotnet.exe" /fo table /nh 2^>nul ^| findstr /i "WindowsDesktop"') do ( | ||
echo Killing process %%i | ||
taskkill /f /pid %%i >nul 2>&1 | ||
) | ||
|
||
echo Starting sequential build... | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -nodeReuse:$false -maxCpuCount:1 -restore -build %*" | ||
|
||
echo Build completed. Cleaning up any remaining processes... | ||
for /f "tokens=2" %%i in ('tasklist /fi "imagename eq dotnet.exe" /fo table /nh 2^>nul ^| findstr /i "WindowsDesktop"') do ( | ||
echo Killing remaining process %%i | ||
taskkill /f /pid %%i >nul 2>&1 | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[CmdletBinding()] | ||
param( | ||
[switch]$restore, | ||
[switch]$build, | ||
[switch]$clean, | ||
[string]$configuration = "Debug", | ||
[Parameter(ValueFromRemainingArguments=$true)] | ||
[string[]]$RemainingArgs = @() | ||
) | ||
|
||
function Stop-WindowsDesktopProcesses { | ||
Write-Host "Cleaning up WindowsDesktop build processes..." -ForegroundColor Yellow | ||
|
||
$processes = Get-Process | Where-Object { | ||
$_.ProcessName -eq "dotnet" -and | ||
$_.Path -like "*WindowsDesktop*" | ||
} | ||
|
||
if ($processes) { | ||
$processes | ForEach-Object { | ||
Write-Host " Stopping process $($_.Id) ($($_.ProcessName))" -ForegroundColor Gray | ||
try { | ||
Stop-Process -Id $_.Id -Force -ErrorAction SilentlyContinue | ||
} catch { | ||
Write-Warning "Failed to stop process $($_.Id): $_" | ||
} | ||
} | ||
Start-Sleep -Seconds 2 | ||
} else { | ||
Write-Host " No WindowsDesktop processes found." -ForegroundColor Gray | ||
} | ||
} | ||
|
||
|
||
|
||
# Main execution | ||
try { | ||
# Clean up any existing processes | ||
Stop-WindowsDesktopProcesses | ||
|
||
# Prepare arguments for Build.ps1 | ||
$buildArguments = @() | ||
if ($restore) { $buildArguments += '-restore' } | ||
if ($build) { $buildArguments += '-build' } | ||
if ($clean) { $buildArguments += '-clean' } | ||
if ($configuration) { | ||
$buildArguments += '-configuration' | ||
$buildArguments += $configuration | ||
} | ||
$buildArguments += $RemainingArgs | ||
|
||
Write-Host "Starting sequential build with single CPU..." -ForegroundColor Green | ||
Write-Host "Arguments: $($buildArguments -join ' ')" -ForegroundColor Gray | ||
|
||
# Run the build with sequential settings | ||
try { | ||
& "$PSScriptRoot\eng\common\Build.ps1" -nodeReuse $false @buildArguments "/maxcpucount:1" | ||
$exitCode = $LASTEXITCODE | ||
} catch { | ||
Write-Error "Build failed: $_" | ||
$exitCode = 1 | ||
} | ||
|
||
Write-Host "`nBuild completed with exit code: $exitCode" -ForegroundColor $(if ($exitCode -eq 0) { 'Green' } else { 'Red' }) | ||
|
||
} finally { | ||
# Always clean up processes after build | ||
Write-Host "`nCleaning up processes after build..." -ForegroundColor Yellow | ||
Stop-WindowsDesktopProcesses | ||
} | ||
|
||
exit $exitCode |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Pipeline Notes | ||
|
||
This directory contains templates that compose the main Azure DevOps pipeline for WindowsDesktop. | ||
|
||
## Runtime MSI Acquisition | ||
|
||
The WiX bundle build depends on three runtime prerequisite MSIs being present under `artifacts/prereqs/<arch>`. Historically these were staged manually, but the CI pipeline now prepares them automatically before MSBuild executes. | ||
|
||
Each architecture job defined in `jobs/windows-build.yml` performs the following steps prior to invoking `eng/common/cibuild.cmd`: | ||
|
||
1. Import the internal runtime feed credentials via the `enable-internal-runtimes.yml` template, which retrieves the `dotnetbuilds-internal-container-read-token` SAS secret. | ||
2. Pass the runtime source feed and token to Arcade (`-RuntimeSourceFeed` / `-RuntimeSourceFeedKey` and their MSBuild equivalents) so that `eng/common/build.ps1` downloads the required runtime packs on-demand. | ||
3. Allow the bundle build to normalize the host/hostfxr/runtime MSIs into `artifacts/prereqs/<arch>` as part of the existing `StagePrereqRuntimeMsis` target execution. | ||
|
||
During the WiX build, the `StagePrereqRuntimeMsis` target (in `src/windowsdesktop/src/bundle/Wix.targets`) detects these staged files and sets `IncludeRuntimeMSIs=true`, ensuring the bundle carries the latest runtime from Maestro. | ||
|
||
### Local Repro | ||
|
||
To emulate the CI behavior locally: | ||
|
||
```powershell | ||
$token = '<base64-encoded SAS token>' | ||
pwsh eng/common/build.ps1 -restore -build -pack -runtimeSourceFeed "https://ci.dot.net/internal" -runtimeSourceFeedKey $token | ||
``` | ||
|
||
The command above mirrors the CI configuration by pointing Arcade at the internal runtime feed. Provide a base64-encoded SAS token with read permissions (matching the `dotnetbuilds-internal` secret) and repeat per architecture if needed using `/p:TargetArchitecture=<arch>`. | ||
|
||
Maintain this document if additional preparatory stages are introduced so build orchestration remains discoverable. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.