Skip to content

Commit ba98a07

Browse files
authored
Allow Hosting Bundle to be upgraded by MU (dotnet#37966)
* First set of files * Feedback * Feedback * Only one KeyPath * Shorten condition * Fixup * More cleanup * Change condition name
1 parent e63ad98 commit ba98a07

File tree

11 files changed

+175
-19
lines changed

11 files changed

+175
-19
lines changed

src/Installers/Windows/AspNetCoreModule-Setup/ANCMV2/aspnetcoremodulev2.wxs

+2-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,8 @@
283283
<AppSearch Before="LaunchConditions" />
284284
<LaunchConditions After="FindRelatedProducts" />
285285
<MigrateFeatureStates />
286-
<Custom Action="CheckForSharedConfiguration" After="InstallInitialize">OPT_NO_SHARED_CONFIG_CHECK=0 AND NOT Installed AND NOT REMOVE="ALL"</Custom>
286+
<!-- OPT_NO_SHARED_CONFIG_CHECK could be numeric 0, string 0, or empty - all of which correspond to "false" -->
287+
<Custom Action="CheckForSharedConfiguration" After="InstallInitialize">(NOT OPT_NO_SHARED_CONFIG_CHECK OR OPT_NO_SHARED_CONFIG_CHECK="" OR OPT_NO_SHARED_CONFIG_CHECK="0") AND NOT Installed AND NOT REMOVE="ALL"</Custom>
287288
<Custom Action="CA_UNLOCk_HANDLER_PROPERTY" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>
288289
<Custom Action="CA_UNLOCk_HANDLER" After="CA_UNLOCk_HANDLER_PROPERTY"><![CDATA[(NOT PATCH)]]></Custom>
289290
<Custom Action="UpdateDynamicCompression" After="InstallFiles"><![CDATA[(NOT PATCH)]]></Custom>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
4+
5+
<PropertyGroup>
6+
<Name>$(HostOptionsName)</Name>
7+
<OutputName>$(HostOptionsName)</OutputName>
8+
<OutputType>Package</OutputType>
9+
<ProductNameFolder>Microsoft ASP.NET Core Hosting Bundle Options</ProductNameFolder>
10+
<ProductNameShort>AspNetCore.HostOptions</ProductNameShort>
11+
<Platform>x86</Platform>
12+
<ProjectGuid>20248cd1-c5aa-4f42-ad88-bc260d64deea</ProjectGuid>
13+
<IsShipping>true</IsShipping>
14+
<SchemaVersion>2.0</SchemaVersion>
15+
16+
<!-- Namespace used to generate stable UUID3 GUIDs for MSI ProductCode, etc. DO NOT CHANGE THIS. -->
17+
<NamespaceGuid>$(HostingBundleNamespaceGuid)</NamespaceGuid>
18+
</PropertyGroup>
19+
20+
<ItemGroup>
21+
<Compile Include="Product.wxs" />
22+
</ItemGroup>
23+
24+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
25+
26+
<PropertyGroup>
27+
<PackageFileName>dotnet-hosting-options-$(PackageVersion)-win$(TargetExt)</PackageFileName>
28+
<ProductName>Microsoft ASP.NET Core $(PackageBrandingVersion) Hosting Bundle Options</ProductName>
29+
<DefineConstants>$(DefineConstants);ProductName=$(ProductName)</DefineConstants>
30+
</PropertyGroup>
31+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<Product Id="$(var.ProductCode)" Name="$(var.ProductName)" Language="1033" Version="$(var.Version)"
4+
Manufacturer="Microsoft Corporation" UpgradeCode="$(var.UpgradeCode)">
5+
<Package InstallerVersion="$(var.InstallerVersion)" Compressed="yes" InstallScope="perMachine" />
6+
7+
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
8+
<Media Id="1" />
9+
10+
<!-- Custom Actions to assign a default of 0 to all switches -->
11+
<CustomAction Id="Set_OPT_NO_ANCM" Property="OPT_NO_ANCM" Value="0" />
12+
<CustomAction Id="Set_OPT_NO_FTS" Property="OPT_NO_FTS" Value="0" />
13+
<CustomAction Id="Set_OPT_NO_LTS" Property="OPT_NO_LTS" Value="0" />
14+
<CustomAction Id="Set_OPT_NO_SHAREDFX" Property="OPT_NO_SHAREDFX" Value="0" />
15+
<CustomAction Id="Set_OPT_NO_RUNTIME" Property="OPT_NO_RUNTIME" Value="0" />
16+
<CustomAction Id="Set_OPT_NO_X86" Property="OPT_NO_X86" Value="0" />
17+
<CustomAction Id="Set_OPT_NO_SHARED_CONFIG_CHECK" Property="OPT_NO_SHARED_CONFIG_CHECK" Value="0" />
18+
19+
<InstallExecuteSequence>
20+
<!-- Only set the options to 0 if they weren't already set in the hosting bundle. -->
21+
<!-- First option is to use user input, if they passed any (if they explicitly set an option to the empty string, we convert that to 0 here). -->
22+
<!-- Second option is to use registry values, if present. -->
23+
<!-- Third option is to set the options all to 0, which we do here. -->
24+
<Custom Action="Set_OPT_NO_ANCM" After="AppSearch">NOT OPT_NO_ANCM OR OPT_NO_ANCM=""</Custom>
25+
<Custom Action="Set_OPT_NO_FTS" After="AppSearch">NOT OPT_NO_FTS OR OPT_NO_FTS=""</Custom>
26+
<Custom Action="Set_OPT_NO_LTS" After="AppSearch">NOT OPT_NO_LTS OR OPT_NO_LTS=""</Custom>
27+
<Custom Action="Set_OPT_NO_SHAREDFX" After="AppSearch">NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=""</Custom>
28+
<Custom Action="Set_OPT_NO_RUNTIME" After="AppSearch">NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=""</Custom>
29+
<Custom Action="Set_OPT_NO_X86" After="AppSearch">NOT OPT_NO_X86 OR OPT_NO_X86=""</Custom>
30+
<Custom Action="Set_OPT_NO_SHARED_CONFIG_CHECK" After="AppSearch">NOT OPT_NO_SHARED_CONFIG_CHECK OR OPT_NO_SHARED_CONFIG_CHECK=""</Custom>
31+
</InstallExecuteSequence>
32+
33+
<Feature Id="ProductFeature" Title="HostOptions" Level="1">
34+
<ComponentGroupRef Id="ProductComponents" />
35+
</Feature>
36+
</Product>
37+
38+
<Fragment>
39+
<Directory Id="TARGETDIR" Name="SourceDir">
40+
<Directory Id="ProgramFilesFolder">
41+
<Directory Id="INSTALLFOLDER" Name="dotnet">
42+
<Directory Id="MM" Name="$(var.MajorVersion).$(var.MinorVersion)" />
43+
</Directory>
44+
</Directory>
45+
</Directory>
46+
</Fragment>
47+
48+
<Fragment>
49+
<ComponentGroup Id="ProductComponents" Directory="MM">
50+
51+
<?ifdef ProductOptionsKey?>
52+
<?undef ProductOptionsKey?>
53+
<?endif?>
54+
55+
<?define ProductOptionsKey=SOFTWARE\Microsoft\dotnet\host\options\$(var.MajorVersion).$(var.MinorVersion)?>
56+
57+
<Component Id="OPT" Guid="*">
58+
<RegistryKey Root="HKLM" Key="$(var.ProductOptionsKey)">
59+
<RegistryValue Name="OPT_NO_ANCM" Type="integer" Value="[OPT_NO_ANCM]" KeyPath="yes" />
60+
<RegistryValue Name="OPT_NO_FTS" Type="integer" Value="[OPT_NO_FTS]" />
61+
<RegistryValue Name="OPT_NO_LTS" Type="integer" Value="[OPT_NO_LTS]" />
62+
<RegistryValue Name="OPT_NO_SHAREDFX" Type="integer" Value="[OPT_NO_SHAREDFX]" />
63+
<RegistryValue Name="OPT_NO_RUNTIME" Type="integer" Value="[OPT_NO_RUNTIME]" />
64+
<RegistryValue Name="OPT_NO_X86" Type="integer" Value="[OPT_NO_X86]" />
65+
<RegistryValue Name="OPT_NO_SHARED_CONFIG_CHECK" Type="integer" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
66+
</RegistryKey>
67+
</Component>
68+
</ComponentGroup>
69+
</Fragment>
70+
</Wix>

src/Installers/Windows/SharedFrameworkLib/Library.wxs

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
<?undef DotNetHome?>
1212
<?endif?>
1313
<?if $(var.Platform)=x86?>
14-
<?define SharedFrameworkInstallCondition=(NOT OPT_NO_SHAREDFX) AND (NOT OPT_NO_X86)?>
14+
<!-- These variables could be unset at this point, which we explicitly treat as 'false' -->
15+
<?define SharedFrameworkInstallCondition=(NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX="0") AND (NOT OPT_NO_X86 OR OPT_NO_X86="0")?>
1516
<?define DotNetHome=DOTNETHOME_X86?>
1617
<?elseif $(var.Platform)=x64?>
17-
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX)?>
18+
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX="0")?>
1819
<?define DotNetHome=DOTNETHOME_X64?>
1920
<?elseif $(var.Platform)=arm64?>
20-
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX)?>
21+
<?define SharedFrameworkInstallCondition=VersionNT64 AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX="0")?>
2122
<?define DotNetHome=DOTNETHOME_ARM64?>
2223
<?endif?>
2324

