Skip to content

Commit dda1d33

Browse files
authored
Enable ARM64 installers build. (#25579)
Changes WiX toolset used to 3.14 to support ARM64 Generates targeting pack from the x86/x64 leg, as it gets produced using a zip that gets generated there. The ARM64 leg now produces all the necessary msi's, exe, and wixlib needed for the installer to generate a bundle.
1 parent 31fcc8b commit dda1d33

File tree

11 files changed

+113
-36
lines changed

11 files changed

+113
-36
lines changed

Diff for: .azure/pipelines/ci.yml

+49-12
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ variables:
5151
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
5252
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
5353
# Do not log most Windows steps in official builds; this is the slowest job. Site extensions step always logs.
54+
- name: WindowsArm64LogArgs
55+
value: -ExcludeCIBinaryLog
5456
- name: Windows64LogArgs
5557
value: -ExcludeCIBinaryLog
5658
- name: Windows86LogArgs
@@ -59,12 +61,16 @@ variables:
5961
value: -ExcludeCIBinaryLog
6062
- name: WindowsInstallersLogArgs
6163
value: -ExcludeCIBinaryLog
64+
- name: WindowsArm64InstallersLogArgs
65+
value: -ExcludeCIBinaryLog
6266
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
6367
- name: _BuildArgs
6468
value: '/p:SkipTestBuild=true'
6569
- name: _PublishArgs
6670
value: ''
6771
# Write binary logs for all main Windows build steps except the x86 one in public and PR builds.
72+
- name: WindowsArm64LogArgs
73+
value: /bl:artifacts/log/Release/Build.arm64.binlog
6874
- name: Windows64LogArgs
6975
value: /bl:artifacts/log/Release/Build.x64.binlog
7076
- name: Windows86LogArgs
@@ -73,6 +79,8 @@ variables:
7379
value: /bl:artifacts/log/Release/Build.CodeSign.binlog
7480
- name: WindowsInstallersLogArgs
7581
value: /bl:artifacts/log/Release/Build.Installers.binlog
82+
- name: WindowsArm64InstallersLogArgs
83+
value: /bl:artifacts/log/Release/Build.Installers.Arm64.binlog
7684
- ${{ if ne(variables['System.TeamProject'], 'internal') }}:
7785
- name: _UseHelixOpenQueues
7886
value: 'true'
@@ -263,18 +271,6 @@ stages:
263271
jobName: Windows_arm64_build
264272
jobDisplayName: "Build: Windows ARM64"
265273
agentOs: Windows
266-
buildArgs:
267-
-arch arm64
268-
-sign
269-
-pack
270-
-noBuildNodeJS
271-
-noBuildJava
272-
/p:DotNetSignType=$(_SignType)
273-
/p:OnlyPackPlatformSpecificPackages=true
274-
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
275-
$(_BuildArgs)
276-
$(_PublishArgs)
277-
$(_InternalRuntimeDownloadArgs)
278274
installNodeJs: false
279275
installJdk: false
280276
artifacts:
@@ -286,6 +282,47 @@ stages:
286282
path: artifacts/packages/
287283
- name: Windows_arm64_Installers
288284
path: artifacts/installers/
285+
steps:
286+
- script: ./build.cmd
287+
-ci
288+
-arch arm64
289+
-sign
290+
-pack
291+
-noBuildJava
292+
-noBuildNative
293+
/p:DotNetSignType=$(_SignType)
294+
/p:OnlyPackPlatformSpecificPackages=true
295+
$(_BuildArgs)
296+
$(_InternalRuntimeDownloadArgs)
297+
$(WindowsArm64LogArgs)
298+
displayName: Build ARM64
299+
300+
# Windows installers bundle for arm64
301+
- script: ./build.cmd
302+
-ci
303+
-noBuildRepoTasks
304+
-arch arm64
305+
-sign
306+
-buildInstallers
307+
-noBuildNative
308+
/p:DotNetSignType=$(_SignType)
309+
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
310+
$(_BuildArgs)
311+
$(_PublishArgs)
312+
$(_InternalRuntimeDownloadArgs)
313+
$(WindowsArm64InstallersLogArgs)
314+
displayName: Build Arm64 Installers
315+
316+
# A few files must also go to the VS package feed.
317+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
318+
- task: NuGetCommand@2
319+
displayName: Push Visual Studio packages
320+
inputs:
321+
command: push
322+
packagesToPush: 'artifacts/packages/**/VS.Redist.Common.AspNetCore.*.nupkg'
323+
nuGetFeedType: external
324+
publishFeedCredentials: 'DevDiv - VS package feed'
325+
289326

290327
# Build MacOS
291328
- template: jobs/default-build.yml

Diff for: build.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,11 @@ if ($BuildNodeJS) { $dotnetBuildArguments += "/p:BuildNodeJS=true" }
296296
# Don't bother with two builds if just one will build everything. Ignore super-weird cases like
297297
# "-Projects ... -NoBuildJava -NoBuildManaged -NoBuildNodeJS". An empty `./build.ps1` command will build both
298298
# managed and native projects.
299-
$performDesktopBuild = ($BuildInstallers -or $BuildNative) -and `
300-
-not $Architecture.StartsWith("arm", [System.StringComparison]::OrdinalIgnoreCase)
299+
$performDesktopBuild = ($BuildInstallers -and $Architecture -ne "arm") -or `
300+
($BuildNative -and -not $Architecture.StartsWith("arm", [System.StringComparison]::OrdinalIgnoreCase))
301301
$performDotnetBuild = $BuildJava -or $BuildManaged -or $BuildNodeJS -or `
302302
($All -and -not ($NoBuildJava -and $NoBuildManaged -and $NoBuildNodeJS)) -or `
303303
($Projects -and -not ($BuildInstallers -or $specifiedBuildNative))
304-
305304
$foundJdk = $false
306305
$javac = Get-Command javac -ErrorAction Ignore -CommandType Application
307306
$localJdkPath = "$PSScriptRoot\.tools\jdk\win-x64\"

Diff for: eng/Build.props

+13-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</ItemGroup>
5151
</When>
5252
<Otherwise>
53-
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' ">
53+
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
5454
<!-- Build the ANCM custom action -->
5555
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
5656
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
@@ -64,6 +64,10 @@
6464
<!-- Build the targeting pack installers -->
6565
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
6666
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
67+
<!-- This really shouldn't be here, but instead of harvesting from the intermediate/output directories, the targetting pack installer logic
68+
harvests from a zip of the reference assemblies. Producing it in each leg ends up with multiple targeting packs
69+
getting produced and the BAR will reject the build. Centralize building the targeting pack in the x86/x64 leg. -->
70+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
6771

6872
<!-- Build the SharedFramework installers -->
6973
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
@@ -77,6 +81,14 @@
7781
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
7882
</ItemGroup>
7983

84+
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'arm64' ">
85+
<!-- We don't build the bundle here because we'd have to bundle the x86 installer which gets built in a different leg.
86+
Instead we only provide the ARM64 MSI-->
87+
88+
<!-- Build the SharedFramework wixlib -->
89+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
90+
</ItemGroup>
91+
8092
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
8193
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
8294
Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />

Diff for: eng/targets/Wix.Common.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
<PropertyGroup>
55
<SchemaVersion>2.0</SchemaVersion>
6-
<ProductVersion>3.11</ProductVersion>
7-
<WixVersion>3.11.1</WixVersion>
6+
<ProductVersion>3.14</ProductVersion>
7+
<WixVersion>3.14.0-dotnet</WixVersion>
88
</PropertyGroup>
99

1010
<PropertyGroup>

Diff for: src/Installers/Windows/SharedFramework/Product.wxs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.Version)"
44
Manufacturer="Microsoft Corporation" UpgradeCode="$(var.UpgradeCode)">
5-
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
5+
<Package InstallerVersion="$(var.InstallerVersion)" Compressed="yes" InstallScope="perMachine" />
66

