Skip to content

Commit 7ba36b2

Browse files
authored
[release/2.1] Include SharedFx bundle in Hosting Bundle, instead of SharedFx .msi (#36890)
* Include SharedFx bundle in Hosting Bundle, instead of SharedFx .msi * Fixup * More fixup
1 parent 0d07e7a commit 7ba36b2

File tree

5 files changed

+105
-6
lines changed

5 files changed

+105
-6
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.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
4-
dep:ProviderKey="$(var.BundleProviderKey)">
3+
<Bundle Name="$(var.BundleName)" Version="$(var.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)">
54
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
65
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=320539"
76
LogoFile="DotNetLogo.bmp"

src/Installers/Windows/WindowsHostingBundle/Bundle.wxs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
<PackageGroupRef Id="PG_ANCM" />
7373
<PackageGroupRef Id="PG_DOTNET_REDIST_LTS_BUNDLE" />
7474
<!--<PackageGroupRef Id="PG_DOTNET_REDIST_FTS_BUNDLE" />-->
75-
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x86" />
76-
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x64" />
75+
<PackageGroupRef Id="PG_SHAREDFX_REDIST_BUNDLE" />
7776
</Chain>
7877
</Bundle>
7978
</Wix>

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<PropertyGroup>
33
<DotNetDarkOutputPath>$(IntermediateOutputPath)d\</DotNetDarkOutputPath>
44
<DepsPath>$(BaseIntermediateOutputPath)</DepsPath>
5+
<InstallersOutputPath>$(OutputPath)$(Cultures)/</InstallersOutputPath>
56
<DefineConstants>$(DefineConstants);DepsPath=$(DepsPath)</DefineConstants>
7+
<DefineConstants>$(DefineConstants);OutputPath=$(OutputPath)</DefineConstants>
68
</PropertyGroup>
79

810
<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.OutputPath)$(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.OutputPath)$(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: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x86" />
21-
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x64" />
20+
<ProjectReference Include="..\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" />
2221
<WixExtension Include="WixUtilExtension">
2322
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
2423
<Name>WixUtilExtension</Name>
@@ -40,4 +39,60 @@
4039
<Import Project="Product.targets" />
4140

4241
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
42+
43+
<PropertyGroup>
44+
<SharedFxPackageVersion>$(PackageVersion)</SharedFxPackageVersion>
45+
<SharedFxMsiVersion>$(PackageVersion)</SharedFxMsiVersion>
46+
<SharedFxMsiVersion
47+
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</SharedFxMsiVersion>
48+
</PropertyGroup>
49+
50+
<ItemGroup>
51+
<SharedFxInstallers Include="$(OutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x64.exe">
52+
<TargetPlatform>x64</TargetPlatform>
53+
<BundleNameProperty>SharedFxRedistInstallerx64</BundleNameProperty>
54+
<Version>$(SharedFxPackageVersion)</Version>
55+
</SharedFxInstallers>
56+
<SharedFxInstallers Include="$(OutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x86.exe">
57+
<TargetPlatform>x86</TargetPlatform>
58+
<BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
59+
<Version>$(SharedFxPackageVersion)</Version>
60+
</SharedFxInstallers>
61+
</ItemGroup>
62+
63+
<Target Name="ExtractPropertiesFromSharedFxMsi" DependsOnTargets="FetchDependencies" AfterTargets="ResolveProjectReferences">
64+
<!-- Create properties that holds the executable name. These are passed to the bundles so we can reference them as variables
65+
from inside the ExePackage authoring. -->
66+
<CreateProperty Value="%(SharedFxInstallers.Filename)%(Extension)">
67+
<Output TaskParameter="Value" PropertyName="%(SharedFxInstallers.BundleNameProperty)"/>
68+
</CreateProperty>
69+
70+
<ItemGroup>
71+
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
72+
<ProductVersionProperty>SharedFxInstallerProductVersionx64</ProductVersionProperty>
73+
<ProductCodeProperty>SharedFxInstallerProductCodex64</ProductCodeProperty>
74+
</SharedFxPayload>
75+
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
76+
<ProductVersionProperty>SharedFxInstallerProductVersionx86</ProductVersionProperty>
77+
<ProductCodeProperty>SharedFxInstallerProductCodex86</ProductCodeProperty>
78+
</SharedFxPayload>
79+
</ItemGroup>
80+
81+
<!-- Read MSI properties -->
82+
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductVersion">
83+
<Output TaskParameter="Value" PropertyName="%(ProductVersionProperty)" />
84+
</GetMsiProperty>
85+
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductCode">
86+
<Output TaskParameter="Value" PropertyName="%(ProductCodeProperty)" />
87+
</GetMsiProperty>
88+
89+
<PropertyGroup>
90+
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx64=$(SharedFxRedistInstallerx64)</DefineConstants>
91+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx64=$(SharedFxInstallerProductVersionx64)</DefineConstants>
92+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex64=$(SharedFxInstallerProductCodex64)</DefineConstants>
93+
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx86=$(SharedFxRedistInstallerx86)</DefineConstants>
94+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx86=$(SharedFxInstallerProductVersionx86)</DefineConstants>
95+
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex86=$(SharedFxInstallerProductCodex86)</DefineConstants>
96+
</PropertyGroup>
97+
</Target>
4398
</Project>

0 commit comments

Comments
 (0)