src/Installers/Windows/WindowsHostingBundle/ANCM.wxs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@
44
<PackageGroup Id="PG_ANCM">
55
<RollbackBoundary Id="RB_ANCM" />
66

7+
<!-- OPT_NO_ANCM could be unset at this point, which we explicitly treat as 'false' -->
78
<MsiPackage Id="AspNetCoreModuleV2_x86" SourceFile="$(var.AspNetCoreModuleV2_x86.TargetPath)"
89
Name="$(var.AspNetCoreModuleV2_x86.TargetFileName)"
910
Compressed="yes"
1011
Vital="yes"
1112
Visible="no"
12-
InstallCondition="NOT VersionNT64 AND (VersionNT &gt;= v6.1) AND (IISCoreWebEngineInstalled_x86=1) AND (IISW3SVCInstalled_x86=1) AND (NOT OPT_NO_ANCM)">
13+
InstallCondition="NOT VersionNT64 AND (VersionNT &gt;= v6.1) AND (IISCoreWebEngineInstalled_x86=1) AND (IISW3SVCInstalled_x86=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
1314
<MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
1415
</MsiPackage>
1516

17+
<!-- OPT_NO_SHARED_CONFIG_CHECK could be unset at this point, which we explicitly treat as 'false' -->
1618
<MsiPackage Id="AspNetCoreModuleV2_x64" SourceFile="$(var.AspNetCoreModuleV2_x64.TargetPath)"
1719
Name="$(var.AspNetCoreModuleV2_x64.TargetFileName)"
1820
Compressed="yes"
1921
Vital="yes"
2022
Visible="no"
21-
InstallCondition="VersionNT64 AND (VersionNT64 &gt;= v6.1) AND (IISCoreWebEngineInstalled_x64=1) AND (IISW3SVCInstalled_x64=1) AND (NOT OPT_NO_ANCM)">
23+
InstallCondition="VersionNT64 AND (VersionNT64 &gt;= v6.1) AND (IISCoreWebEngineInstalled_x64=1) AND (IISW3SVCInstalled_x64=1) AND (NOT OPT_NO_ANCM OR OPT_NO_ANCM=&quot;0&quot;)">
2224
<MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]" />
2325
</MsiPackage>
2426
</PackageGroup>

src/Installers/Windows/WindowsHostingBundle/Bundle.wxs

+38-7
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,35 @@
5757
<!-- Bundle variables -->
5858
<Variable Name="BundleNameShort" Value="$(var.BundleNameShort)"/>
5959
<Variable Name="BundleNameSub" Value="$(var.BundleNameSub)"/>
60-
<Variable Name="OPT_NO_ANCM" Value="0" bal:Overridable="yes"/>
61-
<Variable Name="OPT_NO_FTS" Value="0" bal:Overridable="yes"/>
62-
<Variable Name="OPT_NO_LTS" Value="0" bal:Overridable="yes"/>
63-
<Variable Name="OPT_NO_SHAREDFX" Value="0" bal:Overridable="yes"/>
64-
<Variable Name="OPT_NO_RUNTIME" Value="0" bal:Overridable="yes"/>
65-
<Variable Name="OPT_NO_X86" Value="0" bal:Overridable="yes"/>
66-
<Variable Name="OPT_NO_SHARED_CONFIG_CHECK" Value="0" bal:Overridable="yes" />
60+
<Variable Name="OPT_NO_ANCM" bal:Overridable="yes"/>
61+
<Variable Name="OPT_NO_FTS" bal:Overridable="yes"/>
62+
<Variable Name="OPT_NO_LTS" bal:Overridable="yes"/>
63+
<Variable Name="OPT_NO_SHAREDFX" bal:Overridable="yes"/>
64+
<Variable Name="OPT_NO_RUNTIME" bal:Overridable="yes"/>
65+
<Variable Name="OPT_NO_X86" bal:Overridable="yes"/>
66+
<Variable Name="OPT_NO_SHARED_CONFIG_CHECK" bal:Overridable="yes" />
67+
68+
<!-- Use values from the registry for switches, if the registry values are set & the user hasn't passed any switches from the command line -->
69+
70+
<?define Options=OPT_NO_ANCM;OPT_NO_FTS;OPT_NO_LTS;OPT_NO_SHAREDFX;OPT_NO_RUNTIME;OPT_NO_X86;OPT_NO_SHARED_CONFIG_CHECK ?>
71+
<?define RegistrySeachCondition="NOT (OPT_NO_ANCM OR OPT_NO_ANCM=0 OR OPT_NO_FTS OR OPT_NO_FTS=0 OR OPT_NO_LTS OR OPT_NO_LTS=0 OR OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=0 OR OPT_NO_RUNTIME OR OPT_NO_RUNTIME=0 OR OPT_NO_X86 OR OPT_NO_X86=0 OR OPT_NO_SHARED_CONFIG_CHECK OR OPT_NO_SHARED_CONFIG_CHECK=0)" ?>
72+
73+
<?foreach Option in $(var.Options) ?>
74+
<util:RegistrySearch Id="$(var.Option)_should_be_set"
75+
Condition="$(var.RegistrySeachCondition)"
76+
Root="HKLM"
77+
Key="Software\Microsoft\dotnet\host\options\$(var.MajorVersion).$(var.MinorVersion)"
78+
Value="$(var.Option)"
79+
Result="exists"
80+
Variable="$(var.Option)_Exists"/>
81+
82+
<util:RegistrySearch Condition="$(var.Option)_Exists"
83+
After="$(var.Option)_should_be_set"
84+
Root="HKLM" Key="Software\Microsoft\dotnet\host\options\$(var.MajorVersion).$(var.MinorVersion)"
85+
Value="$(var.Option)"
86+
Variable="$(var.Option)"
87+
Result="value" />
88+
<?endforeach?>
6789

