Skip to content

Commit 666f23e

Browse files
hoyosjsJohn Luo
authored and
John Luo
committed
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 9a5c34f commit 666f23e

File tree

9 files changed

+110
-32
lines changed

9 files changed

+110
-32
lines changed

.azure/pipelines/ci.yml

+50-13
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ variables:
4242
value: ''
4343
- name: _InternalRuntimeDownloadCodeSignArgs
4444
value: ''
45+
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
46+
- name: WindowsArm64LogArgs
47+
value: /bl:artifacts/log/Release/Build.arm64.binlog
48+
- name: WindowsArm64InstallersLogArgs
49+
value: /bl:artifacts/log/Release/Build.Installers.Arm64.binlog
4550
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
4651
- group: DotNet-MSRC-Storage
4752
- name: _InternalRuntimeDownloadArgs
@@ -52,6 +57,10 @@ variables:
5257
- name: _InternalRuntimeDownloadCodeSignArgs
5358
value: /p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64)
5459
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
60+
- name: WindowsArm64LogArgs
61+
value: -ExcludeCIBinaryLog
62+
- name: WindowsArm64InstallersLogArgs
63+
value: -ExcludeCIBinaryLog
5564
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
5665
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
5766
- group: DotNet-Blob-Feed
@@ -255,19 +264,6 @@ stages:
255264
jobName: Windows_64_build
256265
jobDisplayName: "Build: Windows ARM64"
257266
agentOs: Windows
258-
buildArgs:
259-
-arch arm64
260-
-sign
261-
-pack
262-
-noBuildNodeJS
263-
-noBuildJava
264-
/bl:artifacts/log/build.win-arm64.binlog
265-
/p:DotNetSignType=$(_SignType)
266-
/p:OnlyPackPlatformSpecificPackages=true
267-
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
268-
$(_BuildArgs)
269-
$(_PublishArgs)
270-
$(_InternalRuntimeDownloadArgs)
271267
installNodeJs: false
272268
installJdk: false
273269
artifacts:
@@ -279,6 +275,47 @@ stages:
279275
path: artifacts/packages/
280276
- name: Windows_arm64_Installers
281277
path: artifacts/installers/
278+
steps:
279+
- script: ./build.cmd
280+
-ci
281+
-arch arm64
282+
-sign
283+
-pack
284+
-noBuildJava
285+
-noBuildNative
286+
/p:DotNetSignType=$(_SignType)
287+
/p:OnlyPackPlatformSpecificPackages=true
288+
$(_BuildArgs)
289+
$(_InternalRuntimeDownloadArgs)
290+
$(WindowsArm64LogArgs)
291+
displayName: Build ARM64
292+
293+
# Windows installers bundle for arm64
294+
- script: ./build.cmd
295+
-ci
296+
-noBuildRepoTasks
297+
-arch arm64
298+
-sign
299+
-buildInstallers
300+
-noBuildNative
301+
/p:DotNetSignType=$(_SignType)
302+
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
303+
$(_BuildArgs)
304+
$(_PublishArgs)
305+
$(_InternalRuntimeDownloadArgs)
306+
$(WindowsArm64InstallersLogArgs)
307+
displayName: Build Arm64 Installers
308+
309+
# A few files must also go to the VS package feed.
310+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
311+
- task: NuGetCommand@2
312+
displayName: Push Visual Studio packages
313+
inputs:
314+
command: push
315+
packagesToPush: 'artifacts/packages/**/VS.Redist.Common.AspNetCore.*.nupkg'
316+
nuGetFeedType: external
317+
publishFeedCredentials: 'DevDiv - VS package feed'
318+
282319

283320
# Build MacOS
284321
- template: jobs/default-build.yml

eng/Build.props

+13-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</ItemGroup>
6161
</When>
6262
<Otherwise>
63-
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' ">
63+
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
6464
<!-- Build the ANCM custom action -->
6565
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
6666
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
@@ -74,6 +74,10 @@
7474
<!-- Build the targeting pack installers -->
7575
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x64" />
7676
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=x86" />
77+
<!-- This really shouldn't be here, but instead of harvesting from the intermediate/output directories, the targetting pack installer logic
78+
harvests from a zip of the reference assemblies. Producing it in each leg ends up with multiple targeting packs
79+
getting produced and the BAR will reject the build. Centralize building the targeting pack in the x86/x64 leg. -->
80+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
7781

7882
<!-- Build the SharedFramework installers -->
7983
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
@@ -87,6 +91,14 @@
8791
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
8892
</ItemGroup>
8993

94+
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'arm64' ">
95+
<!-- We don't build the bundle here because we'd have to bundle the x86 installer which gets built in a different leg.
96+
Instead we only provide the ARM64 MSI-->
97+
98+
<!-- Build the SharedFramework wixlib -->
99+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
100+
</ItemGroup>
101+
90102
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
91103
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
92104
Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />

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))?>

src/Installers/Windows/SharedFramework/SharedFramework.wixproj

+4
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@
6161
<!-- TODO: https://github.com/aspnet/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'"

src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x86"/>
9494
<?elseif $(var.Platform)=x64?>
9595
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x64"/>
96+
<?elseif $(var.Platform)=arm64?>
97+
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_arm64"/>
9698
<?endif?>
9799
</Chain>
98100
</Bundle>

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

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)"

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))?>

src/Installers/Windows/Wix.targets

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<!-- Used for generating stable upgrade codes for bundles -->
99
<Version>$(BundleVersion)</Version>
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)