Skip to content

Commit 5fd01eb

Browse files
Chain runtime .Msi's instead of .Exe's in hosting bundle (#56631)
* Chain runtime .msi's instead of .exe's in Hosting Bundle * Fixup * Remove unneeded .msi codes * Remove more unneeded props * Feedback * Fix typo * Another typo --------- Co-authored-by: wtgodbe <wigodbe@microsoft.com>
1 parent 639952a commit 5fd01eb

File tree

4 files changed

+122
-160
lines changed

4 files changed

+122
-160
lines changed

src/Installers/Windows/WindowsHostingBundle/DotNetCore.wxs

Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,80 @@
22
<?include ..\AspNetCoreModule-Setup\IIS-Setup\include.wxi ?>
33
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
44
<Fragment>
5-
<util:ProductSearch Id="DotNetRedistLtsProductSearch_x86"
6-
Condition="NOT VersionNT64"
7-
ProductCode="$(var.DotNetRedistLtsInstallerProductCodex86)"
8-
Result="version"
9-
Variable="DotNetRedistLtsProductVersion_x86" />
10-
11-
<util:ProductSearch Id="DotNetRedistLtsProductSearch_x64"
12-
Condition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
13-
ProductCode="$(var.DotNetRedistLtsInstallerProductCodex64)"
14-
Result="version"
15-
Variable="DotNetRedistLtsProductVersion_x64" />
16-
17-
<util:ProductSearch Id="DotNetRedistLtsProductSearch_arm64"
18-
Condition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;)"
19-
ProductCode="$(var.DotNetRedistLtsInstallerProductCodearm64)"
20-
Result="version"
21-
Variable="DotNetRedistLtsProductVersion_arm64" />
22-
235
<PackageGroup Id="PG_DOTNET_REDIST_LTS_BUNDLE">
246
<RollbackBoundary Id="RB_DOTNET_REDIST_LTS_BUNDLE" />
257

268
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
27-
<ExePackage Id="DotNetRedistLts_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerarm64)"
9+
<MsiPackage Id="DotNetRedistLts_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerarm64)"
2810
Name="$(var.DotNetRedistLtsInstallerarm64)"
2911
Compressed="yes"
3012
Vital="yes"
31-
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
32-
InstallCommand="/quiet /norestart"
33-
RepairCommand="/quiet /norestart /repair"
34-
Permanent="yes"
35-
DetectCondition="DotNetRedistLtsProductVersion_arm64 = v$(var.DotNetRedistLtsInstallerProductVersionarm64)">
36-
</ExePackage>
13+
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
14+
</MsiPackage>
3715

3816
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
39-
<ExePackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
17+
<MsiPackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
4018
Name="$(var.DotNetRedistLtsInstallerx64)"
4119
Compressed="yes"
4220
Vital="yes"
43-
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
44-
InstallCommand="/quiet /norestart"
45-
RepairCommand="/quiet /norestart /repair"
46-
UninstallCommand="/quiet /norestart /uninstall"
47-
DetectCondition="DotNetRedistLtsProductVersion_x64 = v$(var.DotNetRedistLtsInstallerProductVersionx64)">
48-
</ExePackage>
21+
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
22+
</MsiPackage>
4923

