Merge pull request #1857 from Sridhar-MS/cli-bundle
[WIP]Create dotnet bundle with CLI SDK, SharedFx MSI and Shared Host MSI.
This commit is contained in:
commit
b68068d5a9
6 changed files with 47 additions and 11 deletions
|
@ -10,16 +10,18 @@
|
||||||
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
|
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
|
||||||
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
|
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
<?if $(var.Platform) = x64?>
|
<?if $(var.Platform) = x86?>
|
||||||
<Component Id="SetupRegistry_x86" Directory="TARGETDIR" Win64="no">
|
<Component Id="SetupRegistry_x86" Directory="TARGETDIR" Win64="no">
|
||||||
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\sharedhost\Setup">
|
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\sharedhost\Setup">
|
||||||
<RegistryValue Action="write" Name="Install" Type="integer" Value="1" KeyPath="yes"/>
|
<RegistryValue Action="write" Name="Install" Type="integer" Value="1" KeyPath="yes"/>
|
||||||
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
|
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
|
||||||
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
|
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
|
||||||
</Component>
|
</Component>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,13 @@
|
||||||
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
|
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
|
||||||
|
|
||||||
<Chain DisableSystemRestore="yes" ParallelCache="yes">
|
<Chain DisableSystemRestore="yes" ParallelCache="yes">
|
||||||
<MsiPackage SourceFile="$(var.MsiSourcePath)">
|
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)">
|
||||||
|
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
||||||
|
</MsiPackage>
|
||||||
|
<MsiPackage SourceFile="$(var.SharedFXMsiSourcePath)">
|
||||||
|
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
||||||
|
</MsiPackage>
|
||||||
|
<MsiPackage SourceFile="$(var.SharedHostMsiSourcePath)">
|
||||||
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
||||||
</MsiPackage>
|
</MsiPackage>
|
||||||
</Chain>
|
</Chain>
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)][string]$DotnetMSIFile,
|
[Parameter(Mandatory=$true)][string]$CLISDKMSIFile,
|
||||||
|
[Parameter(Mandatory=$true)][string]$SharedFxMSIFile,
|
||||||
|
[Parameter(Mandatory=$true)][string]$SharedHostMSIFile,
|
||||||
[Parameter(Mandatory=$true)][string]$DotnetBundleOutput,
|
[Parameter(Mandatory=$true)][string]$DotnetBundleOutput,
|
||||||
[Parameter(Mandatory=$true)][string]$WixRoot,
|
[Parameter(Mandatory=$true)][string]$WixRoot,
|
||||||
[Parameter(Mandatory=$true)][string]$DotnetMSIVersion,
|
[Parameter(Mandatory=$true)][string]$DotnetMSIVersion,
|
||||||
|
@ -28,7 +30,9 @@ function RunCandleForBundle
|
||||||
-dBuildVersion="$DotnetMSIVersion" `
|
-dBuildVersion="$DotnetMSIVersion" `
|
||||||
-dDisplayVersion="$DotnetCLIVersion" `
|
-dDisplayVersion="$DotnetCLIVersion" `
|
||||||
-dReleaseSuffix="$ReleaseSuffix" `
|
-dReleaseSuffix="$ReleaseSuffix" `
|
||||||
-dMsiSourcePath="$DotnetMSIFile" `
|
-dCLISDKMsiSourcePath="$CLISDKMSIFile" `
|
||||||
|
-dSharedFXMsiSourcePath="$SharedFxMSIFile" `
|
||||||
|
-dSharedHostMsiSourcePath="$SharedHostMSIFile" `
|
||||||
-arch "$Architecture" `
|
-arch "$Architecture" `
|
||||||
-ext WixBalExtension.dll `
|
-ext WixBalExtension.dll `
|
||||||
-ext WixUtilExtension.dll `
|
-ext WixUtilExtension.dll `
|
||||||
|
@ -73,9 +77,9 @@ function RunLightForBundle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!(Test-Path $DotnetMSIFile))
|
if(!(Test-Path $CLISDKMSIFile))
|
||||||
{
|
{
|
||||||
throw "$DotnetMSIFile not found"
|
throw "$CLISDKMSIFile not found"
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host "Creating dotnet Bundle at $DotnetBundleOutput"
|
Write-Host "Creating dotnet Bundle at $DotnetBundleOutput"
|
||||||
|
@ -103,6 +107,6 @@ if(!(Test-Path $DotnetBundleOutput))
|
||||||
|
|
||||||
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
|
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
|
||||||
|
|
||||||
_ $RepoRoot\test\Installer\testmsi.ps1 @("$DotnetMSIFile")
|
_ $RepoRoot\test\Installer\testmsi.ps1 @("$CLISDKMSIFile")
|
||||||
|
|
||||||
exit $LastExitCode
|
exit $LastExitCode
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
|
||||||
<RegistryValue Action="write" Name="BuildType" Type="string" Value="$(var.BuildType)" />
|
<RegistryValue Action="write" Name="BuildType" Type="string" Value="$(var.BuildType)" />
|
||||||
</RegistryKey>
|
</RegistryKey>
|
||||||
|
|
||||||
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]bin" Part="last" Action="set" System="yes" />
|
|
||||||
</Component>
|
</Component>
|
||||||
</ComponentGroup>
|
</ComponentGroup>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
|
@ -94,9 +94,10 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
[BuildPlatforms(BuildPlatform.Windows)]
|
[BuildPlatforms(BuildPlatform.Windows)]
|
||||||
public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c)
|
public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c)
|
||||||
{
|
{
|
||||||
|
var cliSdkRoot = c.BuildContext.Get<string>("CLISDKRoot");
|
||||||
Cmd("powershell", "-NoProfile", "-NoLogo",
|
Cmd("powershell", "-NoProfile", "-NoLogo",
|
||||||
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"),
|
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"),
|
||||||
Dirs.Stage2, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
cliSdkRoot, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||||
.Execute()
|
.Execute()
|
||||||
.EnsureSuccessful();
|
.EnsureSuccessful();
|
||||||
return c.Success();
|
return c.Success();
|
||||||
|
@ -156,7 +157,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
{
|
{
|
||||||
Cmd("powershell", "-NoProfile", "-NoLogo",
|
Cmd("powershell", "-NoProfile", "-NoLogo",
|
||||||
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatebundle.ps1"),
|
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatebundle.ps1"),
|
||||||
SdkMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
SdkMsi, SharedFrameworkMsi, SharedHostMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||||
.EnvironmentVariable("Stage2Dir", Dirs.Stage2)
|
.EnvironmentVariable("Stage2Dir", Dirs.Stage2)
|
||||||
.Execute()
|
.Execute()
|
||||||
.EnsureSuccessful();
|
.EnsureSuccessful();
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
[Target(nameof(PrepareTargets.Init),
|
[Target(nameof(PrepareTargets.Init),
|
||||||
nameof(PackageTargets.InitPackage),
|
nameof(PackageTargets.InitPackage),
|
||||||
nameof(PackageTargets.GenerateVersionBadge),
|
nameof(PackageTargets.GenerateVersionBadge),
|
||||||
|
nameof(PackageTargets.CopyCLISDKLayout),
|
||||||
nameof(SharedFrameworkTargets.PublishSharedHost),
|
nameof(SharedFrameworkTargets.PublishSharedHost),
|
||||||
nameof(SharedFrameworkTargets.PublishSharedFramework),
|
nameof(SharedFrameworkTargets.PublishSharedFramework),
|
||||||
nameof(PackageTargets.GenerateCompressedFile),
|
nameof(PackageTargets.GenerateCompressedFile),
|
||||||
|
@ -47,6 +48,30 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
return c.Success();
|
return c.Success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Target]
|
||||||
|
public static BuildTargetResult CopyCLISDKLayout(BuildTargetContext c)
|
||||||
|
{
|
||||||
|
var nugetVersion = c.BuildContext.Get<BuildVersion>("BuildVersion").NuGetVersion;
|
||||||
|
var cliSdkRoot = Path.Combine(Dirs.Output, "obj", "clisdk");
|
||||||
|
var cliSdk = Path.Combine(cliSdkRoot, "sdk", nugetVersion);
|
||||||
|
|
||||||
|
if (Directory.Exists(cliSdkRoot))
|
||||||
|
{
|
||||||
|
Directory.Delete(cliSdkRoot, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Directory.CreateDirectory(cliSdk);
|
||||||
|
|
||||||
|
foreach (var file in Directory.GetFiles(Dirs.Stage2, "*", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
string destFile = Path.Combine(cliSdk, Path.GetFileName(file));
|
||||||
|
File.Copy(file, destFile, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
c.BuildContext["CLISDKRoot"] = cliSdkRoot;
|
||||||
|
return c.Success();
|
||||||
|
}
|
||||||
|
|
||||||
[Target(nameof(PackageTargets.GenerateZip), nameof(PackageTargets.GenerateTarBall))]
|
[Target(nameof(PackageTargets.GenerateZip), nameof(PackageTargets.GenerateTarBall))]
|
||||||
public static BuildTargetResult GenerateCompressedFile(BuildTargetContext c)
|
public static BuildTargetResult GenerateCompressedFile(BuildTargetContext c)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue