Skip to content

Commit

Permalink
[release/5.0] Include SharedFx bundle in Hosting Bundle, instead of S…
Browse files Browse the repository at this point in the history
…haredFx .msi (#36868)

* Chain SharedFx Bundle into Hosting Bundle instead of .msi

* Fixup

* Move stuff around

* Try something

* Try something else

* AfterTargets

* Fix version

* Fixup

* Feedback

Co-authored-by: Will Godbe <wigodbe@microsoft.com>
  • Loading branch information
github-actions[bot] and wtgodbe committed Sep 23, 2021
1 parent d5ae64d commit 60819f7
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
dep:ProviderKey="$(var.BundleProviderKey)">
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=329770"
LogoFile="DotNetLogo.bmp"
Expand Down
3 changes: 1 addition & 2 deletions src/Installers/Windows/WindowsHostingBundle/Bundle.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
<PackageGroupRef Id="PG_ANCM" />
<PackageGroupRef Id="PG_DOTNET_REDIST_LTS_BUNDLE" />
<!--<PackageGroupRef Id="PG_DOTNET_REDIST_FTS_BUNDLE" />-->
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x86" />
<PackageGroupRef Id="PG_AspNetCoreSharedFramework_x64" />
<PackageGroupRef Id="PG_SHAREDFX_REDIST_BUNDLE" />
</Chain>
</Bundle>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<DotNetDarkOutputPath>$(IntermediateOutputPath)d\</DotNetDarkOutputPath>
<DepsPath>$(BaseIntermediateOutputPath)</DepsPath>
<DefineConstants>$(DefineConstants);DepsPath=$(DepsPath)</DefineConstants>
<DefineConstants>$(DefineConstants);InstallersOutputPath=$(InstallersOutputPath)</DefineConstants>
</PropertyGroup>

<ItemGroup>
Expand Down
44 changes: 44 additions & 0 deletions src/Installers/Windows/WindowsHostingBundle/SharedFramework.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<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" />

<ExePackage Id="SharedFxRedist_x64" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx64)"
Name="$(var.SharedFxRedistInstallerx64)"
Compressed="yes"
Vital="yes"
InstallCondition="VersionNT64 AND (NOT OPT_NO_SHAREDFX)"
InstallCommand="/quiet /norestart"
RepairCommand="/quiet /repair"
Permanent="yes"
DetectCondition="SharedFxRedistProductVersion_x64 = v$(var.SharedFxInstallerProductVersionx64)">
</ExePackage>

<ExePackage Id="SharedFxRedist_x86" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx86)"
Name="$(var.SharedFxRedistInstallerx86)"
Compressed="yes"
Vital="yes"
InstallCondition="(NOT OPT_NO_SHAREDFX) AND (NOT OPT_NO_X86)"
InstallCommand="/quiet /norestart"
RepairCommand="/quiet /repair"
Permanent="yes"
DetectCondition="SharedFxRedistProductVersion_x86 = v$(var.SharedFxInstallerProductVersionx86)">
</ExePackage>
</PackageGroup>
</Fragment>

<Fragment>
<util:ProductSearch Id="SharedFxRedistProductSearch_x86"
Condition="NOT VersionNT64"
ProductCode="$(var.SharedFxInstallerProductCodex86)"
Result="version"
Variable="SharedFxRedistProductVersion_x86" />

<util:ProductSearch Id="SharedFxRedistProductSearch_x64"
Condition="VersionNT64"
ProductCode="$(var.SharedFxInstallerProductCodex64)"
Result="version"
Variable="SharedFxRedistProductVersion_x64" />
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Compile Include="ANCM.wxs" />
<Compile Include="Bundle.wxs" />
<Compile Include="DotNetCore.wxs" />
<Compile Include="SharedFramework.wxs" />
<EmbeddedResource Include="thm.wxl" />
</ItemGroup>

Expand All @@ -53,19 +54,9 @@
<Private>True</Private>
<DoNotHarvest>true</DoNotHarvest>
</ProjectReference>
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj">
<SetPlatform>Platform=x86</SetPlatform>
<Name>SharedFrameworkLib_x86</Name>
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
<ProjectReference Include="..\SharedFrameworkBundle\SharedFrameworkBundle.wixproj">
<Private>True</Private>
<DoNotHarvest>true</DoNotHarvest>
</ProjectReference>
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj">
<SetPlatform>Platform=x64</SetPlatform>
<Name>SharedFrameworkLib_x64</Name>
<Project>{5244BC49-2568-4701-80A6-EAB8950AB5FA}</Project>
<Private>True</Private>
<DoNotHarvest>true</DoNotHarvest>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

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

<BundleNameShort>Microsoft .NET $(PackageBrandingVersion)</BundleNameShort>
<SharedFxPackageVersion>$(PackageVersion)</SharedFxPackageVersion>
<SharedFxMsiVersion>$(PackageVersion)</SharedFxMsiVersion>
<SharedFxMsiVersion
Condition="! $(PackageVersion.Contains('$(_PreReleaseLabel)'))">$(PackageVersion)-$(_PreReleaseLabel)$(_BuildNumberLabels)</SharedFxMsiVersion>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -93,6 +88,19 @@
<BundleRegName>$(BundleNameFull)</BundleRegName>
</PropertyGroup>

<ItemGroup>
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x64.exe">
<TargetPlatform>x64</TargetPlatform>
<BundleNameProperty>SharedFxRedistInstallerx64</BundleNameProperty>
<Version>$(SharedFxPackageVersion)</Version>
</SharedFxInstallers>
<SharedFxInstallers Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxPackageVersion)-win-x86.exe">
<TargetPlatform>x86</TargetPlatform>
<BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
<Version>$(SharedFxPackageVersion)</Version>
</SharedFxInstallers>
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);BundleName=$(BundleName)</DefineConstants>
<DefineConstants>$(DefineConstants);BundleNameFull=$(BundleNameFull)</DefineConstants>
Expand All @@ -104,4 +112,40 @@
<DefineConstants>$(DefineConstants);BundleRegFamily=$(BundleRegFamily)</DefineConstants>
<DefineConstants>$(DefineConstants);BundleRegName=$(BundleRegName)</DefineConstants>
</PropertyGroup>

<Target Name="ExtractPropertiesFromSharedFxMsi" DependsOnTargets="FetchDependencies" AfterTargets="ResolveProjectReferences">
<!-- Create properties that holds the executable name. These are passed to the bundles so we can reference them as variables
from inside the ExePackage authoring. -->
<CreateProperty Value="%(SharedFxInstallers.Filename)%(Extension)">
<Output TaskParameter="Value" PropertyName="%(SharedFxInstallers.BundleNameProperty)"/>
</CreateProperty>

<ItemGroup>
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
<ProductVersionProperty>SharedFxInstallerProductVersionx64</ProductVersionProperty>
<ProductCodeProperty>SharedFxInstallerProductCodex64</ProductCodeProperty>
</SharedFxPayload>
<SharedFxPayload Include="$(InstallersOutputPath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
<ProductVersionProperty>SharedFxInstallerProductVersionx86</ProductVersionProperty>
<ProductCodeProperty>SharedFxInstallerProductCodex86</ProductCodeProperty>
</SharedFxPayload>
</ItemGroup>

<!-- Read MSI properties -->
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductVersion">
<Output TaskParameter="Value" PropertyName="%(ProductVersionProperty)" />
</GetMsiProperty>
<GetMsiProperty InstallPackage="%(SharedFxPayload.Identity)" Property="ProductCode">
<Output TaskParameter="Value" PropertyName="%(ProductCodeProperty)" />
</GetMsiProperty>

<PropertyGroup>
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx64=$(SharedFxRedistInstallerx64)</DefineConstants>
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx64=$(SharedFxInstallerProductVersionx64)</DefineConstants>
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex64=$(SharedFxInstallerProductCodex64)</DefineConstants>
<DefineConstants>$(DefineConstants);SharedFxRedistInstallerx86=$(SharedFxRedistInstallerx86)</DefineConstants>
<DefineConstants>$(DefineConstants);SharedFxInstallerProductVersionx86=$(SharedFxInstallerProductVersionx86)</DefineConstants>
<DefineConstants>$(DefineConstants);SharedFxInstallerProductCodex86=$(SharedFxInstallerProductCodex86)</DefineConstants>
</PropertyGroup>
</Target>
</Project>

0 comments on commit 60819f7

Please sign in to comment.