Merge pull request #2163 from Sridhar-MS/installer-fixes
Fix installer issues
This commit is contained in:
commit
389c405ed0
4 changed files with 37 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<installer-gui-script minSpecVersion="1">
|
||||
<title>.NET CLI {VERSION}</title>
|
||||
<title>.NET CLI {CLISdkNugetVersion}</title>
|
||||
<license file="eula.rtf" mime-type="application/rtf" />
|
||||
<background file="dotnetbackground.png" mime-type="image/png"/>
|
||||
<options customize="never" require-scripts="false" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" Language="1033" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Caption">[WixBundleName] Setup</String>
|
||||
<String Id="Title">Microsoft .Net CLI for Windows</String>
|
||||
<String Id="Title">Microsoft .Net Core for Windows</String>
|
||||
<String Id="Motto">You just need a shell, a text editor and 10 minutes of your time.
|
||||
|
||||
Ready? Set? Let's go!</String>
|
||||
|
|
|
@ -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<string>("CombinedFrameworkSDKHostInstallerFile");
|
||||
SdkMsi = Path.ChangeExtension(SdkBundle, "msi");
|
||||
Engine = Path.Combine(Path.GetDirectoryName(SdkBundle), ENGINE);
|
||||
SdkEngine = GetEngineName(SdkBundle);
|
||||
|
||||
SharedFrameworkBundle = c.BuildContext.Get<string>("CombinedFrameworkHostInstallerFile");
|
||||
SharedHostMsi = Path.ChangeExtension(c.BuildContext.Get<string>("SharedHostInstallerFile"), "msi");
|
||||
SharedFrameworkMsi = Path.ChangeExtension(c.BuildContext.Get<string>("SharedFrameworkInstallerFile"), "msi");
|
||||
SharedFrameworkEngine = GetEngineName(SharedFrameworkBundle);
|
||||
|
||||
var buildVersion = c.BuildContext.Get<BuildVersion>("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)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
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();
|
||||
}
|
||||
|
||||
private static void ReattachEngineToBundleHelper(string bundle, string engine)
|
||||
{
|
||||
Cmd($"{WixRoot}\\insignia.exe", "-ab", engine, bundle, "-o", bundle)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
||||
File.Delete(engine);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue