Skip to content

Commit f87c75a

Browse files
committed
Fix for #7729 to ensure upgradable bundles
1 parent 9f724f6 commit f87c75a

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

src/Installers/Windows/SharedFrameworkBundle/Bundle.wxs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<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">
3-
<Bundle Name="$(var.BundleName)" Version="$(var.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
3+
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
44
dep:ProviderKey="$(var.BundleProviderKey)">
55
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
66
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=320539"
@@ -10,6 +10,19 @@
1010
LocalizationFile="thm.wxl"/>
1111
</BootstrapperApplicationRef>
1212

13+
<!-- Ensure upgrades from 3.0.0 preview 1, 2, and 3. Conditioned for the 3.0.0 family. -->
14+
<?if $(var.Version)=3.0.0.0?>
15+
<?if $(var.Platform)=x86?>
16+
<RelatedBundle Action="Upgrade" Id="{EC5CFEAE-D169-3A4A-AA09-F446BBC39AD9}"/>
17+
<RelatedBundle Action="Upgrade" Id="{1D6E2BA3-B920-3C74-8F3E-F38E6097A297}"/>
18+
<RelatedBundle Action="Upgrade" Id="{D73B587E-7C85-3418-9B07-6A8469CF7E94}"/>
19+
<?elseif $(var.Platform=x64?>
20+
<RelatedBundle Action="Upgrade" Id="{F5C19B0F-77DF-3353-96D9-3F398FA38CF7}"/>
21+
<RelatedBundle Action="Upgrade" Id="{DFC9DEC7-307D-39B5-AF9C-4E8CE923B1BA}"/>
22+
<RelatedBundle Action="Upgrade" Id="{FDCA5106-C69E-34BB-A3B8-A24ADD0B4769}"/>
23+
<?endif?>
24+
<?endif?>
25+
1326
<!-- Customizations of the default BA -->
1427
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
1528
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />

src/Installers/Windows/WindowsHostingBundle/Bundle.wxs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
33
xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
4-
<Bundle Name="$(var.BundleName)" Version="$(var.Version)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
4+
<Bundle Name="$(var.BundleName)" Version="$(var.BundleVersion)" Manufacturer="Microsoft Corporation" UpgradeCode="$(var.BundleUpgradeCode)"
55
dep:ProviderKey="$(var.BundleProviderKey)">
66
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
77
<bal:WixStandardBootstrapperApplication LicenseUrl="https://go.microsoft.com/fwlink/?LinkId=320539"
@@ -11,6 +11,13 @@
1111
LocalizationFile="thm.wxl"/>
1212
</BootstrapperApplicationRef>
1313

14+
<!-- Ensure upgrades from 3.0.0 preview 1 and 2 (Preview 3 was not shipped). Conditioned for the 3.0.0 family. Hosting bundle simships x86/x64 so there's
15+
a single set of upgrade codes. -->
16+
<?if $(var.Version)=3.0.0.0?>
17+
<RelatedBundle Action="Upgrade" Id="{D8BFC3A1-72B1-36C1-9E5A-49FE36A5563B}"/>
18+
<RelatedBundle Action="Upgrade" Id="{EA47395A-BC9B-3ECC-8229-229BC9528DF6}"/>
19+
<?endif?>
20+
1421
<!-- Customizations of the default BA -->
1522
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
1623
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />

src/Installers/Windows/Wix.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<Project>
22

33
<PropertyGroup>
4+
<!-- Used for generating stable upgrade codes for bundles -->
45
<Version>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion).0</Version>
6+
<!-- Actual upgrade code used in bundles to ensure upgrades withing a version band, e.g. 3.0.0.xxx -->
7+
<BundleVersion>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion).$(_BuildNumberShortDate)</BundleVersion>
58
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
69
<Platform Condition="'$(Platform)' == ''">x64</Platform>
710
<Lang Condition="'$(Lang)' == ''">ENU</Lang>

src/Installers/Windows/Wix.targets

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,18 @@
2626
</Target>
2727

2828
<Target Name="_GenerateBundleGuids" Condition="'$(OutputType)' == 'bundle'">
29-
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(BundleNameShort);$(GuidInputs)">
29+
<!-- Don't need to use the name of the bundle since we have separate namespace GUIDs. The name will also changes based on the milestone and destabalize
30+
the upgrade code. Bundle upgrades pivot on Major.Minor.Patch changes. For example, 3.0.1-preview 1 can upgrade to 3.0.1-preview 8, but 3.0.1
31+
cannot upgrade to 3.0.2 or 3.1. -->
32+
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion);$(Platform)">
3033
<Output TaskParameter="Guid" PropertyName="BundleProviderKey" />
3134
</GenerateGuid>
32-
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(BundleNameShort);$(GuidInputs);$(OutputType)">
35+
<GenerateGuid NamespaceGuid="$(NamespaceGuid)" Values="$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion);$(AspNetCorePatchVersion);Platform)">
3336
<Output TaskParameter="Guid" PropertyName="BundleUpgradeCode" />
3437
</GenerateGuid>
3538

3639
<PropertyGroup>
37-
<DefineConstants>$(DefineConstants);BundleProviderKey=$(BundleProviderKey);BundleUpgradeCode=$(BundleUpgradeCode)</DefineConstants>
40+
<DefineConstants>$(DefineConstants);BundleVersion=$(BundleVersion);BundleProviderKey=$(BundleProviderKey);BundleUpgradeCode=$(BundleUpgradeCode)</DefineConstants>
3841
</PropertyGroup>
3942
</Target>
4043

0 commit comments

Comments
 (0)