Skip to content

Commit 69108ce

Browse files
author
John Luo
authored
Enable ARM64 installers build. (#25579) (#30463)
* 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. * Build tageting pack installers * Set TP version to 3.1.10
1 parent fc42d35 commit 69108ce

File tree

13 files changed

+115
-37
lines changed

13 files changed

+115
-37
lines changed

.azure/pipelines/ci.yml

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -255,21 +255,39 @@ stages:
255255
jobName: Windows_64_build
256256
jobDisplayName: "Build: Windows ARM64"
257257
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)
271258
installNodeJs: false
272259
installJdk: false
260+
steps:
261+
- script: ./build.cmd
262+
-ci
263+
-arch arm64
264+
-sign
265+
-pack
266+
-noBuildJava
267+
-noBuildNative
268+
/p:DotNetSignType=$(_SignType)
269+
/p:OnlyPackPlatformSpecificPackages=true
270+
$(_BuildArgs)
271+
$(_InternalRuntimeDownloadArgs)
272+
/bl:artifacts/log/Release/Build.arm64.binlog
273+
displayName: Build ARM64
274+
275+
# Windows installers bundle for arm64
276+
- script: ./build.cmd
277+
-ci
278+
-noBuildRepoTasks
279+
-arch arm64
280+
-sign
281+
-buildInstallers
282+
-noBuildNative
283+
/p:DotNetSignType=$(_SignType)
284+
/p:AssetManifestFileName=aspnetcore-win-arm64.xml
285+
$(_BuildArgs)
286+
$(_PublishArgs)
287+
$(_InternalRuntimeDownloadArgs)
288+
/bl:artifacts/log/Release/Build.Installers.Arm64.binlog
289+
displayName: Build Arm64 Installers
290+
273291
artifacts:
274292
- name: Windows_arm64_Logs
275293
path: artifacts/log/
@@ -280,6 +298,17 @@ stages:
280298
- name: Windows_arm64_Installers
281299
path: artifacts/installers/
282300

301+
# A few files must also go to the VS package feed.
302+
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
303+
- task: NuGetCommand@2
304+
displayName: Push Visual Studio packages
305+
inputs:
306+
command: push
307+
packagesToPush: 'artifacts/packages/**/VS.Redist.Common.AspNetCore.*.nupkg'
308+
nuGetFeedType: external
309+
publishFeedCredentials: 'DevDiv - VS package feed'
310+
311+
283312
# Build MacOS
284313
- template: jobs/default-build.yml
285314
parameters:

Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
<RuntimeInstallerBaseName>aspnetcore-runtime</RuntimeInstallerBaseName>
8585
<TargetingPackInstallerBaseName>aspnetcore-targeting-pack</TargetingPackInstallerBaseName>
8686

87-
<!-- Produce targeting pack installers/packages once per major.minor except in extraordinary cases i.e. 3.1.10. -->
87+
<!-- Produce targeting pack installers/packages once per major.minor except in extraordinary cases i.e. 3.1.14 win-arm64. -->
88+
<IsTargetingPackBuilding Condition=" '$(AspNetCorePatchVersion)' == '14' AND '$(TargetArchitecture)' == 'arm64' AND $([MSBuild]::IsOSPlatform('Windows')) ">true</IsTargetingPackBuilding>
8889
<IsTargetingPackBuilding Condition=" '$(DotNetBuildFromSource)' == 'true' ">false</IsTargetingPackBuilding>
8990
<IsTargetingPackBuilding
9091
Condition=" '$(IsTargetingPackBuilding)' == '' AND '$(AspNetCorePatchVersion)' != '10' ">false</IsTargetingPackBuilding>

Directory.Build.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
<PropertyGroup>
5858
<!-- When OnlyPackPlatformSpecificPackages is set, only produce packages for projects which set RuntimeIdentifier. -->
5959
<!-- Keep this below where we set "IsPackageInThisPatch" -->
60-
<IsPackable Condition=" '$(OnlyPackPlatformSpecificPackages)' == 'true' AND '$(RuntimeIdentifier)' == '' ">false</IsPackable>
60+
<!-- Do not apply this logic to App.Ref and App.Ref.Internal, it's packability is determined by IsTargetingPackBuilding -->
61+
<IsPackable Condition=" '$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Ref' AND '$(MSBuildProjectName)' != 'Microsoft.AspNetCore.App.Ref.Internal' AND '$(OnlyPackPlatformSpecificPackages)' == 'true' AND '$(RuntimeIdentifier)' == '' ">false</IsPackable>
6162
</PropertyGroup>
6263

