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:
Eric Mellino 2016-03-15 11:23:23 -07:00
commit b68068d5a9
6 changed files with 47 additions and 11 deletions

View file

@ -10,16 +10,18 @@
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
</RegistryKey>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?endif?>
<?if $(var.Platform) = x64?>
<?if $(var.Platform) = x86?>
<Component Id="SetupRegistry_x86" Directory="TARGETDIR" Win64="no">
<RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\sharedhost\Setup">
<RegistryValue Action="write" Name="Install" Type="integer" Value="1" KeyPath="yes"/>
<RegistryValue Action="write" Name="InstallDir" Type="string" Value="[DOTNETHOME]" />
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
</RegistryKey>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
</Component>
<?endif?>

View file

@ -32,7 +32,13 @@
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
<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]" />
</MsiPackage>
</Chain>

View file

@ -2,7 +2,9 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
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]$WixRoot,
[Parameter(Mandatory=$true)][string]$DotnetMSIVersion,
@ -28,7 +30,9 @@ function RunCandleForBundle
-dBuildVersion="$DotnetMSIVersion" `
-dDisplayVersion="$DotnetCLIVersion" `
-dReleaseSuffix="$ReleaseSuffix" `
-dMsiSourcePath="$DotnetMSIFile" `
-dCLISDKMsiSourcePath="$CLISDKMSIFile" `
-dSharedFXMsiSourcePath="$SharedFxMSIFile" `
-dSharedHostMsiSourcePath="$SharedHostMSIFile" `
-arch "$Architecture" `
-ext WixBalExtension.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"
@ -103,6 +107,6 @@ if(!(Test-Path $DotnetBundleOutput))
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
_ $RepoRoot\test\Installer\testmsi.ps1 @("$DotnetMSIFile")
_ $RepoRoot\test\Installer\testmsi.ps1 @("$CLISDKMSIFile")
exit $LastExitCode

View file

@ -23,8 +23,6 @@
<RegistryValue Action="write" Name="Version" Type="string" Value="$(var.Dotnet_ProductVersion)" />
<RegistryValue Action="write" Name="BuildType" Type="string" Value="$(var.BuildType)" />
</RegistryKey>
<Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]bin" Part="last" Action="set" System="yes" />
</Component>
</ComponentGroup>
</Fragment>

View file

@ -94,9 +94,10 @@ namespace Microsoft.DotNet.Cli.Build
[BuildPlatforms(BuildPlatform.Windows)]
public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c)
{
var cliSdkRoot = c.BuildContext.Get<string>("CLISDKRoot");
Cmd("powershell", "-NoProfile", "-NoLogo",
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"),
Dirs.Stage2, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
cliSdkRoot, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
.Execute()
.EnsureSuccessful();
return c.Success();
@ -156,7 +157,7 @@ namespace Microsoft.DotNet.Cli.Build
{
Cmd("powershell", "-NoProfile", "-NoLogo",
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)
.Execute()
.EnsureSuccessful();

View file

@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Cli.Build
[Target(nameof(PrepareTargets.Init),
nameof(PackageTargets.InitPackage),
nameof(PackageTargets.GenerateVersionBadge),
nameof(PackageTargets.CopyCLISDKLayout),
nameof(SharedFrameworkTargets.PublishSharedHost),
nameof(SharedFrameworkTargets.PublishSharedFramework),
nameof(PackageTargets.GenerateCompressedFile),
@ -47,6 +48,30 @@ namespace Microsoft.DotNet.Cli.Build
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))]
public static BuildTargetResult GenerateCompressedFile(BuildTargetContext c)
{