5024
<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
51-
<ExePackage Id="DotNetRedistLts_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx86)"
25+
<MsiPackage Id="DotNetRedistLts_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx86)"
5226
Name="$(var.DotNetRedistLtsInstallerx86)"
5327
Compressed="yes"
5428
Vital="yes"
55-
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)"
56-
InstallCommand="/quiet /norestart"
57-
RepairCommand="/quiet /norestart /repair"
58-
UninstallCommand="/quiet /norestart /uninstall"
59-
DetectCondition="DotNetRedistLtsProductVersion_x86 = v$(var.DotNetRedistLtsInstallerProductVersionx86)">
60-
</ExePackage>
29+
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
30+
</MsiPackage>
31+
32+
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
33+
<MsiPackage Id="DotNetRedistHost_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerarm64)"
34+
Name="$(var.DotNetRedistHostInstallerarm64)"
35+
Compressed="yes"
36+
Vital="yes"
37+
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
38+
</MsiPackage>
39+
40+
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
41+
<MsiPackage Id="DotNetRedistHost_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerx64)"
42+
Name="$(var.DotNetRedistHostInstallerx64)"
43+
Compressed="yes"
44+
Vital="yes"
45+
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
46+
</MsiPackage>
47+
48+
<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
49+
<MsiPackage Id="DotNetRedistHost_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostInstallerx86)"
50+
Name="$(var.DotNetRedistHostInstallerx86)"
51+
Compressed="yes"
52+
Vital="yes"
53+
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
54+
</MsiPackage>
55+
56+
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
57+
<MsiPackage Id="DotNetRedistHostfxr_arm64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerarm64)"
58+
Name="$(var.DotNetRedistHostfxrInstallerarm64)"
59+
Compressed="yes"
60+
Vital="yes"
61+
InstallCondition="(NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
62+
</MsiPackage>
63+
64+
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
65+
<MsiPackage Id="DotNetRedistHostfxr_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerx64)"
66+
Name="$(var.DotNetRedistHostfxrInstallerx64)"
67+
Compressed="yes"
68+
Vital="yes"
69+
InstallCondition="VersionNT64 AND NOT (NativeMachine=&quot;$(var.NativeMachine_arm64)&quot;) AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)">
70+
</MsiPackage>
71+
72+
<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
73+
<MsiPackage Id="DotNetRedistHostfxr_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistHostfxrInstallerx86)"
74+
Name="$(var.DotNetRedistHostfxrInstallerx86)"
75+
Compressed="yes"
76+
Vital="yes"
77+
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)">
78+
</MsiPackage>
6179
</PackageGroup>
6280
</Fragment>
6381
</Wix>

src/Installers/Windows/WindowsHostingBundle/Product.targets

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,32 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<Platforms Include="x64;x86;arm64" />
11-
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
12-
<TargetPlatform>x64</TargetPlatform>
10+
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
1311
<BundleNameProperty>DotNetRedistLtsInstallerx64</BundleNameProperty>
14-
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
1512
</RuntimeInstallers>
16-
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
17-
<TargetPlatform>x86</TargetPlatform>
13+
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
1814
<BundleNameProperty>DotNetRedistLtsInstallerx86</BundleNameProperty>
19-
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
2015
</RuntimeInstallers>
21-
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
22-
<TargetPlatform>arm64</TargetPlatform>
16+
<RuntimeInstallers Include="$(DepsPath)dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
2317
<BundleNameProperty>DotNetRedistLtsInstallerarm64</BundleNameProperty>
24-
<Version>$(MicrosoftNETCoreAppRuntimeVersion)</Version>
18+
</RuntimeInstallers>
19+
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
20+
<BundleNameProperty>DotNetRedistHostInstallerx64</BundleNameProperty>
21+
</RuntimeInstallers>
22+
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
23+
<BundleNameProperty>DotNetRedistHostInstallerx86</BundleNameProperty>
24+
</RuntimeInstallers>
25+
<RuntimeInstallers Include="$(DepsPath)dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
26+
<BundleNameProperty>DotNetRedistHostInstallerarm64</BundleNameProperty>
27+
</RuntimeInstallers>
28+
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
29+
<BundleNameProperty>DotNetRedistHostfxrInstallerx64</BundleNameProperty>
30+
</RuntimeInstallers>
31+
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
32+
<BundleNameProperty>DotNetRedistHostfxrInstallerx86</BundleNameProperty>
33+
</RuntimeInstallers>
34+
<RuntimeInstallers Include="$(DepsPath)dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
35+
<BundleNameProperty>DotNetRedistHostfxrInstallerarm64</BundleNameProperty>
2536
</RuntimeInstallers>
2637
</ItemGroup>
2738

@@ -32,14 +43,32 @@
3243
<Target Name="CollectDependencies" BeforeTargets="Restore;CollectPackageReferences">
3344
<!-- Use the BrowserDebugHost as a sentinel for the nonshipping version for NETCoreApp. -->
3445
<ItemGroup>
35-
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe">
36-
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.exe</TargetFileName>
46+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
47+
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
48+
</RemoteAsset>
49+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
50+
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
51+
</RemoteAsset>
52+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
53+
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
54+
</RemoteAsset>
55+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
56+
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
3757
</RemoteAsset>
38-
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe">
39-
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.exe</TargetFileName>
58+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
59+
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
4060
</RemoteAsset>
41-
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe">
42-
<TargetFileName>dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.exe</TargetFileName>
61+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
62+
<TargetFileName>dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
63+
</RemoteAsset>
64+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi">
65+
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi</TargetFileName>
66+
</RemoteAsset>
67+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi">
68+
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi</TargetFileName>
69+
</RemoteAsset>
70+
<RemoteAsset Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi">
71+
<TargetFileName>dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi</TargetFileName>
4372
</RemoteAsset>
4473
</ItemGroup>
4574

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

