Browse Source

Include arm64 payloads for hosting bundle (#40709)

Hao Kung 3 years ago
parent
commit
759dc4597d

+ 7 - 1
.azure/pipelines/ci.yml

@@ -287,7 +287,13 @@ stages:
         includeForks: true
       - name: Windows_Packages
         path: artifacts/packages/
-
+      - name: Windows_HostingBundle
+        path: artifacts/bin/WindowsHostingBundle
+      - name: Windows_ANCM_Msi
+        path: artifacts/bin/ANCMv2
+      - name: Windows_ANCMIISExpress_Msi
+        path: artifacts/bin/AncmIISExpressV2
+        
   # Build Windows ARM
   - template: jobs/default-build.yml
     parameters:

+ 2 - 8
eng/Build.props

@@ -98,23 +98,17 @@
         <!-- Build the SharedFramework installers -->
         <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x64" />
         <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=x86" />
+        <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=arm64" />
 
         <!-- Build the SharedFramework wixlib -->
         <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x64" />
         <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=x86" />
+        <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
 
         <!-- Windows hosting bundled -->
         <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
       </ItemGroup>
 
-      <ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'arm64' ">
-        <!-- We don't build the targeting pack installer here because it's built in the x86/x64 leg.
-        Instead we only provide the ARM64 SharedFramework MSI-->
-
-        <!-- Build the SharedFramework wixlib -->
-        <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
-      </ItemGroup>
-
       <ItemGroup Condition="'$(BuildInstallers)' == 'true' AND ('$(TargetRuntimeIdentifier)' == 'linux-x64' OR '$(TargetRuntimeIdentifier)' == 'linux-arm64')">
         <ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
                         Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />

+ 6 - 0
src/Installers/Windows/AspNetCoreModule-Setup/IIS-Setup/include.wxi

@@ -2,6 +2,12 @@
 
 <Include>
   <?define DiscoverabilityKeyRoot = "SOFTWARE\Microsoft\IIS Extensions"?>
+
+  <!-- NativeMachine values match the expected values for image file machine constants
+     https://docs.microsoft.com/en-us/windows/win32/sysinfo/image-file-machine-constants -->
+  <?define NativeMachine_x86=332?>
+  <?define NativeMachine_x64=34404?>
+  <?define NativeMachine_arm64=43620?>
   
   <?if $(var.Platform) = "x64"?>
     <?define IsWin64 = yes ?>

+ 15 - 3
src/Installers/Windows/WindowsHostingBundle/ANCM.wxs

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<?include ..\AspNetCoreModule-Setup\IIS-Setup\include.wxi ?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
     <Fragment>
         <PackageGroup Id="PG_ANCM">
@@ -10,7 +11,7 @@
                         Compressed="yes"
                         Vital="yes"
                         Visible="no"
-                        InstallCondition="NOT VersionNT64 AND (VersionNT &gt;= v6.1) AND (IISCoreWebEngineInstalled_x86=1) AND (IISW3SVCInstalled_x86=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_x86)&quot;) AND (IISCoreWebEngineInstalled_x86=1) AND (IISW3SVCInstalled_x86=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
                 <MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
             </MsiPackage>
 
@@ -20,11 +21,22 @@
                         Compressed="yes"
                         Vital="yes"
                         Visible="no"
-                        InstallCondition="VersionNT64 AND (VersionNT64 &gt;= v6.1) AND (IISCoreWebEngineInstalled_x64=1) AND (IISW3SVCInstalled_x64=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_x64)&quot;) AND (IISCoreWebEngineInstalled_x64=1) AND (IISW3SVCInstalled_x64=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
                 <MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
             </MsiPackage>
+            
+            <!-- OPT_NO_SHARED_CONFIG_CHECK could be unset at this point, which we explicitly treat as 'false' -->
+            <MsiPackage Id="AspNetCoreModuleV2_arm64" SourceFile="$(var.AspNetCoreModuleV2_arm64.TargetPath)"
+                        Name="$(var.AspNetCoreModuleV2_arm64.TargetFileName)"
+                        Compressed="yes"
+                        Vital="yes"
+                        Visible="no"
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (IISCoreWebEngineInstalled_x64=1) AND (IISW3SVCInstalled_x64=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
+                <MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
+            </MsiPackage>
+            
         </PackageGroup>
-
+        
         <util:RegistrySearch Id="IISCoreWebEngineInstalledSearch_x86"
                              Variable="IISCoreWebEngineInstalled_x86"
                              Root="HKLM"

+ 23 - 3
src/Installers/Windows/WindowsHostingBundle/DotNetCore.wxs

@@ -1,15 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<?include ..\AspNetCoreModule-Setup\IIS-Setup\include.wxi ?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
     <Fragment>
         <PackageGroup Id="PG_DOTNET_REDIST_LTS_BUNDLE">
             <RollbackBoundary Id="RB_DOTNET_REDIST_LTS_BUNDLE" />
 
+            <!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
+            <ExePackage Id="DotNetRedistLts_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerarm64)"
+                        Name="$(var.DotNetRedistLtsInstallerarm64)"
+                        Compressed="yes"
+                        Vital="yes"
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
+                        InstallCommand="/quiet /norestart"
+                        RepairCommand="/quiet /repair"
+                        Permanent="yes"
+                        DetectCondition="DotNetRedistLtsProductVersion_arm64 = v$(var.DotNetRedistLtsInstallerProductVersionarm64)">
+            </ExePackage>            
+            
             <!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
             <ExePackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
                         Name="$(var.DotNetRedistLtsInstallerx64)"
                         Compressed="yes"
                         Vital="yes"
-                        InstallCondition="VersionNT64 AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_x64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
                         InstallCommand="/quiet /norestart"
                         RepairCommand="/quiet /repair"
                         Permanent="yes"
@@ -32,15 +45,22 @@
 
     <Fragment>
         <util:ProductSearch Id="DotNetRedistLtsProductSearch_x86"
-                            Condition="NOT VersionNT64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_x86)&quot;)"
                             ProductCode="$(var.DotNetRedistLtsInstallerProductCodex86)"
                             Result="version"
                             Variable="DotNetRedistLtsProductVersion_x86" />
 
         <util:ProductSearch Id="DotNetRedistLtsProductSearch_x64"
-                            Condition="VersionNT64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_x64)&quot;)"
                             ProductCode="$(var.DotNetRedistLtsInstallerProductCodex64)"
                             Result="version"
                             Variable="DotNetRedistLtsProductVersion_x64" />
+
+        <util:ProductSearch Id="DotNetRedistLtsProductSearch_arm64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
+                            ProductCode="$(var.DotNetRedistLtsInstallerProductCodearm64)"
+                            Result="version"
+                            Variable="DotNetRedistLtsProductVersion_arm64" />
+        
     </Fragment>
 </Wix>

+ 13 - 1
src/Installers/Windows/WindowsHostingBundle/Product.targets

@@ -7,7 +7,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <Platforms Include="x64;x86" />
+    <Platforms Include="x64;x86;arm64" />
     <RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
       <TargetPlatform>x64</TargetPlatform>
       <BundleNameProperty>DotNetRedistLtsInstallerx64</BundleNameProperty>
@@ -18,6 +18,11 @@
       <BundleNameProperty>DotNetRedistLtsInstallerx86</BundleNameProperty>
       <Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
     </RuntimeInstallers>
+    <RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
+      <TargetPlatform>arm64</TargetPlatform>
+      <BundleNameProperty>DotNetRedistLtsInstallerarm64</BundleNameProperty>
+      <Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
+    </RuntimeInstallers>
   </ItemGroup>
 
   <Target Name="FetchDependencies" BeforeTargets="Restore;CollectPackageReferences">
@@ -36,6 +41,9 @@
       <RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
         <TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
       </RemoteAsset>
+      <RemoteAsset Include="Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
+        <TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
+      </RemoteAsset>
     </ItemGroup>
 
     <MakeDir Directories="$(DepsPath)" />
@@ -86,6 +94,10 @@
       <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionx86=$(DotNetRedistLtsInstallerProductVersionx86)</DefineConstants>
       <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodex86=$(DotNetRedistLtsInstallerProductCodex86)</DefineConstants>
       <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodex86=$(DotNetRedistLtsInstallerUpgradeCodex86)</DefineConstants>
+      <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerarm64=$(DotNetRedistLtsInstallerarm64)</DefineConstants>
+      <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionarm64=$(DotNetRedistLtsInstallerProductVersionarm64)</DefineConstants>
+      <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodearm64=$(DotNetRedistLtsInstallerProductCodearm64)</DefineConstants>
+      <DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodearm64=$(DotNetRedistLtsInstallerUpgradeCodearm64)</DefineConstants>
     </PropertyGroup>
   </Target>
 </Project>

+ 23 - 3
src/Installers/Windows/WindowsHostingBundle/SharedFramework.wxs

@@ -1,15 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<?include ..\AspNetCoreModule-Setup\IIS-Setup\include.wxi ?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
     <Fragment>
         <PackageGroup Id="PG_SHAREDFX_REDIST_BUNDLE">
             <RollbackBoundary Id="RB_SHAREDFX_REDIST_BUNDLE" />
 
+            <!-- OPT_NO_SHAREDFX could be unset at this point, which we explicitly treat as 'false' -->
+            <ExePackage Id="SharedFxRedist_arm64" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerarm64)"
+                        Name="$(var.SharedFxRedistInstallerarm64)"
+                        Compressed="yes"
+                        Vital="yes"
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=&quot;0&quot;)"
+                        InstallCommand="/quiet /norestart"
+                        RepairCommand="/quiet /repair"
+                        Permanent="yes"
+                        DetectCondition="SharedFxRedistProductVersion_arm64 = v$(var.SharedFxInstallerProductVersionarm64)">
+            </ExePackage>
+            
             <!-- OPT_NO_SHAREDFX could be unset at this point, which we explicitly treat as 'false' -->
             <ExePackage Id="SharedFxRedist_x64" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx64)"
                         Name="$(var.SharedFxRedistInstallerx64)"
                         Compressed="yes"
                         Vital="yes"
-                        InstallCondition="VersionNT64 AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=&quot;0&quot;)"
+                        InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_x64)&quot;) AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=&quot;0&quot;)"
                         InstallCommand="/quiet /norestart"
                         RepairCommand="/quiet /repair"
                         Permanent="yes"
@@ -27,20 +40,27 @@
                         Permanent="yes"
                         DetectCondition="SharedFxRedistProductVersion_x86 = v$(var.SharedFxInstallerProductVersionx86)">
             </ExePackage>
+            
         </PackageGroup>
     </Fragment>
 
     <Fragment>
         <util:ProductSearch Id="SharedFxRedistProductSearch_x86"
-                            Condition="NOT VersionNT64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_x86)&quot;)"
                             ProductCode="$(var.SharedFxInstallerProductCodex86)"
                             Result="version"
                             Variable="SharedFxRedistProductVersion_x86" />
 
         <util:ProductSearch Id="SharedFxRedistProductSearch_x64"
-                            Condition="VersionNT64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_x64)&quot;)"
                             ProductCode="$(var.SharedFxInstallerProductCodex64)"
                             Result="version"
                             Variable="SharedFxRedistProductVersion_x64" />
+
+        <util:ProductSearch Id="SharedFxRedistProductSearch_arm64"
+                            Condition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
+                            ProductCode="$(var.SharedFxInstallerProductCodearm64)"
+                            Result="version"
+                            Variable="SharedFxRedistProductVersion_arm64" />
     </Fragment>
 </Wix>

+ 19 - 0
src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj

@@ -54,6 +54,13 @@
       <Private>True</Private>
       <DoNotHarvest>true</DoNotHarvest>
     </ProjectReference>
+    <ProjectReference Include="..\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj">
+      <SetPlatform>Platform=arm64</SetPlatform>
+      <Name>AspNetCoreModuleV2_arm64</Name>
+      <Project>f9bacb48-3bd7-4ec2-ae31-664e8703ec12</Project>
+      <Private>True</Private>
+      <DoNotHarvest>true</DoNotHarvest>
+    </ProjectReference>
     <ProjectReference Include="..\SharedFrameworkBundle\SharedFrameworkBundle.wixproj"
       Private="false"
       ReferenceOutputAssembly="false"
@@ -107,6 +114,11 @@
       <BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
       <Version>$(SharedFxPackageVersion)</Version>
     </SharedFxInstallers>
+    <SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-arm64.exe">
+      <TargetPlatform>arm64</TargetPlatform>
+      <BundleNameProperty>SharedFxRedistInstallerarm64</BundleNameProperty>
+      <Version>$(SharedFxPackageVersion)</Version>
+    </SharedFxInstallers>
   </ItemGroup>
 
   <PropertyGroup>
@@ -137,6 +149,10 @@
         <ProductVersionProperty>SharedFxInstallerProductVersionx86</ProductVersionProperty>
         <ProductCodeProperty>SharedFxInstallerProductCodex86</ProductCodeProperty>
       </SharedFxPayload>
+      <SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-arm64.msi">
+        <ProductVersionProperty>SharedFxInstallerProductVersionarm64</ProductVersionProperty>
+        <ProductCodeProperty>SharedFxInstallerProductCodearm64</ProductCodeProperty>
+      </SharedFxPayload>
     </ItemGroup>
 
     <!-- Read MSI properties -->
@@ -154,6 +170,9 @@
       <DefineConstants>$(DefineConstants);SharedFxRedistInstallerx86=$(SharedFxRedistInstallerx86)</DefineConstants>
       <DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx86=$(SharedFxInstallerProductVersionx86)</DefineConstants>
       <DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex86=$(SharedFxInstallerProductCodex86)</DefineConstants>
+      <DefineConstants>$(DefineConstants);SharedFxRedistInstallerarm64=$(SharedFxRedistInstallerarm64)</DefineConstants>
+      <DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionarm64=$(SharedFxInstallerProductVersionarm64)</DefineConstants>
+      <DefineConstants>$(DefineConstants);SharedFxInstallerProductCodearm64=$(SharedFxInstallerProductCodearm64)</DefineConstants>
     </PropertyGroup>
   </Target>
 </Project>