6890
<!-- These variables control the state of conditional UI text elements.
6991
They are disabled by default and enabled based on whether or not we detect that IIS is installed -->
@@ -73,6 +95,15 @@
7395
<Variable Name="ModifyNoIISState" Value="disable"/>
7496

7597
<Chain ParallelCache="yes">
98+
<MsiPackage SourceFile="$(var.HostOptions.TargetPath)">
99+
<MsiProperty Name="OPT_NO_ANCM" Value="[OPT_NO_ANCM]"/>
100+
<MsiProperty Name="OPT_NO_FTS" Value="[OPT_NO_FTS]"/>
101+
<MsiProperty Name="OPT_NO_LTS" Value="[OPT_NO_LTS]"/>
102+
<MsiProperty Name="OPT_NO_SHAREDFX" Value="[OPT_NO_SHAREDFX]"/>
103+
<MsiProperty Name="OPT_NO_RUNTIME" Value="[OPT_NO_RUNTIME]"/>
104+
<MsiProperty Name="OPT_NO_X86" Value="[OPT_NO_X86]"/>
105+
<MsiProperty Name="OPT_NO_SHARED_CONFIG_CHECK" Value="[OPT_NO_SHARED_CONFIG_CHECK]"/>
106+
</MsiPackage>
76107
<PackageGroupRef Id="PG_ANCM" />
77108
<PackageGroupRef Id="PG_DOTNET_REDIST_LTS_BUNDLE" />
78109
<!--<PackageGroupRef Id="PG_DOTNET_REDIST_FTS_BUNDLE" />-->