77-
<!-- Decompile the bundles so that we can extract the MSI and read their version information. We need this to author ExePackage@DetectCondition
78-
in the bundles that chain the runtime bundles -->
79-
<Exec Command="$(DarkToolPath) -x $(DotNetDarkOutputPath)\%(RuntimeInstallers.Version)\%(TargetPlatform) %(Identity)" />
80-
81-
<ItemGroup>
82-
<DotNetPayload Include="$(DotNetDarkOutputPath)\$(MicrosoftNETCoreAppRuntimeVersion)\%(Platforms.Identity)\AttachedContainer\**\dotnet-host-*win-*.msi">
83-
<ProductVersionProperty>DotNetRedistLtsInstallerProductVersion%(Platforms.Identity)</ProductVersionProperty>
84-
<ProductCodeProperty>DotNetRedistLtsInstallerProductCode%(Platforms.Identity)</ProductCodeProperty>
85-
<UpgradeCodeProperty>DotNetRedistLtsInstallerUpgradeCode%(Platforms.Identity)</UpgradeCodeProperty>
86-
</DotNetPayload>
87-
</ItemGroup>
88-
89-
<!-- Read MSI properties -->
90-
<GetMsiProperty InstallPackage="%(DotNetPayload.Identity)" Property="ProductVersion">
91-
<Output TaskParameter="Value" PropertyName="%(ProductVersionProperty)" />
92-
</GetMsiProperty>
93-
<GetMsiProperty InstallPackage="%(DotNetPayload.Identity)" Property="ProductCode">
94-
<Output TaskParameter="Value" PropertyName="%(ProductCodeProperty)" />
95-
</GetMsiProperty>
96-
<GetMsiProperty InstallPackage="%(DotNetPayload.Identity)" Property="UpgradeCode">
97-
<Output TaskParameter="Value" PropertyName="%(UpgradeCodeProperty)" />
98-
</GetMsiProperty>
99-
100106
<PropertyGroup>
101107
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerx64=$(DotNetRedistLtsInstallerx64)</DefineConstants>
102-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionx64=$(DotNetRedistLtsInstallerProductVersionx64)</DefineConstants>
103-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodex64=$(DotNetRedistLtsInstallerProductCodex64)</DefineConstants>
104-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodex64=$(DotNetRedistLtsInstallerUpgradeCodex64)</DefineConstants>
105108
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerx86=$(DotNetRedistLtsInstallerx86)</DefineConstants>
106-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionx86=$(DotNetRedistLtsInstallerProductVersionx86)</DefineConstants>
107-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodex86=$(DotNetRedistLtsInstallerProductCodex86)</DefineConstants>
108-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodex86=$(DotNetRedistLtsInstallerUpgradeCodex86)</DefineConstants>
109109
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerarm64=$(DotNetRedistLtsInstallerarm64)</DefineConstants>
110-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductVersionarm64=$(DotNetRedistLtsInstallerProductVersionarm64)</DefineConstants>
111-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerProductCodearm64=$(DotNetRedistLtsInstallerProductCodearm64)</DefineConstants>
112-
<DefineConstants>$(DefineConstants);DotNetRedistLtsInstallerUpgradeCodearm64=$(DotNetRedistLtsInstallerUpgradeCodearm64)</DefineConstants>
110+
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerx64=$(DotNetRedistHostInstallerx64)</DefineConstants>
111+
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerx86=$(DotNetRedistHostInstallerx86)</DefineConstants>
112+
<DefineConstants>$(DefineConstants);DotNetRedistHostInstallerarm64=$(DotNetRedistHostInstallerarm64)</DefineConstants>
113+
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerx64=$(DotNetRedistHostfxrInstallerx64)</DefineConstants>
114+
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerx86=$(DotNetRedistHostfxrInstallerx86)</DefineConstants>
115+
<DefineConstants>$(DefineConstants);DotNetRedistHostfxrInstallerarm64=$(DotNetRedistHostfxrInstallerarm64)</DefineConstants>
113116
</PropertyGroup>
114117
</Target>
115118
</Project>

0 commit comments

Comments
 (0)