From aeaced5b630d7349cb97ab626f641856f10b947b Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Thu, 17 Mar 2016 17:54:01 -0700 Subject: [PATCH] Chain the sharedfx and sharedhost MSIs into a single dotnet redist bundle. --- packaging/windows/{ => clisdk}/bundle.thm | 0 packaging/windows/{ => clisdk}/bundle.wxl | 0 packaging/windows/{ => clisdk}/bundle.wxs | 4 +- .../windows/{ => clisdk}/checkbuildtype.wxs | 0 packaging/windows/{ => clisdk}/dotnet.wxs | 0 .../windows/{ => clisdk}/generatebundle.ps1 | 8 +- .../windows/{ => clisdk}/generatemsi.ps1 | 8 +- packaging/windows/{ => clisdk}/provider.wxs | 0 .../windows/{ => clisdk}/registrykeys.wxs | 0 packaging/windows/{ => clisdk}/variables.wxi | 0 .../windows => windows/host}/generatemsi.ps1 | 2 +- .../{host/windows => windows/host}/host.wxs | 0 .../windows => windows/host}/provider.wxs | 0 .../windows => windows/host}/registrykeys.wxs | 0 .../windows => windows/host}/variables.wxi | 0 packaging/windows/sharedframework/bundle.thm | 107 ++++++++++++++++++ packaging/windows/sharedframework/bundle.wxl | 59 ++++++++++ packaging/windows/sharedframework/bundle.wxs | 56 +++++++++ .../sharedframework/generatebundle.ps1 | 107 ++++++++++++++++++ .../sharedframework}/generatemsi.ps1 | 2 +- .../sharedframework}/provider.wxs | 0 .../sharedframework}/registrykeys.wxs | 0 .../sharedframework}/sharedframework.wxs | 0 .../sharedframework}/variables.wxi | 0 scripts/dotnet-cli-build/InstallerTargets.cs | 2 +- scripts/dotnet-cli-build/MsiTargets.cs | 38 ++++++- 26 files changed, 375 insertions(+), 18 deletions(-) rename packaging/windows/{ => clisdk}/bundle.thm (100%) rename packaging/windows/{ => clisdk}/bundle.wxl (100%) rename packaging/windows/{ => clisdk}/bundle.wxs (93%) rename packaging/windows/{ => clisdk}/checkbuildtype.wxs (100%) rename packaging/windows/{ => clisdk}/dotnet.wxs (100%) rename packaging/windows/{ => clisdk}/generatebundle.ps1 (91%) rename packaging/windows/{ => clisdk}/generatemsi.ps1 (92%) rename packaging/windows/{ => clisdk}/provider.wxs (100%) rename packaging/windows/{ => clisdk}/registrykeys.wxs (100%) rename packaging/windows/{ => clisdk}/variables.wxi (100%) rename packaging/{host/windows => windows/host}/generatemsi.ps1 (97%) rename packaging/{host/windows => windows/host}/host.wxs (100%) rename packaging/{host/windows => windows/host}/provider.wxs (100%) rename packaging/{host/windows => windows/host}/registrykeys.wxs (100%) rename packaging/{host/windows => windows/host}/variables.wxi (100%) create mode 100644 packaging/windows/sharedframework/bundle.thm create mode 100644 packaging/windows/sharedframework/bundle.wxl create mode 100644 packaging/windows/sharedframework/bundle.wxs create mode 100644 packaging/windows/sharedframework/generatebundle.ps1 rename packaging/{sharedframework/windows => windows/sharedframework}/generatemsi.ps1 (98%) rename packaging/{sharedframework/windows => windows/sharedframework}/provider.wxs (100%) rename packaging/{sharedframework/windows => windows/sharedframework}/registrykeys.wxs (100%) rename packaging/{sharedframework/windows => windows/sharedframework}/sharedframework.wxs (100%) rename packaging/{sharedframework/windows => windows/sharedframework}/variables.wxi (100%) diff --git a/packaging/windows/bundle.thm b/packaging/windows/clisdk/bundle.thm similarity index 100% rename from packaging/windows/bundle.thm rename to packaging/windows/clisdk/bundle.thm diff --git a/packaging/windows/bundle.wxl b/packaging/windows/clisdk/bundle.wxl similarity index 100% rename from packaging/windows/bundle.wxl rename to packaging/windows/clisdk/bundle.wxl diff --git a/packaging/windows/bundle.wxs b/packaging/windows/clisdk/bundle.wxs similarity index 93% rename from packaging/windows/bundle.wxs rename to packaging/windows/clisdk/bundle.wxs index 664087a99..7b9091c66 100644 --- a/packaging/windows/bundle.wxs +++ b/packaging/windows/clisdk/bundle.wxs @@ -12,7 +12,7 @@ @@ -48,7 +48,7 @@ - + diff --git a/packaging/windows/checkbuildtype.wxs b/packaging/windows/clisdk/checkbuildtype.wxs similarity index 100% rename from packaging/windows/checkbuildtype.wxs rename to packaging/windows/clisdk/checkbuildtype.wxs diff --git a/packaging/windows/dotnet.wxs b/packaging/windows/clisdk/dotnet.wxs similarity index 100% rename from packaging/windows/dotnet.wxs rename to packaging/windows/clisdk/dotnet.wxs diff --git a/packaging/windows/generatebundle.ps1 b/packaging/windows/clisdk/generatebundle.ps1 similarity index 91% rename from packaging/windows/generatebundle.ps1 rename to packaging/windows/clisdk/generatebundle.ps1 index dd73daaaa..2a949962d 100644 --- a/packaging/windows/generatebundle.ps1 +++ b/packaging/windows/clisdk/generatebundle.ps1 @@ -13,8 +13,8 @@ param( [Parameter(Mandatory=$true)][string]$ReleaseSuffix ) -. "$PSScriptRoot\..\..\scripts\common\_common.ps1" -$RepoRoot = Convert-Path "$PSScriptRoot\..\.." +. "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" +$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.." function RunCandleForBundle { @@ -22,7 +22,7 @@ function RunCandleForBundle pushd "$WixRoot" Write-Host Running candle for bundle.. - $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk" .\candle.exe -nologo ` -dDotnetSrc="$inputDir" ` @@ -55,7 +55,7 @@ function RunLightForBundle pushd "$WixRoot" Write-Host Running light for bundle.. - $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk" .\light.exe -nologo ` -cultures:en-us ` diff --git a/packaging/windows/generatemsi.ps1 b/packaging/windows/clisdk/generatemsi.ps1 similarity index 92% rename from packaging/windows/generatemsi.ps1 rename to packaging/windows/clisdk/generatemsi.ps1 index 54a6a9388..5631e1f94 100644 --- a/packaging/windows/generatemsi.ps1 +++ b/packaging/windows/clisdk/generatemsi.ps1 @@ -11,8 +11,8 @@ param( [Parameter(Mandatory=$true)][string]$ReleaseSuffix ) -. "$PSScriptRoot\..\..\scripts\common\_common.ps1" -$RepoRoot = Convert-Path "$PSScriptRoot\..\.." +. "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" +$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.." $InstallFileswsx = "install-files.wxs" $InstallFilesWixobj = "install-files.wixobj" @@ -42,7 +42,7 @@ function RunCandle pushd "$WixRoot" Write-Host Running candle.. - $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk" .\candle.exe -nologo ` -dDotnetSrc="$inputDir" ` @@ -75,7 +75,7 @@ function RunLight Write-Host Running light.. $CabCache = Join-Path $WixRoot "cabcache" - $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk" .\light.exe -nologo -ext WixUIExtension -ext WixDependencyExtension -ext WixUtilExtension ` -cultures:en-us ` diff --git a/packaging/windows/provider.wxs b/packaging/windows/clisdk/provider.wxs similarity index 100% rename from packaging/windows/provider.wxs rename to packaging/windows/clisdk/provider.wxs diff --git a/packaging/windows/registrykeys.wxs b/packaging/windows/clisdk/registrykeys.wxs similarity index 100% rename from packaging/windows/registrykeys.wxs rename to packaging/windows/clisdk/registrykeys.wxs diff --git a/packaging/windows/variables.wxi b/packaging/windows/clisdk/variables.wxi similarity index 100% rename from packaging/windows/variables.wxi rename to packaging/windows/clisdk/variables.wxi diff --git a/packaging/host/windows/generatemsi.ps1 b/packaging/windows/host/generatemsi.ps1 similarity index 97% rename from packaging/host/windows/generatemsi.ps1 rename to packaging/windows/host/generatemsi.ps1 index 124a987e8..ab3ef64e2 100644 --- a/packaging/host/windows/generatemsi.ps1 +++ b/packaging/windows/host/generatemsi.ps1 @@ -20,7 +20,7 @@ function RunCandle pushd "$WixRoot" Write-Host Running candle.. - $AuthWsxRoot = Join-Path $RepoRoot "packaging\host\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\host" .\candle.exe -nologo ` -out "$WixObjRoot\" ` diff --git a/packaging/host/windows/host.wxs b/packaging/windows/host/host.wxs similarity index 100% rename from packaging/host/windows/host.wxs rename to packaging/windows/host/host.wxs diff --git a/packaging/host/windows/provider.wxs b/packaging/windows/host/provider.wxs similarity index 100% rename from packaging/host/windows/provider.wxs rename to packaging/windows/host/provider.wxs diff --git a/packaging/host/windows/registrykeys.wxs b/packaging/windows/host/registrykeys.wxs similarity index 100% rename from packaging/host/windows/registrykeys.wxs rename to packaging/windows/host/registrykeys.wxs diff --git a/packaging/host/windows/variables.wxi b/packaging/windows/host/variables.wxi similarity index 100% rename from packaging/host/windows/variables.wxi rename to packaging/windows/host/variables.wxi diff --git a/packaging/windows/sharedframework/bundle.thm b/packaging/windows/sharedframework/bundle.thm new file mode 100644 index 000000000..16839fa68 --- /dev/null +++ b/packaging/windows/sharedframework/bundle.thm @@ -0,0 +1,107 @@ + + + #(loc.Caption) + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + Segoe UI + + #(loc.Title) + + + + + #(loc.HelpHeader) + #(loc.HelpText) + + + + + + + + v[DisplayVersion] + [ReleaseSuffix] [BuildType] + #(loc.Motto) + + + + #(loc.InstallAcceptCheckbox) + + + + + + + + + #(loc.OptionsHeader) + #(loc.OptionsLocationLabel) + + + + + + + + + #(loc.FilesInUseHeader) + #(loc.FilesInUseLabel) + A + + + + + + + + + + + + + #(loc.ProgressHeader) + #(loc.ProgressLabel) + #(loc.OverallProgressPackageText) + + + + + + + + #(loc.ModifyHeader) + + + + + + + + + #(loc.SuccessHeader) + #(loc.SuccessInstallHeader) + #(loc.SuccessRepairHeader) + #(loc.SuccessUninstallHeader) + + #(loc.SuccessRestartText) + + + + + + + + #(loc.FailureHeader) + #(loc.FailureInstallHeader) + #(loc.FailureUninstallHeader) + #(loc.FailureRepairHeader) + #(loc.FailureHyperlinkLogText) + + #(loc.FailureRestartText) + + + + \ No newline at end of file diff --git a/packaging/windows/sharedframework/bundle.wxl b/packaging/windows/sharedframework/bundle.wxl new file mode 100644 index 000000000..deb315ee4 --- /dev/null +++ b/packaging/windows/sharedframework/bundle.wxl @@ -0,0 +1,59 @@ + + + [WixBundleName] Setup + Microsoft Dotnet CLI for Windows + You just need a shell, a text editor and 10 minutes of your time. + +Ready? Set? Let's go! + Are you sure you want to cancel? + Previous version + Setup Help + /install | /repair | /uninstall | /layout [directory] - installs, repairs, uninstalls or + creates a complete local copy of the bundle in directory. Install is the default. + +/passive | /quiet - displays minimal UI with no prompts or displays no UI and + no prompts. By default UI and all prompts are displayed. + +/norestart - suppress any attempts to restart. By default UI will prompt before restart. +/log log.txt - logs to a specific file. By default a log file is created in %TEMP%. + &Close + I &agree to the license terms and conditions + &Options + &Install + &Close + Setup Options + Install location: + &Browse + &OK + &Cancel + Setup Progress + Processing: + Initializing... + &Cancel + Modify Setup + &Repair + &Uninstall + &Close + Repair Successfully Completed + Uninstall Successfully Completed + Installation Successfully Completed + Setup Successful + &Launch + You must restart your computer before you can use the software. + &Restart + &Close + Setup Failed + Setup Failed + Uninstall Failed + Repair Failed + One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the <a href="#">log file</a>. + You must restart your computer to complete the rollback of the software. + &Restart + &Close + Files In Use + The following applications are using files that need to be updated: + Close the &applications and attempt to restart them. + &Do not close applications. A reboot will be required. + &OK + &Cancel + diff --git a/packaging/windows/sharedframework/bundle.wxs b/packaging/windows/sharedframework/bundle.wxs new file mode 100644 index 000000000..59ae0efd4 --- /dev/null +++ b/packaging/windows/sharedframework/bundle.wxs @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eula.rtf + + + + + diff --git a/packaging/windows/sharedframework/generatebundle.ps1 b/packaging/windows/sharedframework/generatebundle.ps1 new file mode 100644 index 000000000..911349583 --- /dev/null +++ b/packaging/windows/sharedframework/generatebundle.ps1 @@ -0,0 +1,107 @@ +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. + +param( + [Parameter(Mandatory=$true)][string]$SharedFxMSIFile, + [Parameter(Mandatory=$true)][string]$SharedHostMSIFile, + [Parameter(Mandatory=$true)][string]$DotnetBundleOutput, + [Parameter(Mandatory=$true)][string]$WixRoot, + [Parameter(Mandatory=$true)][string]$DotnetMSIVersion, + [Parameter(Mandatory=$true)][string]$DotnetCLIVersion, + [Parameter(Mandatory=$true)][string]$SharedFrameworkNugetName, + [Parameter(Mandatory=$true)][string]$SharedFrameworkNugetVersion, + [Parameter(Mandatory=$true)][string]$SharedFrameworkUpgradeCode, + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$ReleaseSuffix +) + +. "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" +$RepoRoot = Convert-Path "$PSScriptRoot\..\..\.." + +function RunCandleForBundle +{ + $result = $true + pushd "$WixRoot" + + Write-Host Running candle for bundle.. + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\sharedframework" + + .\candle.exe -nologo ` + -dMicrosoftEula="$RepoRoot\packaging\osx\resources\en.lproj\eula.rtf" ` + -dBuildVersion="$DotnetMSIVersion" ` + -dDisplayVersion="$DotnetCLIVersion" ` + -dReleaseSuffix="$ReleaseSuffix" ` + -dSharedFXMsiSourcePath="$SharedFxMSIFile" ` + -dSharedHostMsiSourcePath="$SharedHostMSIFile" ` + -dFrameworkName="$SharedFrameworkNugetName" ` + -dFrameworkDisplayVersion="$SharedFrameworkNugetVersion" ` + -dFrameworkUpgradeCode="$SharedFrameworkUpgradeCode" ` + -arch "$Architecture" ` + -ext WixBalExtension.dll ` + -ext WixUtilExtension.dll ` + -ext WixTagExtension.dll ` + "$AuthWsxRoot\bundle.wxs" | Out-Host + + if($LastExitCode -ne 0) + { + $result = $false + Write-Host "Candle failed with exit code $LastExitCode." + } + + popd + return $result +} + +function RunLightForBundle +{ + $result = $true + pushd "$WixRoot" + + Write-Host Running light for bundle.. + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\sharedframework" + + .\light.exe -nologo ` + -cultures:en-us ` + bundle.wixobj ` + -ext WixBalExtension.dll ` + -ext WixUtilExtension.dll ` + -ext WixTagExtension.dll ` + -b "$AuthWsxRoot" ` + -out $DotnetBundleOutput | Out-Host + + if($LastExitCode -ne 0) + { + $result = $false + Write-Host "Light failed with exit code $LastExitCode." + } + + popd + return $result +} + +Write-Host "Creating shared framework bundle at $DotnetBundleOutput" + +if([string]::IsNullOrEmpty($WixRoot)) +{ + Exit -1 +} + +if(-Not (RunCandleForBundle)) +{ + Exit -1 +} + +if(-Not (RunLightForBundle)) +{ + Exit -1 +} + +if(!(Test-Path $DotnetBundleOutput)) +{ + throw "Unable to create the dotnet bundle." + Exit -1 +} + +Write-Host -ForegroundColor Green "Successfully created shared framework bundle - $DotnetBundleOutput" + +exit $LastExitCode diff --git a/packaging/sharedframework/windows/generatemsi.ps1 b/packaging/windows/sharedframework/generatemsi.ps1 similarity index 98% rename from packaging/sharedframework/windows/generatemsi.ps1 rename to packaging/windows/sharedframework/generatemsi.ps1 index ed78f847d..b8710ab66 100644 --- a/packaging/sharedframework/windows/generatemsi.ps1 +++ b/packaging/windows/sharedframework/generatemsi.ps1 @@ -53,7 +53,7 @@ function RunCandle pushd "$WixRoot" Write-Host Running candle.. - $AuthWsxRoot = Join-Path $RepoRoot "packaging\sharedframework\windows" + $AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\sharedframework" $SharedFrameworkComponentVersion = $SharedFrameworkNugetVersion.Replace('-', '_'); .\candle.exe -nologo ` diff --git a/packaging/sharedframework/windows/provider.wxs b/packaging/windows/sharedframework/provider.wxs similarity index 100% rename from packaging/sharedframework/windows/provider.wxs rename to packaging/windows/sharedframework/provider.wxs diff --git a/packaging/sharedframework/windows/registrykeys.wxs b/packaging/windows/sharedframework/registrykeys.wxs similarity index 100% rename from packaging/sharedframework/windows/registrykeys.wxs rename to packaging/windows/sharedframework/registrykeys.wxs diff --git a/packaging/sharedframework/windows/sharedframework.wxs b/packaging/windows/sharedframework/sharedframework.wxs similarity index 100% rename from packaging/sharedframework/windows/sharedframework.wxs rename to packaging/windows/sharedframework/sharedframework.wxs diff --git a/packaging/sharedframework/windows/variables.wxi b/packaging/windows/sharedframework/variables.wxi similarity index 100% rename from packaging/sharedframework/windows/variables.wxi rename to packaging/windows/sharedframework/variables.wxi diff --git a/scripts/dotnet-cli-build/InstallerTargets.cs b/scripts/dotnet-cli-build/InstallerTargets.cs index fa1d95d0f..7d5a8cba8 100644 --- a/scripts/dotnet-cli-build/InstallerTargets.cs +++ b/scripts/dotnet-cli-build/InstallerTargets.cs @@ -13,7 +13,7 @@ namespace Microsoft.DotNet.Cli.Build public class InstallerTargets { [Target(nameof(MsiTargets.GenerateMsis), - nameof(MsiTargets.GenerateBundle), + nameof(MsiTargets.GenerateBundles), nameof(PkgTargets.GeneratePkgs))]//, //nameof(InstallerTargets.GenerateDebs))] public static BuildTargetResult GenerateInstaller(BuildTargetContext c) diff --git a/scripts/dotnet-cli-build/MsiTargets.cs b/scripts/dotnet-cli-build/MsiTargets.cs index 5d2adf871..3ad834265 100644 --- a/scripts/dotnet-cli-build/MsiTargets.cs +++ b/scripts/dotnet-cli-build/MsiTargets.cs @@ -30,6 +30,8 @@ namespace Microsoft.DotNet.Cli.Build private static string SharedFrameworkMsi { get; set; } + private static string SharedFrameworkBundle { get; set; } + private static string Engine { get; set; } private static string MsiVersion { get; set; } @@ -68,6 +70,7 @@ namespace Microsoft.DotNet.Cli.Build SdkMsi = Path.ChangeExtension(SdkBundle, "msi"); Engine = Path.Combine(Path.GetDirectoryName(SdkBundle), ENGINE); + SharedFrameworkBundle = c.BuildContext.Get("CombinedFrameworkHostInstallerFile"); SharedHostMsi = Path.ChangeExtension(c.BuildContext.Get("SharedHostInstallerFile"), "msi"); SharedFrameworkMsi = Path.ChangeExtension(c.BuildContext.Get("SharedFrameworkInstallerFile"), "msi"); @@ -90,13 +93,22 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } + [Target(nameof(MsiTargets.InitMsi), + nameof(GenerateCliSdkBundle), + nameof(GenerateSharedFxBundle))] + [BuildPlatforms(BuildPlatform.Windows)] + public static BuildTargetResult GenerateBundles(BuildTargetContext c) + { + return c.Success(); + } + [Target] [BuildPlatforms(BuildPlatform.Windows)] public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c) { var cliSdkRoot = c.BuildContext.Get("CLISDKRoot"); Cmd("powershell", "-NoProfile", "-NoLogo", - Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"), + Path.Combine(Dirs.RepoRoot, "packaging", "windows", "clisdk", "generatemsi.ps1"), cliSdkRoot, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel) .Execute() .EnsureSuccessful(); @@ -117,7 +129,7 @@ namespace Microsoft.DotNet.Cli.Build Directory.CreateDirectory(wixObjRoot); Cmd("powershell", "-NoProfile", "-NoLogo", - Path.Combine(Dirs.RepoRoot, "packaging", "host", "windows", "generatemsi.ps1"), + Path.Combine(Dirs.RepoRoot, "packaging", "windows", "host", "generatemsi.ps1"), inputDir, SharedHostMsi, WixRoot, MsiVersion, CliVersion, Arch, wixObjRoot) .Execute() .EnsureSuccessful(); @@ -141,7 +153,7 @@ namespace Microsoft.DotNet.Cli.Build Directory.CreateDirectory(wixObjRoot); Cmd("powershell", "-NoProfile", "-NoLogo", - Path.Combine(Dirs.RepoRoot, "packaging", "sharedframework", "windows", "generatemsi.ps1"), + Path.Combine(Dirs.RepoRoot, "packaging", "windows", "sharedframework", "generatemsi.ps1"), inputDir, SharedFrameworkMsi, WixRoot, MsiVersion, sharedFrameworkNuGetName, sharedFrameworkNuGetVersion, upgradeCode, Arch, wixObjRoot) .Execute() .EnsureSuccessful(); @@ -151,10 +163,10 @@ namespace Microsoft.DotNet.Cli.Build [Target(nameof(MsiTargets.InitMsi))] [BuildPlatforms(BuildPlatform.Windows)] - public static BuildTargetResult GenerateBundle(BuildTargetContext c) + public static BuildTargetResult GenerateCliSdkBundle(BuildTargetContext c) { Cmd("powershell", "-NoProfile", "-NoLogo", - Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatebundle.ps1"), + Path.Combine(Dirs.RepoRoot, "packaging", "windows", "clisdk", "generatebundle.ps1"), SdkMsi, SharedFrameworkMsi, SharedHostMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel) .EnvironmentVariable("Stage2Dir", Dirs.Stage2) .Execute() @@ -162,6 +174,22 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } + [Target(nameof(MsiTargets.InitMsi))] + [BuildPlatforms(BuildPlatform.Windows)] + public static BuildTargetResult GenerateSharedFxBundle(BuildTargetContext c) + { + var sharedFrameworkNuGetName = Monikers.SharedFrameworkName; + var sharedFrameworkNuGetVersion = c.BuildContext.Get("SharedFrameworkNugetVersion"); + var upgradeCode = Utils.GenerateGuidFromName($"{sharedFrameworkNuGetName}-{sharedFrameworkNuGetVersion}-{Arch}-bundle").ToString().ToUpper(); + + Cmd("powershell", "-NoProfile", "-NoLogo", + Path.Combine(Dirs.RepoRoot, "packaging", "windows", "sharedframework", "generatebundle.ps1"), + SharedFrameworkMsi, SharedHostMsi, SharedFrameworkBundle, WixRoot, MsiVersion, CliVersion, sharedFrameworkNuGetName, sharedFrameworkNuGetVersion, upgradeCode, Arch, Channel) + .Execute() + .EnsureSuccessful(); + return c.Success(); + } + [Target(nameof(MsiTargets.InitMsi))] [BuildPlatforms(BuildPlatform.Windows)] public static BuildTargetResult ExtractEngineFromBundle(BuildTargetContext c)