Explorar o código

Re-enable WOW64, arm64 forwarders in Hosting Bundle (#61026)

* Re-enable WOW64, arm64 forwarders in Hosting Bundle

* Only build x86 early

* Fixup

* Build via ProjectRefs

* Build order

* Fix build
William Godbe hai 11 meses
pai
achega
3a1fc4f3be

+ 1 - 8
eng/Build.props

@@ -264,6 +264,7 @@
         <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64'">ARM64</_VcxTargetPlatform>
       </PropertyGroup>
 
+      <!-- In the VMR, we build the installers entirely via HostingBundle ProjectReferences in pass 2 -->
       <ItemGroup Condition="'$(DotNetBuild)' != 'true' and '$(_BuildWindowsInstallers)' == 'true' ">
         <!-- Build the ANCM custom action -->
         <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
@@ -282,14 +283,6 @@
         <InstallerProject Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
       </ItemGroup>
 
-      <!--
-        In a vertical build, only build the MSIs for the current vertical that aren't used in the hosting bundle in the first pass
-        and build the hosting bundle and its dependencies in the second pass.
-      -->
-      <ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') and '$(_BuildWindowsInstallers)' == 'true'">
-        <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
-      </ItemGroup>
-
       <ItemGroup>
         <ProjectToBuild Condition=" '$(BuildInstallers)' == 'true'" Include="@(InstallerProject)" BuildStep="installer" />
       </ItemGroup>

+ 1 - 1
src/Installers/Windows/AspNetCoreModule-Setup/ANCMIISExpressV2/AncmIISExpressV2.wixproj

@@ -95,7 +95,7 @@
                       '$(PackageLicenseExpression)' " />
   </Target>
 
-  <Target Name="BeforeBuild" Condition="'$(Platform)' == 'arm64' AND '$(DotNetBuild)' != 'true'">
+  <Target Name="BeforeBuild" Condition="'$(Platform)' == 'arm64'" >
     <MSBuild Projects="..\Forwarders\build.proj" />
   </Target>
 </Project>

+ 52 - 1
src/Installers/Windows/AspNetCoreModule-Setup/ANCMIISExpressV2/ancm_iis_expressv2.wxs

@@ -265,6 +265,52 @@
             </Component>
           </Directory>
         </Directory>
+
+        <!-- WOW64 Support -->
+        <?if $(var.Platform) != "x86" ?>
+        <Directory Id="$(var.ProgramFilesFolder32)">
+          <Directory Id="INSTALLDIR32" Name="IIS Express" >
+            <Directory Id="INSTALLLOCATION32" ShortName="ANCM" Name="$(var.ProductName)">
+              <Directory Id="VersionDir32" Name="$(var.ProductVersionString)">
+                <!-- Originally created with same component GUID as IIS installer. Must remain the same so upgrade doesn't remove this file -->
+                <Component Id="AspNetCoreModule.wow" Guid="45ba5011-a619-4d06-8a8d-155b1f9732b3" Win64="no">
+                  <File Id="AspNetCoreModuleDll.wow"
+                        Name="aspnetcorev2.dll"
+                        Source="$(var.ArtifactsDir)\bin\AspNetCoreModuleShim\Win32\$(var.Configuration)\aspnetcorev2.dll"
+                        DiskId="1"
+                        Vital="yes">
+                  </File>
+                  <RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\EventLog\Application\$(var.ProductShortName)">
+                    <RegistryValue Name="EventMessageFile" Type="expandable" Value="[#AspNetCoreModuleDll.wow]"/>
+                    <RegistryValue Name="TypesSupported" Type="integer" Value="7"/>
+                  </RegistryKey>
+                </Component>
+                <Directory Id="HandlerVersionDir32" Name="$(var.ANCMFolderVersion)" >
+                  <Component Id="AspNetCoreModuleHandler.wow" Guid="0A8EDB50-7D85-4825-8010-D27EFAF061B6" Win64="no">
+                    <File Id="AspNetCoreModuleHandlerDll.wow"
+                          Name="aspnetcorev2_outofprocess.dll"
+                          Source="$(var.ArtifactsDir)\bin\OutOfProcessRequestHandler\Win32\$(var.Configuration)\aspnetcorev2_outofprocess.dll"
+                          DiskId="1"
+                          Vital="yes">
+                    </File>
+                  </Component>
+                </Directory>
+              </Directory>
+            </Directory>
+            <Directory Id="IISConfigDir.wow" Name="config">
+              <Directory Id="IISSchemaDir.wow" Name="schema">
+                <Component Id="AspNetCoreSchema.wow" Guid="$(var.SchemaGuid32)" Win64="no" >
+                  <File Id="AspNetCoreSchemaFile.wow"
+                        Name="aspnetcore_schema_v2.xml"
+                        Source="$(var.AspNetCoreSchemaPath)"
+                        DiskId="1"
+                        Vital="yes"/>
+                </Component>
+              </Directory>
+            </Directory>
+          </Directory>
+        </Directory>
+        <?endif?>
       </DirectoryRef>
 
         <!-- Feature Definition -->
@@ -278,6 +324,11 @@
             <ComponentRef Id="AspNetCoreModuleHandler.arm64" />
             <?endif ?>
             <ComponentRef Id="AspNetCoreSchema"/>
+            <?if $(var.Platform) != "x86" ?>
+                <ComponentRef Id="AspNetCoreModule.wow"/>
+                <ComponentRef Id="AspNetCoreModuleHandler.wow"/>
+                <ComponentRef Id="AspNetCoreSchema.wow"/>
+            <?endif ?>
         </Feature>
 
         <!-- User Interface -->
@@ -637,4 +688,4 @@
         <Binary Id="IISCustomActionDll" SourceFile="$(var.aspnetcoreCA.TargetPath)"/>
     </Fragment>
 
-</Wix>
+</Wix>

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

@@ -71,6 +71,27 @@
     </ProjectReference>
   </ItemGroup>
 
+  <ItemGroup Condition="'$(DotNetBuild)' == 'true'" >
+    <ProjectReference Include="..\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj">
+      <SetPlatform>Platform=x86</SetPlatform>
+      <Name>AspNetCoreModuleV2IISExpress_x86</Name>
+      <Private>True</Private>
+      <DoNotHarvest>true</DoNotHarvest>
+    </ProjectReference>
+    <ProjectReference Include="..\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj">
+      <SetPlatform>Platform=x64</SetPlatform>
+      <Name>AspNetCoreModuleV2IISExpress_x64</Name>
+      <Private>True</Private>
+      <DoNotHarvest>true</DoNotHarvest>
+    </ProjectReference>
+    <ProjectReference Include="..\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj">
+      <SetPlatform>Platform=arm64</SetPlatform>
+      <Name>AspNetCoreModuleV2IISExpress_arm64</Name>
+      <Private>True</Private>
+      <DoNotHarvest>true</DoNotHarvest>
+    </ProjectReference>
+  </ItemGroup>
+
   <Import Project="Product.targets" />
 
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />

+ 3 - 3
src/Servers/IIS/Directory.Build.props

@@ -8,20 +8,20 @@
     <HostArch>$(Platform)</HostArch>
     <HostArch Condition="'$(Platform)' == 'Win32'">x86</HostArch>
     <HostArch Condition="'$(Platform)' == 'AnyCPU'">x64</HostArch>
-    <HostArch Condition="'$(DotNetBuild)' == 'true'">$(TargetArchitecture)</HostArch>
+    <HostArch Condition="'$(DotNetBuild)' == 'true' AND '$(DotNetBuildPass)' != '2'">$(TargetArchitecture)</HostArch>
     <LibNetHostPath>$(NuGetPackageRoot)microsoft.netcore.app.host.win-$(HostArch)\$(LibNetHostAppPackVersion)\runtimes\win-$(HostArch)\native</LibNetHostPath>
     <!-- This tools version MUST match the same version as runtime uses to compile libnethost.lib -->
     <PlatformToolsetVersion>143</PlatformToolsetVersion>
   </PropertyGroup>
 
   <!-- Platform is different during restore than during build. Therefore, restore everything when not building the product. -->
-  <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj' and '$(DotNetBuild)' != 'true'">
+  <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj' and ('$(DotNetBuild)' != 'true' OR '$(DotNetBuildPass)' == '2') ">
     <PackageReference Include="Microsoft.NETCore.App.Host.win-x64" Version="[$(LibNetHostAppPackVersion)]" PrivateAssets="all" ExcludeAssets="all" />
     <PackageReference Include="Microsoft.NETCore.App.Host.win-x86" Version="[$(LibNetHostAppPackVersion)]" PrivateAssets="all" ExcludeAssets="all" />
     <PackageReference Include="Microsoft.NETCore.App.Host.win-arm64" Version="[$(LibNetHostAppPackVersion)]" PrivateAssets="all" ExcludeAssets="all" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj' and '$(DotNetBuild)' == 'true'">
+  <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj' and '$(DotNetBuild)' == 'true' AND '$(DotNetBuildPass)' != '2' ">
     <PackageReference Include="Microsoft.NETCore.App.Host.win-$(TargetArchitecture)" Version="[$(LibNetHostAppPackVersion)]" PrivateAssets="all" ExcludeAssets="all" />
   </ItemGroup>