77
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallFinalize" />
88
<Media Id="1" Cabinet="$(var.Cabinet)" CompressionLevel="high" EmbedCab="$(var.EmbedCab)" />
@@ -21,7 +21,7 @@
2121

2222
<?if $(var.Platform)=x86?>
2323
<?define PFilesFolder=ProgramFilesFolder?>
24-
<?elseif $(var.Platform)=x64?>
24+
<?elseif $(var.Platform)=x64 or $(var.Platform)=arm64?>
2525
<?define PFilesFolder=ProgramFiles64Folder?>
2626
<?else?>
2727
<?error Invalid Platform ($(var.Platform))?>

Diff for: src/Installers/Windows/SharedFramework/SharedFramework.wixproj

+4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@
6161
<!-- TODO: https://github.com/dotnet/aspnetcore/issues/6304. Harvest shared frameworks from a project reference -->
6262
<Target Name="ExtractIntermediateSharedFx" BeforeTargets="PrepareForBuild">
6363
<PropertyGroup>
64+
<SharedFrameworkArm64HarvestRootPath Condition="'$(SharedFrameworkArm64HarvestRootPath)' == ''">$(InstallersOutputPath)</SharedFrameworkArm64HarvestRootPath>
6465
<SharedFrameworkX64HarvestRootPath Condition="'$(SharedFrameworkX64HarvestRootPath)' == ''">$(InstallersOutputPath)</SharedFrameworkX64HarvestRootPath>
6566
<SharedFrameworkX86HarvestRootPath Condition="'$(SharedFrameworkX86HarvestRootPath)' == ''">$(InstallersOutputPath)</SharedFrameworkX86HarvestRootPath>
67+
<IntermediateArm64SharedFxZip>$(SharedFrameworkArm64HarvestRootPath)aspnetcore-runtime-internal-$(PackageVersion)-win-arm64.zip</IntermediateArm64SharedFxZip>
6668
<IntermediateX64SharedFxZip>$(SharedFrameworkX64HarvestRootPath)aspnetcore-runtime-internal-$(PackageVersion)-win-x64.zip</IntermediateX64SharedFxZip>
6769
<IntermediateX86SharedFxZip>$(SharedFrameworkX86HarvestRootPath)aspnetcore-runtime-internal-$(PackageVersion)-win-x86.zip</IntermediateX86SharedFxZip>
6870
</PropertyGroup>
6971

