Skip to content

Commit ac0a387

Browse files
authored
Include SharedFx bundle in Hosting Bundle, instead of SharedFx .msi (#36858)
* Chain SharedFx Bundle into Hosting Bundle instead of .msi * Fixup * Move stuff around * Try something * Try something else * AfterTargets * Fix version * Fixup * Feedback
1 parent c17f75d commit ac0a387

File tree

5 files changed

+103
-16
lines changed

5 files changed

+103
-16
lines changed

src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
3-
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
4-
dep:ProviderKey="$(var.BundleProviderKey)">
3+
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)">
54
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
65
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=329770"
76
LogoFile="DotNetLogo.bmp"

src/Installers/Windows/WindowsHostingBundle/Bundle.wxs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@
7676
<PackageGroupRef Id="PG_ANCM" />
7777
<PackageGroupRef Id="PG_DOTNET_REDIST_LTS_BUNDLE" />
7878
<!--<PackageGroupRef Id="PG_DOTNET_REDIST_FTS_BUNDLE" />-->
79-
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x86" />
80-
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x64" />
79+
<PackageGroupRef Id="PG_SHAREDFX_REDIST_BUNDLE" />
8180
</Chain>
8281
</Bundle>
8382
</Wix>

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<DotNetDarkOutputPath>$(IntermediateOutputPath)d\</DotNetDarkOutputPath>
44
<DepsPath>$(BaseIntermediateOutputPath)</DepsPath>
55
<DefineConstants>$(DefineConstants);DepsPath=$(DepsPath)</DefineConstants>
6+
<DefineConstants>$(DefineConstants);InstallersOutputPath=$(InstallersOutputPath)</DefineConstants>
67
</PropertyGroup>
78

89
<ItemGroup>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
3+
<Fragment>
4+
<PackageGroup Id="PG_SHAREDFX_REDIST_BUNDLE">
5+
<RollbackBoundary Id="RB_SHAREDFX_REDIST_BUNDLE" />
6+
7+
<ExePackage Id="SharedFxRedist_x64" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx64)"
8+
Name="$(var.SharedFxRedistInstallerx64)"
9+
Compressed="yes"
10+
Vital="yes"
11+
InstallCondition="VersionNT64 AND (NOT OPT_NO_SHAREDFX)"
12+
InstallCommand="/quiet /norestart"
13+
RepairCommand="/quiet /repair"
14+
Permanent="yes"
15+
DetectCondition="SharedFxRedistProductVersion_x64 = v$(var.SharedFxInstallerProductVersionx64)">
16+
</ExePackage>
17+
18+
<ExePackage Id="SharedFxRedist_x86" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx86)"
19+
Name="$(var.SharedFxRedistInstallerx86)"
20+
Compressed="yes"
21+
Vital="yes"
22+
InstallCondition="(NOT OPT_NO_SHAREDFX) AND (NOT OPT_NO_X86)"
23+
InstallCommand="/quiet /norestart"
24+
RepairCommand="/quiet /repair"
25+
Permanent="yes"
26+
DetectCondition="SharedFxRedistProductVersion_x86 = v$(var.SharedFxInstallerProductVersionx86)">
27+
</ExePackage>
28+
</PackageGroup>
29+
</Fragment>
30+
31+
<Fragment>
32+
<util:ProductSearch Id="SharedFxRedistProductSearch_x86"
33+
Condition="NOT VersionNT64"
34+
ProductCode="$(var.SharedFxInstallerProductCodex86)"
35+
Result="version"
36+
Variable="SharedFxRedistProductVersion_x86" />
37+
38+
<util:ProductSearch Id="SharedFxRedistProductSearch_x64"
39+
Condition="VersionNT64"
40+
ProductCode="$(var.SharedFxInstallerProductCodex64)"
41+
Result="version"
42+
Variable="SharedFxRedistProductVersion_x64" />
43+
</Fragment>
44+
</Wix>

src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<Compile Include="ANCM.wxs" />
3636
<Compile Include="Bundle.wxs" />
3737
<Compile Include="DotNetCore.wxs" />
38+
<Compile Include="SharedFramework.wxs" />
3839
<EmbeddedResource Include="thm.wxl" />
3940
</ItemGroup>
4041