src/Installers/Windows/WindowsHostingBundle/DotNetCore.wxs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
<PackageGroup Id="PG_DOTNET_REDIST_LTS_BUNDLE">
55
<RollbackBoundary Id="RB_DOTNET_REDIST_LTS_BUNDLE" />
66

7+
<!-- OPT_NO_RUNTIME could be unset at this point, which we explicitly treat as 'false' -->
78
<ExePackage Id="DotNetRedistLts_x64" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx64)"
89
Name="$(var.DotNetRedistLtsInstallerx64)"
910
Compressed="yes"
1011
Vital="yes"
11-
InstallCondition="VersionNT64 AND (NOT OPT_NO_RUNTIME)"
12+
InstallCondition="VersionNT64 AND (NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;)"
1213
InstallCommand="/quiet /norestart"
1314
RepairCommand="/quiet /repair"
1415
Permanent="yes"
1516
DetectCondition="DotNetRedistLtsProductVersion_x64 = v$(var.DotNetRedistLtsInstallerProductVersionx64)">
1617
</ExePackage>
1718

19+
<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
1820
<ExePackage Id="DotNetRedistLts_x86" SourceFile="$(var.DepsPath)\$(var.DotNetRedistLtsInstallerx86)"
1921
Name="$(var.DotNetRedistLtsInstallerx86)"
2022
Compressed="yes"
2123
Vital="yes"
22-
InstallCondition="(NOT OPT_NO_RUNTIME) AND (NOT OPT_NO_X86)"
24+
InstallCondition="(NOT OPT_NO_RUNTIME OR OPT_NO_RUNTIME=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)"
2325
InstallCommand="/quiet /norestart"
2426
RepairCommand="/quiet /repair"
2527
Permanent="yes"

src/Installers/Windows/WindowsHostingBundle/SharedFramework.wxs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@
44
<PackageGroup Id="PG_SHAREDFX_REDIST_BUNDLE">
55
<RollbackBoundary Id="RB_SHAREDFX_REDIST_BUNDLE" />
66

7+
<!-- OPT_NO_SHAREDFX could be unset at this point, which we explicitly treat as 'false' -->
78
<ExePackage Id="SharedFxRedist_x64" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx64)"
89
Name="$(var.SharedFxRedistInstallerx64)"
910
Compressed="yes"
1011
Vital="yes"
11-
InstallCondition="VersionNT64 AND (NOT OPT_NO_SHAREDFX)"
12+
InstallCondition="VersionNT64 AND (NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=&quot;0&quot;)"
1213
InstallCommand="/quiet /norestart"
1314
RepairCommand="/quiet /repair"
1415
Permanent="yes"
1516
DetectCondition="SharedFxRedistProductVersion_x64 = v$(var.SharedFxInstallerProductVersionx64)">
1617
</ExePackage>
1718