6364
<PropertyGroup>

eng/Build.props

Lines changed: 16 additions & 1 deletion
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,17 @@
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 targeting pack installers -->
99+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=arm64" />
100+
101+
<!-- Build the SharedFramework wixlib -->
102+
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
103+
</ItemGroup>
104+
90105
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
91106
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
92107
Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<AspNetCoreMinorVersion>1</AspNetCoreMinorVersion>
1111
<AspNetCorePatchVersion>14</AspNetCorePatchVersion>
1212
<ValidateBasline>false</ValidateBasline>
13-
13+
1414
<PreReleasePreviewNumber>0</PreReleasePreviewNumber>
1515
<ComponentsWebAssemblyMajorVersion>3</ComponentsWebAssemblyMajorVersion>
1616
<ComponentsWebAssemblyMinorVersion>2</ComponentsWebAssemblyMinorVersion>

src/Installers/Windows/SharedFramework/Product.wxs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 29 additions & 14 deletions
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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/TargetingPack/TargetingPack.wixproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
<NamespaceGuid>DDBB771F-963F-47D3-8510-9ABD04DBE1D1</NamespaceGuid>
2222
<SchemaVersion>2.0</SchemaVersion>
2323
<ToolsetInstallerNuspecFile>$(RepoRoot)\src\Installers\Windows\TargetingPack\TargetingPackPackage.nuspec</ToolsetInstallerNuspecFile>
24+
<PackageVersion>$(TargetingPackVersionPrefix)</PackageVersion>
25+
<BundleVersion>$(TargetingPackVersionPrefix)</BundleVersion>
2426
</PropertyGroup>
2527

2628
<ItemGroup>
@@ -61,7 +63,7 @@
6163
<Target Name="ExtractIntermediateTargetingPack" BeforeTargets="PrepareForBuild">
6264
<PropertyGroup>
6365
<TargetingPackHarvestRoot Condition="'$(TargetingPackHarvestRoot)' == ''">$(InstallersOutputPath)</TargetingPackHarvestRoot>
64-
<IntermediateTargetingPackZip>$(TargetingPackHarvestRoot)aspnetcore-targeting-pack-$(PackageVersion).zip</IntermediateTargetingPackZip>
66+
<IntermediateTargetingPackZip>$(TargetingPackHarvestRoot)aspnetcore-targeting-pack-$(TargetingPackVersionPrefix).zip</IntermediateTargetingPackZip>
6567
</PropertyGroup>
6668

6769
<Unzip SourceFiles="$(IntermediateTargetingPackZip)" DestinationFolder="$(HarvestSource)" />

src/Installers/Windows/Wix.targets

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
<!-- Actual upgrade code used in bundles to ensure upgrades withing a version band, e.g. 3.0.0.xxx -->
55
<_FileRevisionVersion>$(VersionSuffixDateStamp)</_FileRevisionVersion>
66
<_FileRevisionVersion Condition=" '$(_FileRevisionVersion)' == '' ">42424</_FileRevisionVersion>
7-
<BundleVersion>$(AspNetCoreMajorMinorVersion).$(AspNetCorePatchVersion).$(_FileRevisionVersion)</BundleVersion>
7+
<BundleVersion Condition="'$(BundleVersion)' != ''" >$(BundleVersion).$(_FileRevisionVersion)</BundleVersion>
8+
<BundleVersion Condition="'$(BundleVersion)' == ''" >$(AspNetCoreMajorMinorVersion).$(AspNetCorePatchVersion).$(_FileRevisionVersion)</BundleVersion>
89
<!-- Used for generating stable upgrade codes for bundles -->
910
<Version>$(BundleVersion)</Version>
1011

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

0 commit comments

Comments
 (0)