Skip to content

Commit 131cc45

Browse files
authored
Enabling the upgrade of the SDK bundle in a product-band (#530)
* Enabling the 'upgrade' of the SDK bundle in a 'product-band'.
1 parent 77e2c4b commit 131cc45

File tree

6 files changed

+36
-9
lines changed

6 files changed

+36
-9
lines changed

src/core-sdk-tasks/GenerateGuidFromName.cs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public override bool Execute()
2323
return true;
2424
}
2525

26+
// Generate a Version 5 (SHA1 Name Based) Guid from a name.
2627
public static Guid GenerateGuid(string name)
2728
{
2829
// Any fixed GUID will do for a namespace.

src/redist/targets/GenerateMSIs.targets

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<PropertyGroup>
3333
<SdkMSIInstallerFile>$(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkMSIInstallerFile>
3434
<CombinedFrameworkSdkHostMSIInstallerFile>$(ArtifactsShippingPackagesDir)$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostMSIInstallerFile>
35+
<SdkBundleInstallerOutputGuidString>$(ProductBandCombinedHostHostFxrFrameworkSdkName)</SdkBundleInstallerOutputGuidString>
3536

3637
<!--<SdkDebianIntermediateDirectory>$(IntermediateOutputPath)debian/sdk/</SdkDebianIntermediateDirectory>
3738
<LayoutDirectory Condition=" '$(OSName)' == 'ubuntu' OR '$(OSName)' == 'debian' ">$(SdkDebianIntermediateDirectory)debianLayoutDirectory</LayoutDirectory>
@@ -66,7 +67,7 @@
6667
PropertyName="SdkInstallerUpgradeCode" />
6768
</GenerateGuidFromName>
6869

69-
<GenerateGuidFromName Name="$(CombinedFrameworkSdkHostMSIInstallerFile)">
70+
<GenerateGuidFromName Name="$(SdkBundleInstallerOutputGuidString)">
7071
<Output TaskParameter="OutputGuid"
7172
PropertyName="CombinedFrameworkSDKHostInstallerUpgradeCode" />
7273
</GenerateGuidFromName>
@@ -144,6 +145,7 @@
144145
'$(Architecture)' ^
145146
'$(MicrosoftNETCoreAppPackageVersion)' ^
146147
'$(AspNetCoreVersion)' ^
148+
'$(CliProductBandVersion)' ^
147149
-InformationAction Continue " />
148150
</Target>
149151

src/redist/targets/GetRuntimeInformation.targets

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@
4747
<ArtifactNameWithVersionSdk>$(ArtifactNameSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionSdk>
4848
<ArtifactNameWithVersionMSBuildExtensions>dotnet-standard-support-vs2015-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionMSBuildExtensions>
4949
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
50+
<!-- Warning: changing the value "ProductBandCombinedHostHostFxrFrameworkSdkName" can only occur on a product-band boundary [CliProductBandVersion],
51+
Changing "ProductBandCombinedHostHostFxrFrameworkSdkName" mid-product-band will break the upgradablilty of the SDK bundle installer. -->
52+
<ProductBandCombinedHostHostFxrFrameworkSdkName>Dotnet SDK Bundle Installer $(CliProductBandVersion) $(ProductMonikerRid)</ProductBandCombinedHostHostFxrFrameworkSdkName>
5053
<DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdkWithoutHostMonikerRid>$(ArtifactNameCombinedHostHostFxrFrameworkSdk)-$(SdkVersion)-</DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdkWithoutHostMonikerRid>
5154
<DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>$(DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdkWithoutHostMonikerRid)$(HostMonikerRidForFileName)</DistroSpecificArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
52-
</PropertyGroup>
55+
</PropertyGroup>
5356
</Target>
5457
</Project>

src/redist/targets/Versions.targets

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<PropertyGroup>
33
<VersionMajor>3</VersionMajor>
44
<VersionMinor>0</VersionMinor>
5-
<VersionPatch>100</VersionPatch>
5+
<VersionSDKMinor>1</VersionSDKMinor>
6+
<VersionPatch>00</VersionPatch>
67
<ReleaseSuffix Condition=" '$(ReleaseSuffix)' == '' ">preview3</ReleaseSuffix>
78
</PropertyGroup>
89

@@ -27,7 +28,8 @@
2728
<Target Name="SetSdkVersionInfo" DependsOnTargets="GetCoreSdkGitCommitInfo">
2829
<PropertyGroup>
2930
<MajorMinorVersion>$(VersionMajor).$(VersionMinor)</MajorMinorVersion>
30-
<CliVersionNoSuffix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</CliVersionNoSuffix>
31+
<CliProductBandVersion>$(MajorMinorVersion).$(VersionSDKMinor)</CliProductBandVersion>
32+
<CliVersionNoSuffix>$(CliProductBandVersion)$(VersionPatch)</CliVersionNoSuffix>
3133
<CliVersionPrefix>$(CliVersionNoSuffix)-$(ReleaseSuffix)</CliVersionPrefix>
3234
<CliBrandingVersion Condition=" '$(DropSuffix)' != 'true' ">$(CliVersionNoSuffix) - $(ReleaseSuffix)</CliBrandingVersion>
3335
<CliBrandingVersion Condition=" '$(DropSuffix)' == 'true' ">$(CliVersionNoSuffix)</CliBrandingVersion>

src/redist/targets/packaging/windows/clisdk/bundle.wxs

+21-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,27 @@
1010
AboutUrl="https://dotnet.github.io/"
1111
Compressed="yes">
1212

13-
<bal:Condition Message="The installation path for x64 SDK installations: &quot;[DOTNETHOME_X64]&quot; cannot be the same as for x86 SDK installations: &quot;[DOTNETHOME_X64]&quot;">
13+
<bal:Condition Message="The installation path for x64 SDK installations: &quot;[DOTNETHOME_X64]&quot; cannot be the same as for x86 SDK installations: &quot;[DOTNETHOME_X86]&quot;">
1414
WixBundleInstalled OR ((NOT (DOTNETHOME_X64 ~= DOTNETHOME_X86)) OR DOTNETHOMESIMILARITYCHECKOVERRIDE)
1515
</bal:Condition>
16-
16+
17+
<!-- ***** When the product-band version: "3.0.1xx" advances, remove this section ***** -->
18+
<?if $(var.SDKProductBandVersion)=3.0.1?>
19+
<?if $(var.Platform)~=x86?>
20+
<!-- "Preview 1" 3.0.100-preview-009812-win-x86 upgrade-code -->
21+
<RelatedBundle Action="Upgrade" Id="{489A47A1-5D69-51F1-3D54-3F8FE92E0963}"/>
22+
<!-- "Preview 2" 3.0.100-preview-010184-win-x86 upgrade-code -->
23+
<RelatedBundle Action="Upgrade" Id="{C1DD86C1-5FE4-573E-63FF-6BD0F23EBE69}"/>
24+
<?endif?>
25+
<?if $(var.Platform)~=x64?>
26+
<!-- "Preview 1" 3.0.100-preview-009812-win-x64 upgrade-code -->
27+
<RelatedBundle Action="Upgrade" Id="{18D28236-562F-73EB-340C-2B4B3A5347BB}"/>
28+
<!-- "Preview 2" 3.0.100-preview-010184-win-x64 upgrade-code -->
29+
<RelatedBundle Action="Upgrade" Id="{B47FC45A-5547-64E8-CFD1-B4C5CA275757}"/>
30+
<?endif?>
31+
<?endif?>
32+
<!-- ********************************************************************************** -->
33+
1734
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.Foundation">
1835
<bal:WixStandardBootstrapperApplication
1936
LicenseFile="dummyeula.rtf"
@@ -80,7 +97,7 @@
8097
Path="[ProgramFiles64Folder]dotnet"/>
8198

8299
<!--
83-
When installing the SDK bundle to a custom location using the commandline parameters, it is intended that
100+
When installing the SDK bundle to a custom location using the commandline parameters, it is intended, not mandatory, that
84101
both "DOTNETHOME_X86" and "DOTNETHOME_X64" should be used on the commandline and should take this convention:
85102
DOTNETHOME_X86=<InstallFolder>\x86
86103
DOTNETHOME_X64=<InstallFolder>\x64
@@ -91,7 +108,7 @@
91108
<Variable Name="DOTNETHOME_X64" Type="string" Value="[ProgramFiles64Folder]dotnet" bal:Overridable="yes" />
92109
<Variable Name="DOTNETHOME" Type="string" Value="[DOTNETHOME_$(var.PlatformToken)]" bal:Overridable="no" />
93110
<Variable Name="BUNDLEMONIKER" Type="string" Value="$(var.ProductMoniker)" bal:Overridable="no" />
94-
<Variable Name="DOTNETSDKVERSION" Type="string" Value="$(var.DisplayVersion)" bal:Overridable="no" />
111+
<Variable Name="DOTNETSDKVERSION" Type="string" Value="$(var.NugetVersion)" bal:Overridable="no" />
95112
<Variable Name="DOTNETRUNTIMEVERSION" Type="string" Value="$(var.DotNetRuntimeVersion)" bal:Overridable="no" />
96113
<Variable Name="ASPNETCOREVERSION" Type="string" Value="$(var.AspNetCoreVersion)" bal:Overridable="no" />
97114
<Variable Name="WINFORMSANDWPFVERSION" Type="string" Value="$(var.WinFormsAndWpfVersion)" bal:Overridable="no" />

src/redist/targets/packaging/windows/clisdk/generatebundle.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ param(
1818
[Parameter(Mandatory=$true)][string]$UpgradeCode,
1919
[Parameter(Mandatory=$true)][string]$Architecture,
2020
[Parameter(Mandatory=$true)][string]$DotNetRuntimeVersion,
21-
[Parameter(Mandatory=$true)][string]$AspNetCoreVersion
21+
[Parameter(Mandatory=$true)][string]$AspNetCoreVersion,
22+
[Parameter(Mandatory=$true)][string]$SDKProductBandVersion
2223
)
2324

2425
function RunCandleForBundle
@@ -35,6 +36,7 @@ function RunCandleForBundle
3536
-dProductMoniker="$ProductMoniker" `
3637
-dBuildVersion="$DotnetMSIVersion" `
3738
-dDisplayVersion="$DotnetCLIDisplayVersion" `
39+
-dSDKProductBandVersion="$SDKProductBandVersion" `
3840
-dNugetVersion="$DotnetCLINugetVersion" `
3941
-dCLISDKMsiSourcePath="$CLISDKMSIFile" `
4042
-dUpgradeCode="$UpgradeCode" `

0 commit comments

Comments
 (0)