Skip to content

[release/2.1] Include SharedFx bundle in Hosting Bundle, instead of SharedFx .msi #36890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
dep:ProviderKey="$(var.BundleProviderKey)">
<Bundle Name="$(var.BundleName)" Version="$(var.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=320539"
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 @@ -72,8 +72,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>
2 changes: 2 additions & 0 deletions src/Installers/Windows/WindowsHostingBundle/Product.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
<PropertyGroup>
<DotNetDarkOutputPath>$(IntermediateOutputPath)d\</DotNetDarkOutputPath>
<DepsPath>$(BaseIntermediateOutputPath)</DepsPath>
<InstallersOutputPath>$(OutputPath)$(Cultures)/</InstallersOutputPath>
<DefineConstants>$(DefineConstants);DepsPath=$(DepsPath)</DefineConstants>
<DefineConstants>$(DefineConstants);OutputPath=$(OutputPath)</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.OutputPath)$(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.OutputPath)$(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 @@ -17,8 +17,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x86" />
<ProjectReference Include="..\SharedFrameworkLib\SharedFrameworkLib.wixproj" SetPlatform="Platform=x64" />
<ProjectReference Include="..\SharedFrameworkBundle\SharedFrameworkBundle.wixproj" />
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
Expand All @@ -40,4 +39,60 @@
<Import Project="Product.targets" />

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />

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

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

<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>