From 988fe85c199871134839a9f00fb03c2c6f6453f8 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Thu, 31 Mar 2016 10:02:12 -0700 Subject: [PATCH] Fix installer issues - Sign the Sharedfx bundle correctly. - Fix the installer title for SharedFx bundle. Fixes #2100 - Fix the installer title for SharedFx pkg. Fixes #2161 --- packaging/osx/clisdk/Distribution-Template | 2 +- packaging/windows/sharedframework/bundle.wxl | 2 +- scripts/dotnet-cli-build/MsiTargets.cs | 37 ++++++++++++++++---- scripts/dotnet-cli-build/PkgTargets.cs | 7 ++-- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/packaging/osx/clisdk/Distribution-Template b/packaging/osx/clisdk/Distribution-Template index 1eac31cb5..56e311c42 100644 --- a/packaging/osx/clisdk/Distribution-Template +++ b/packaging/osx/clisdk/Distribution-Template @@ -1,6 +1,6 @@ - .NET CLI {VERSION} + .NET CLI {CLISdkNugetVersion} diff --git a/packaging/windows/sharedframework/bundle.wxl b/packaging/windows/sharedframework/bundle.wxl index 2d0aeafd4..7f05329d6 100644 --- a/packaging/windows/sharedframework/bundle.wxl +++ b/packaging/windows/sharedframework/bundle.wxl @@ -1,7 +1,7 @@ [WixBundleName] Setup - Microsoft .Net CLI for Windows + Microsoft .Net Core for Windows You just need a shell, a text editor and 10 minutes of your time. Ready? Set? Let's go! diff --git a/scripts/dotnet-cli-build/MsiTargets.cs b/scripts/dotnet-cli-build/MsiTargets.cs index f71e868b0..06214fc8c 100644 --- a/scripts/dotnet-cli-build/MsiTargets.cs +++ b/scripts/dotnet-cli-build/MsiTargets.cs @@ -32,7 +32,9 @@ namespace Microsoft.DotNet.Cli.Build private static string SharedFrameworkBundle { get; set; } - private static string Engine { get; set; } + private static string SdkEngine { get; set; } + + private static string SharedFrameworkEngine { get; set; } private static string MsiVersion { get; set; } @@ -68,11 +70,12 @@ namespace Microsoft.DotNet.Cli.Build { SdkBundle = c.BuildContext.Get("CombinedFrameworkSDKHostInstallerFile"); SdkMsi = Path.ChangeExtension(SdkBundle, "msi"); - Engine = Path.Combine(Path.GetDirectoryName(SdkBundle), ENGINE); + SdkEngine = GetEngineName(SdkBundle); SharedFrameworkBundle = c.BuildContext.Get("CombinedFrameworkHostInstallerFile"); SharedHostMsi = Path.ChangeExtension(c.BuildContext.Get("SharedHostInstallerFile"), "msi"); SharedFrameworkMsi = Path.ChangeExtension(c.BuildContext.Get("SharedFrameworkInstallerFile"), "msi"); + SharedFrameworkEngine = GetEngineName(SharedFrameworkBundle); var buildVersion = c.BuildContext.Get("BuildVersion"); MsiVersion = buildVersion.GenerateMsiVersion(); @@ -199,9 +202,8 @@ namespace Microsoft.DotNet.Cli.Build [BuildPlatforms(BuildPlatform.Windows)] public static BuildTargetResult ExtractEngineFromBundle(BuildTargetContext c) { - Cmd($"{WixRoot}\\insignia.exe", "-ib", SdkBundle, "-o", Engine) - .Execute() - .EnsureSuccessful(); + ExtractEngineFromBundleHelper(SdkBundle, SdkEngine); + ExtractEngineFromBundleHelper(SharedFrameworkBundle, SharedFrameworkEngine); return c.Success(); } @@ -209,10 +211,31 @@ namespace Microsoft.DotNet.Cli.Build [BuildPlatforms(BuildPlatform.Windows)] public static BuildTargetResult ReattachEngineToBundle(BuildTargetContext c) { - Cmd($"{WixRoot}\\insignia.exe", "-ab", Engine, SdkBundle, "-o", SdkBundle) + ReattachEngineToBundleHelper(SdkBundle, SdkEngine); + ReattachEngineToBundleHelper(SharedFrameworkBundle, SharedFrameworkEngine); + return c.Success(); + } + + private static string GetEngineName(string bundle) + { + var engine = $"{Path.GetFileNameWithoutExtension(bundle)}-{ENGINE}"; + return Path.Combine(Path.GetDirectoryName(bundle), engine); + } + + private static void ExtractEngineFromBundleHelper(string bundle, string engine) + { + Cmd($"{WixRoot}\\insignia.exe", "-ib", bundle, "-o", engine) .Execute() .EnsureSuccessful(); - return c.Success(); + } + + private static void ReattachEngineToBundleHelper(string bundle, string engine) + { + Cmd($"{WixRoot}\\insignia.exe", "-ab", engine, bundle, "-o", bundle) + .Execute() + .EnsureSuccessful(); + + File.Delete(engine); } } } diff --git a/scripts/dotnet-cli-build/PkgTargets.cs b/scripts/dotnet-cli-build/PkgTargets.cs index 99c23cbaf..20ac7b770 100644 --- a/scripts/dotnet-cli-build/PkgTargets.cs +++ b/scripts/dotnet-cli-build/PkgTargets.cs @@ -68,7 +68,8 @@ namespace Microsoft.DotNet.Cli.Build string formattedDistContents = distTemplate.Replace("{SharedFxComponentId}", SharedFxComponentId) .Replace("{SharedHostComponentId}", SharedHostComponentId) - .Replace("{CLISdkComponentId}", CLISdkComponentId); + .Replace("{CLISdkComponentId}", CLISdkComponentId) + .Replace("{CLISdkNugetVersion}", CLISdkNugetVersion); File.WriteAllText(distributionPath, formattedDistContents); Cmd("productbuild", @@ -122,7 +123,9 @@ namespace Microsoft.DotNet.Cli.Build string distributionPath = Path.Combine(PkgsIntermediateDir, "shared-framework-formatted-distribution.xml"); string formattedDistContents = distTemplate.Replace("{SharedFxComponentId}", SharedFxComponentId) - .Replace("{SharedHostComponentId}", SharedHostComponentId); + .Replace("{SharedHostComponentId}", SharedHostComponentId) + .Replace("{SharedFrameworkNugetName}", Monikers.SharedFrameworkName) + .Replace("{SharedFrameworkNugetVersion}", SharedFrameworkNugetVersion); File.WriteAllText(distributionPath, formattedDistContents); Cmd("productbuild",