@@ -53,19 +54,9 @@
5354
<Private>True</Private>
5455
<DoNotHarvest>true</DoNotHarvest>
5556
</ProjectReference>
56-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj">
57-
<SetPlatform>Platform=x86</SetPlatform>
58-
<Name>SharedFrameworkLib_x86</Name>
59-
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
57+
<ProjectReference Include="..\SharedFrameworkBundle\SharedFrameworkBundle.wixproj">
6058
<Private>True</Private>
61-
<DoNotHarvest>true</DoNotHarvest>
62-
</ProjectReference>
63-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj">
64-
<SetPlatform>Platform=x64</SetPlatform>
65-
<Name>SharedFrameworkLib_x64</Name>
66-
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
67-
<Private>True</Private>
68-
<DoNotHarvest>true</DoNotHarvest>
59+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
6960
</ProjectReference>
7061
</ItemGroup>
7162

@@ -77,6 +68,10 @@
7768
<PackageFileName>dotnet-hosting-$(PackageVersion)-win$(TargetExt)</PackageFileName>
7869

7970
<BundleNameShort>Microsoft .NET $(PackageBrandingVersion)</BundleNameShort>
71+
<SharedFxPackageVersion>$(PackageVersion)</SharedFxPackageVersion>
72+
<SharedFxMsiVersion>$(PackageVersion)</SharedFxMsiVersion>
73+
<SharedFxMsiVersion
74+
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</SharedFxMsiVersion>
8075
</PropertyGroup>
8176

8277
<PropertyGroup>
@@ -93,6 +88,19 @@
9388
<BundleRegName>$(BundleNameFull)</BundleRegName>
9489
</PropertyGroup>
9590

91+
<ItemGroup>
92+
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x64.exe">
93+
<TargetPlatform>x64</TargetPlatform>
94+
<BundleNameProperty>SharedFxRedistInstallerx64</BundleNameProperty>
95+
<Version>$(SharedFxPackageVersion)</Version>
96+
</SharedFxInstallers>
97+
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x86.exe">
98+
<TargetPlatform>x86</TargetPlatform>
99+
<BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
100+
<Version>$(SharedFxPackageVersion)</Version>
101+
</SharedFxInstallers>
102+
</ItemGroup>
103+
96104
<PropertyGroup>
97105
<DefineConstants>$(DefineConstants);BundleName=$(BundleName)</DefineConstants>
98106
<DefineConstants>$(DefineConstants);BundleNameFull=$(BundleNameFull)</DefineConstants>
@@ -104,4 +112,40 @@
104112
<DefineConstants>$(DefineConstants);BundleRegFamily=$(BundleRegFamily)</DefineConstants>
105113
<DefineConstants>$(DefineConstants);BundleRegName=$(BundleRegName)</DefineConstants>
106114
</PropertyGroup>
115+
116+
<Target Name="ExtractPropertiesFromSharedFxMsi" DependsOnTargets="FetchDependencies" AfterTargets="ResolveProjectReferences">
117+
<!-- Create properties that holds the executable name. These are passed to the bundles so we can reference them as variables
118+
from inside the ExePackage authoring. -->
119+
<CreateProperty Value="%(SharedFxInstallers.Filename)%(Extension)">
120+
<Output TaskParameter="Value" PropertyName="%(SharedFxInstallers.BundleNameProperty)"/>
121+
</CreateProperty>
122+
123+
<ItemGroup>
124+
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
125+
<ProductVersionProperty>SharedFxInstallerProductVersionx64</ProductVersionProperty>
126+
<ProductCodeProperty>SharedFxInstallerProductCodex64</ProductCodeProperty>
127+
</SharedFxPayload>
128+
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
129+
<ProductVersionProperty>SharedFxInstallerProductVersionx86</ProductVersionProperty>
130+
<ProductCodeProperty>SharedFxInstallerProductCodex86</ProductCodeProperty>
131+
</SharedFxPayload>
132+
</ItemGroup>
133+
134+
<!-- Read MSI properties -->
135+
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductVersion">
136+
<Output TaskParameter="Value" PropertyName="%(ProductVersionProperty)" />
137+
</GetMsiProperty>
138+
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductCode">
139+
<Output TaskParameter="Value" PropertyName="%(ProductCodeProperty)" />
140+
</GetMsiProperty>
141+
142+
<PropertyGroup>
143+
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx64=$(SharedFxRedistInstallerx64)</DefineConstants>
144+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx64=$(SharedFxInstallerProductVersionx64)</DefineConstants>
145+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex64=$(SharedFxInstallerProductCodex64)</DefineConstants>
146+
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx86=$(SharedFxRedistInstallerx86)</DefineConstants>
147+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx86=$(SharedFxInstallerProductVersionx86)</DefineConstants>
148+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex86=$(SharedFxInstallerProductCodex86)</DefineConstants>
149+
</PropertyGroup>
150+
</Target>
107151
</Project>

0 commit comments

Comments
 (0)