72+
<Unzip Condition="'$(Platform)' == 'arm64'"
73+
SourceFiles="$(IntermediateArm64SharedFxZip)" DestinationFolder="$(HarvestSource)" />
7074
<Unzip Condition="'$(Platform)' == 'x64'"
7175
SourceFiles="$(IntermediateX64SharedFxZip)" DestinationFolder="$(HarvestSource)" />
7276
<Unzip Condition="'$(Platform)' == 'x86'"

Diff for: src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x86"/>
4444
<?elseif $(var.Platform)=x64?>
4545
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x64"/>
46+
<?elseif $(var.Platform)=arm64?>
47+
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_arm64"/>
4648
<?endif?>
4749
</Chain>
4850
</Bundle>

Diff for: src/Installers/Windows/SharedFrameworkBundle/SharedFrameworkBundle.wixproj

+29-14
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,35 @@
2929
<Content Include="thm.xml" />
3030
</ItemGroup>
3131

32-
<ItemGroup>
33-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x86">
34-
<Name>SharedFrameworkLib</Name>
35-
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
36-
<Private>True</Private>
37-
<DoNotHarvest>True</DoNotHarvest>
38-
</ProjectReference>
39-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x64">
40-
<Name>SharedFrameworkLib</Name>
41-
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
42-
<Private>True</Private>
43-
<DoNotHarvest>True</DoNotHarvest>
44-
</ProjectReference>
45-
</ItemGroup>
32+
<Choose>
33+
<When Condition="'$(Platform)' == 'arm64'">
34+
<ItemGroup>
35+
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=arm64">
36+
<Name>SharedFrameworkLib</Name>
37+
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
38+
<Private>True</Private>
39+
<DoNotHarvest>True</DoNotHarvest>
40+
</ProjectReference>
41+
</ItemGroup>
42+
</When>
43+
<Otherwise>
44+
<ItemGroup>
45+
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x86">
46+
<Name>SharedFrameworkLib</Name>
47+
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
48+
<Private>True</Private>
49+
<DoNotHarvest>True</DoNotHarvest>
50+
</ProjectReference>
51+
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x64">
52+
<Name>SharedFrameworkLib</Name>
53+
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
54+
<Private>True</Private>
55+
<DoNotHarvest>True</DoNotHarvest>
56+
</ProjectReference>
57+
</ItemGroup>
58+
</Otherwise>
59+
</Choose>
60+
4661

4762
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
4863

Diff for: src/Installers/Windows/SharedFrameworkLib/Library.wxs

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<?elseif $(var.Platform)=x64?>
1717
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX)?>
1818
<?define DotNetHome=DOTNETHOME_X64?>
19+
<?elseif $(var.Platform)=arm64?>
20+
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX)?>
21+
<?define DotNetHome=DOTNETHOME_ARM64?>
1922
<?endif?>
2023

2124
<MsiPackage Id="AspNetCoreSharedFramework_$(var.Platform)"

Diff for: src/Installers/Windows/TargetingPack/Product.wxs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.Version)"
44
Manufacturer="Microsoft Corporation" UpgradeCode="$(var.UpgradeCode)">
5-
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
5+
<Package InstallerVersion="$(var.InstallerVersion)" Compressed="yes" InstallScope="perMachine" />
66

77
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallFinalize" />
88
<Media Id="1" Cabinet="$(var.Cabinet)" CompressionLevel="high" EmbedCab="$(var.EmbedCab)" />
@@ -21,7 +21,7 @@
2121

2222
<?if $(var.Platform)=x86?>
2323
<?define PFilesFolder=ProgramFilesFolder?>
24-
<?elseif $(var.Platform)=x64?>
24+
<?elseif $(var.Platform)=x64 or $(var.Platform)=arm64?>
2525
<?define PFilesFolder=ProgramFiles64Folder?>
2626
<?else?>
2727
<?error Invalid Platform ($(var.Platform))?>

Diff for: src/Installers/Windows/Wix.targets

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<_FileRevisionVersion Condition=" '$(_FileRevisionVersion)' == '' ">42424</_FileRevisionVersion>
99
<BundleVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion).$(_FileRevisionVersion)</BundleVersion>
1010

11+
<!-- ARM64 MSIs require the installer version to be at least 500. -->
12+
<!-- See: https://docs.microsoft.com/en-us/windows/win32/msi/64-bit-windows-installer-packages -->
13+
<DefineConstants Condition=" '$(Platform)' == 'arm64' ">$(DefineConstants);InstallerVersion=500</DefineConstants>
14+
<DefineConstants Condition=" '$(Platform)' != 'arm64' ">$(DefineConstants);InstallerVersion=200</DefineConstants>
15+
1116
<DefineConstants>$(DefineConstants);MajorVersion=$(AspNetCoreMajorVersion)</DefineConstants>
1217
<DefineConstants>$(DefineConstants);MinorVersion=$(AspNetCoreMinorVersion)</DefineConstants>
1318
<DefineConstants>$(DefineConstants);Version=$(Version)</DefineConstants>

0 commit comments

Comments
 (0)