Skip to content

Commit 7f6a5fb

Browse files
authored
Fix win-x86 windowsdesktop and aspnetcore builds (#45162)
1 parent aed9dad commit 7f6a5fb

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From a2e9089dca596cacf235242fbfb3189d3f037b68 Mon Sep 17 00:00:00 2001
2+
From: Viktor Hofer <[email protected]>
3+
Date: Wed, 27 Nov 2024 10:32:11 +0100
4+
Subject: [PATCH] Set target platform for wixproj and vcxproj correctly
5+
6+
wixprojs allow x86, x64 and arm64 (idetical to the TargetArchitecture platform)
7+
vcxprojs allow Win32, x64 and ARM64
8+
9+
Backport: https://github.com/dotnet/aspnetcore/pull/59194
10+
11+
---
12+
eng/Build.props | 19 ++++++++++---------
13+
.../SharedFrameworkBundle.wixproj | 2 +-
14+
2 files changed, 11 insertions(+), 10 deletions(-)
15+
16+
diff --git a/eng/Build.props b/eng/Build.props
17+
index b3ead4d694..7828cca441 100644
18+
--- a/eng/Build.props
19+
+++ b/eng/Build.props
20+
@@ -218,9 +218,10 @@
21+
<!-- BuildInstallers -->
22+
<PropertyGroup>
23+
<_BuildWindowsInstallers Condition="'$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">true</_BuildWindowsInstallers>
24+
- <_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'x86' ">Win32</_WixTargetPlatform>
25+
- <_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'x64' ">x64</_WixTargetPlatform>
26+
- <_WixTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64' ">ARM64</_WixTargetPlatform>
27+
+
28+
+ <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x86'">Win32</_VcxTargetPlatform>
29+
+ <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'x64'">x64</_VcxTargetPlatform>
30+
+ <_VcxTargetPlatform Condition="'$(TargetArchitecture)' == 'arm64'">ARM64</_VcxTargetPlatform>
31+
</PropertyGroup>
32+
33+
<ItemGroup Condition="'$(DotNetBuild)' != 'true' and '$(_BuildWindowsInstallers)' == 'true' ">
34+
@@ -262,16 +263,16 @@
35+
<!-- In a vertical build, only build the MSIs for the current vertical in the first pass and build the hosting bundle in the second pass -->
36+
<ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') and '$(_BuildWindowsInstallers)' == 'true'">
37+
<!-- Build the ANCM custom action -->
38+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
39+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=$(_VcxTargetPlatform)" />
40+
<!-- Build the ANCM msis -->
41+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
42+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
43+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
44+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
45+
<!-- Build the targeting pack installers -->
46+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
47+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\TargetingPack\TargetingPack.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
48+
<!-- Build the SharedFramework installers -->
49+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
50+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
51+
<!-- Build the SharedFramework wixlib -->
52+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=$(_WixTargetPlatform)" />
53+
+ <InstallerProject Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
54+
</ItemGroup>
55+
56+
<ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '2') and '$(TargetOsName)' == 'win' and '$(TargetArchitecture)' == 'x64'">
57+
diff --git a/src/Installers/Windows/SharedFrameworkBundle/SharedFrameworkBundle.wixproj b/src/Installers/Windows/SharedFrameworkBundle/SharedFrameworkBundle.wixproj
58+
index c308442b3f..a0782dea75 100644
59+
--- a/src/Installers/Windows/SharedFrameworkBundle/SharedFrameworkBundle.wixproj
60+
+++ b/src/Installers/Windows/SharedFrameworkBundle/SharedFrameworkBundle.wixproj
61+
@@ -48,7 +48,7 @@
62+
<ItemGroup>
63+
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj"
64+
SetPlatform="Platform=x86"
65+
- Condition="'$(DotNetBuild)' != 'true' or '$(Platform)' == 'Win32'">
66+
+ Condition="'$(DotNetBuild)' != 'true' or '$(Platform)' == 'x86'">
67+
<Name>SharedFrameworkLib</Name>
68+
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
69+
<Private>True</Private>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 4332beffccfc3cf080350c507a163bd20852dea6 Mon Sep 17 00:00:00 2001
2+
From: Viktor Hofer <[email protected]>
3+
Date: Wed, 27 Nov 2024 00:09:18 +0100
4+
Subject: [PATCH] Correctly reference ref project for Windows.Primitives.csproj
5+
6+
Backport: https://github.com/dotnet/wpf/pull/10122
7+
8+
---
9+
.../System.Windows.Primitives.csproj | 6 +++++-
10+
1 file changed, 5 insertions(+), 1 deletion(-)
11+
12+
diff --git a/src/Microsoft.DotNet.Wpf/src/System.Windows.Primitives/System.Windows.Primitives.csproj b/src/Microsoft.DotNet.Wpf/src/System.Windows.Primitives/System.Windows.Primitives.csproj
13+
index 04d26172a..b84ce21ef 100644
14+
--- a/src/Microsoft.DotNet.Wpf/src/System.Windows.Primitives/System.Windows.Primitives.csproj
15+
+++ b/src/Microsoft.DotNet.Wpf/src/System.Windows.Primitives/System.Windows.Primitives.csproj
16+
@@ -29,6 +29,10 @@
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="$(MicrosoftWindowsCsWin32PackageVersion)" PrivateAssets="all" />
19+
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafePackageVersion)" />
20+
+
21+
+ <ProjectReference Include="$(WpfSourceDir)System.Windows.Primitives\ref\System.Windows.Primitives-ref.csproj">
22+
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
23+
+ </ProjectReference>
24+
</ItemGroup>
25+
26+
-</Project>
27+
\ No newline at end of file
28+
+</Project>

0 commit comments

Comments
 (0)