Skip to content

Chain runtime .Msi's instead of .Exe's in hosting bundle #56631

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 7 commits into from
Jul 12, 2024
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
96 changes: 57 additions & 39 deletions src/Installers/Windows/WindowsHostingBundle/DotNetCore.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,80 @@
<?include ..\AspNetCoreModule-Setup\IIS-Setup\include.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<util:ProductSearch Id="DotNetRedistLtsProductSearch_x86"
Condition="NOT VersionNT64"
ProductCode="$(var.DotNetRedistLtsInstallerProductCodex86)"
Result="version"
Variable="DotNetRedistLtsProductVersion_x86" />

<util:ProductSearch Id="DotNetRedistLtsProductSearch_x64"
Condition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
ProductCode="$(var.DotNetRedistLtsInstallerProductCodex64)"
Result="version"
Variable="DotNetRedistLtsProductVersion_x64" />

<util:ProductSearch Id="DotNetRedistLtsProductSearch_arm64"
Condition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
ProductCode="$(var.DotNetRedistLtsInstallerProductCodearm64)"
Result="version"
Variable="DotNetRedistLtsProductVersion_arm64" />

<PackageGroup Id="PG_DOTNET_REDIST_LTS_BUNDLE">
<RollbackBoundary Id="RB_DOTNET_REDIST_LTS_BUNDLE" />

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<ExePackage Id="DotNetRedistLts_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerarm64)"
<MsiPackage Id="DotNetRedistLts_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerarm64)"
Name="$(var.DotNetRedistLtsInstallerarm64)"
Compressed="yes"
Vital="yes"
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
InstallCommand="/quiet /norestart"
RepairCommand="/quiet /norestart /repair"
Permanent="yes"
DetectCondition="DotNetRedistLtsProductVersion_arm64 = v$(var.DotNetRedistLtsInstallerProductVersionarm64)">
</ExePackage>
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<ExePackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
<MsiPackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
Name="$(var.DotNetRedistLtsInstallerx64)"
Compressed="yes"
Vital="yes"
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
InstallCommand="/quiet /norestart"
RepairCommand="/quiet /norestart /repair"
UninstallCommand="/quiet /norestart /uninstall"
DetectCondition="DotNetRedistLtsProductVersion_x64 = v$(var.DotNetRedistLtsInstallerProductVersionx64)">
</ExePackage>
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
<ExePackage Id="DotNetRedistLts_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx86)"
<MsiPackage Id="DotNetRedistLts_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx86)"
Name="$(var.DotNetRedistLtsInstallerx86)"
Compressed="yes"
Vital="yes"
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)"
InstallCommand="/quiet /norestart"
RepairCommand="/quiet /norestart /repair"
UninstallCommand="/quiet /norestart /uninstall"
DetectCondition="DotNetRedistLtsProductVersion_x86 = v$(var.DotNetRedistLtsInstallerProductVersionx86)">
</ExePackage>
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHost_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerarm64)"
Name="$(var.DotNetRedistHostInstallerarm64)"
Compressed="yes"
Vital="yes"
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHost_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerx64)"
Name="$(var.DotNetRedistHostInstallerx64)"
Compressed="yes"
Vital="yes"
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHost_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerx86)"
Name="$(var.DotNetRedistHostInstallerx86)"
Compressed="yes"
Vital="yes"
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHostfxr_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerarm64)"
Name="$(var.DotNetRedistHostfxrInstallerarm64)"
Compressed="yes"
Vital="yes"
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHostfxr_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerx64)"
Name="$(var.DotNetRedistHostfxrInstallerx64)"
Compressed="yes"
Vital="yes"
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
</MsiPackage>

<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
<MsiPackage Id="DotNetRedistHostfxr_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerx86)"
Name="$(var.DotNetRedistHostfxrInstallerx86)"
Compressed="yes"
Vital="yes"
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
</MsiPackage>
</PackageGroup>
</Fragment>
</Wix>
99 changes: 51 additions & 48 deletions src/Installers/Windows/WindowsHostingBundle/Product.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,32 @@
</PropertyGroup>