19+
<!-- OPT_NO_X86 could be unset at this point, which we explicitly treat as 'false' -->
1820
<ExePackage Id="SharedFxRedist_x86" SourceFile="$(var.InstallersOutputPath)\$(var.SharedFxRedistInstallerx86)"
1921
Name="$(var.SharedFxRedistInstallerx86)"
2022
Compressed="yes"
2123
Vital="yes"
22-
InstallCondition="(NOT OPT_NO_SHAREDFX) AND (NOT OPT_NO_X86)"
24+
InstallCondition="(NOT OPT_NO_SHAREDFX OR OPT_NO_SHAREDFX=&quot;0&quot;) AND (NOT OPT_NO_X86 OR OPT_NO_X86=&quot;0&quot;)"
2325
InstallCommand="/quiet /norestart"
2426
RepairCommand="/quiet /repair"
2527
Permanent="yes"

src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj

+8
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
Private="false"
5959
ReferenceOutputAssembly="false"
6060
SkipGetTargetFrameworkProperties="true" />
61+
<ProjectReference Include="..\HostOptions\HostOptions.wixproj">
62+
<Name>HostOptions</Name>
63+
<Project>20248cd1-c5aa-4f42-ad88-bc260d64deea</Project>
64+
<Private>True</Private>
65+
<DoNotHarvest>True</DoNotHarvest>
66+
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
67+
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
68+
</ProjectReference>
6169
</ItemGroup>
6270

6371
<Import Project="Product.targets" />

src/Installers/Windows/Wix.props

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
<PropertyGroup>
1818
<DefineSolutionProperties>false</DefineSolutionProperties>
19+
<HostOptionsName>WindowsServerHostingBundleOptions</HostOptionsName>
1920

2021
<!-- Namespace used to generate stable UUID3 GUIDs for MSI ProductCode, etc. DO NOT CHANGE THESE. -->
2122
<HostingBundleNamespaceGuid>E1FD1271-E0F0-4B8B-B4BE-01F2EBA58F4E</HostingBundleNamespaceGuid>

src/Installers/Windows/Wix.targets

+9-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@
4545
<Target Name="GenerateGUIDs" BeforeTargets="BeforeBuild" DependsOnTargets="_GeneratePackageGuids;_GenerateBundleGuids" Condition=" '$(DisableGuidGeneration)' != 'true' " />
4646

4747
<Target Name="_GeneratePackageGuids" Condition="'$(OutputType)' == 'package'">
48-
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(GuidInputs)">
48+
<GenerateGuid Condition="'$(OutputName)' != '$(HostOptionsName)'" NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(GuidInputs)">
4949
<Output TaskParameter="Guid" PropertyName="ProductCode" />
5050
</GenerateGuid>
51-
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(GuidInputs);$(OutputType)">
51+
<GenerateGuid Condition="'$(OutputName)' != '$(HostOptionsName)'" NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(GuidInputs);$(OutputType)">
52+
<Output TaskParameter="Guid" PropertyName="UpgradeCode" />
53+
</GenerateGuid>
54+
55+
<GenerateGuid Condition="'$(OutputName)' == '$(HostOptionsName)'" NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(Version)">
56+
<Output TaskParameter="Guid" PropertyName="ProductCode" />
57+
</GenerateGuid>
58+
<GenerateGuid Condition="'$(OutputName)' == '$(HostOptionsName)'" NamespaceGuid="$(NamespaceGuid)" Values="$(ProductNameShort);$(AspNetCoreMajorMinorVersion);$(OutputType)">
5259
<Output TaskParameter="Guid" PropertyName="UpgradeCode" />
5360
</GenerateGuid>
5461

0 commit comments

Comments
 (0)