<ItemGroup>
<Platforms Include="x64;x86;arm64" />
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
<TargetPlatform>x64</TargetPlatform>
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<BundleNameProperty>DotNetRedistLtsInstallerx64</BundleNameProperty>
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
<TargetPlatform>x86</TargetPlatform>
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<BundleNameProperty>DotNetRedistLtsInstallerx86</BundleNameProperty>
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
<TargetPlatform>arm64</TargetPlatform>
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<BundleNameProperty>DotNetRedistLtsInstallerarm64</BundleNameProperty>
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<BundleNameProperty>DotNetRedistHostInstallerx64</BundleNameProperty>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<BundleNameProperty>DotNetRedistHostInstallerx86</BundleNameProperty>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<BundleNameProperty>DotNetRedistHostInstallerarm64</BundleNameProperty>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<BundleNameProperty>DotNetRedistHostfxrInstallerx64</BundleNameProperty>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<BundleNameProperty>DotNetRedistHostfxrInstallerx86</BundleNameProperty>
</RuntimeInstallers>
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<BundleNameProperty>DotNetRedistHostfxrInstallerarm64</BundleNameProperty>
</RuntimeInstallers>
</ItemGroup>

Expand All @@ -32,14 +43,32 @@
<Target Name="CollectDependencies" BeforeTargets="Restore;CollectPackageReferences">
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
<ItemGroup>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</TargetFileName>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
</RemoteAsset>
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
</RemoteAsset>
</ItemGroup>

Expand Down Expand Up @@ -74,42 +103,16 @@
<Output TaskParameter="Value" PropertyName="%(RuntimeInstallers.BundleNameProperty)"/>
</CreateProperty>

<!-- Decompile the bundles so that we can extract the MSI and read their version information. We need this to author ExePackage@DetectCondition
in the bundles that chain the runtime bundles -->
<Exec Command="$(DarkToolPath) -x $(DotNetDarkOutputPath)\%(RuntimeInstallers.Version)\%(TargetPlatform) %(Identity)" />

<ItemGroup>
<DotNetPayload Include="$(DotNetDarkOutputPath)\$(MicrosoftNETCoreAppRuntimeVersion)\%(Platforms.Identity)\AttachedContainer\**\dotnet-host-*win-*.msi">
<ProductVersionProperty>DotNetRedistLtsInstallerProductVersion%(Platforms.Identity)</ProductVersionProperty>
<ProductCodeProperty>DotNetRedistLtsInstallerProductCode%(Platforms.Identity)</ProductCodeProperty>
<UpgradeCodeProperty>DotNetRedistLtsInstallerUpgradeCode%(Platforms.Identity)</UpgradeCodeProperty>
</DotNetPayload>
</ItemGroup>

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

<PropertyGroup>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerx64=$(DotNetRedistLtsInstallerx64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionx64=$(DotNetRedistLtsInstallerProductVersionx64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodex64=$(DotNetRedistLtsInstallerProductCodex64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodex64=$(DotNetRedistLtsInstallerUpgradeCodex64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerx86=$(DotNetRedistLtsInstallerx86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionx86=$(DotNetRedistLtsInstallerProductVersionx86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodex86=$(DotNetRedistLtsInstallerProductCodex86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodex86=$(DotNetRedistLtsInstallerUpgradeCodex86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerarm64=$(DotNetRedistLtsInstallerarm64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionarm64=$(DotNetRedistLtsInstallerProductVersionarm64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodearm64=$(DotNetRedistLtsInstallerProductCodearm64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodearm64=$(DotNetRedistLtsInstallerUpgradeCodearm64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerx64=$(DotNetRedistHostInstallerx64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerx86=$(DotNetRedistHostInstallerx86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerarm64=$(DotNetRedistHostInstallerarm64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerx64=$(DotNetRedistHostfxrInstallerx64)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerx86=$(DotNetRedistHostfxrInstallerx86)</DefineConstants>
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerarm64=$(DotNetRedistHostfxrInstallerarm64)</DefineConstants>
</PropertyGroup>
</Target>
</Project>
Loading
Loading