Merge pull request #1939 from ellismg/chain-vc-redist
Chain in VC Redist
This commit is contained in:
commit
f757468dde
4 changed files with 113 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
||||||
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
|
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
|
||||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||||
<?include "Variables.wxi" ?>
|
<?include "Variables.wxi" ?>
|
||||||
|
<?include "..\inc\crtvariables.wxi" ?>
|
||||||
|
|
||||||
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
|
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
|
||||||
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
|
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
|
||||||
|
@ -32,6 +33,22 @@
|
||||||
<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">
|
||||||
|
<ExePackage Name="VC_redist.$(var.Platform).exe"
|
||||||
|
DownloadUrl="$(var.Crt_DownloadUrl)"
|
||||||
|
DetectCondition='(VCRedist_KeyExists AND VCRedist_KeyValue >= "v14.0.23506.00")'
|
||||||
|
InstallCommand="/q /norestart"
|
||||||
|
PerMachine="yes"
|
||||||
|
Vital="yes"
|
||||||
|
Permanent="yes"
|
||||||
|
Compressed="no">
|
||||||
|
<RemotePayload CertificatePublicKey="$(var.Crt_CertificatePublicKey)"
|
||||||
|
CertificateThumbprint="$(var.Crt_CertificateThumbprint)"
|
||||||
|
Description="$(var.Crt_Description)"
|
||||||
|
Hash="$(var.Crt_Hash)"
|
||||||
|
ProductName="$(var.Crt_ProductName)"
|
||||||
|
Size="$(var.Crt_Size)"
|
||||||
|
Version="$(var.Crt_Version)" />
|
||||||
|
</ExePackage>
|
||||||
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)">
|
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)">
|
||||||
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
||||||
</MsiPackage>
|
</MsiPackage>
|
||||||
|
@ -45,6 +62,23 @@
|
||||||
</Bundle>
|
</Bundle>
|
||||||
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<util:RegistrySearch
|
||||||
|
Id="VCRedist_KeyExists"
|
||||||
|
Variable="VCRedist_KeyExists"
|
||||||
|
Root="HKLM"
|
||||||
|
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\$(var.Platform)"
|
||||||
|
Value="Version"
|
||||||
|
Win64="no"
|
||||||
|
Result="exists" />
|
||||||
|
<util:RegistrySearch
|
||||||
|
Id="VCRedist_KeyValue"
|
||||||
|
Variable="VCRedist_KeyValue"
|
||||||
|
Root="HKLM"
|
||||||
|
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\$(var.Platform)"
|
||||||
|
Value="Version"
|
||||||
|
Win64="no"
|
||||||
|
Result="value" />
|
||||||
|
|
||||||
<PayloadGroup Id="DotnetCoreBAPayloads">
|
<PayloadGroup Id="DotnetCoreBAPayloads">
|
||||||
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
|
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
|
||||||
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />
|
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />
|
||||||
|
|
25
packaging/windows/inc/crtvariables.wxi
Normal file
25
packaging/windows/inc/crtvariables.wxi
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||||
|
|
||||||
|
<!-- These values were generated by running 'heat payload' against the CRTs downloaded from the fwlinks -->
|
||||||
|
|
||||||
|
<?define Crt_CertificatePublicKey="52868DFCA6E3AF2632389E6C1EE7D0468D3797D0"?>
|
||||||
|
<?define Crt_CertificateThumbprint="3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC"?>
|
||||||
|
<?define Crt_Description="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.23506"?>
|
||||||
|
<?define Crt_ProductName="Microsoft Visual C++ 2015 Redistributable ($(var.Platform)) - 14.0.23506"?>
|
||||||
|
<?define Crt_Version="14.0.23506.0"?>
|
||||||
|
<?define Crt_VersionRegistyKeyValue="v14.0.23506.00"?>
|
||||||
|
|
||||||
|
<?if $(var.Platform)=x86?>
|
||||||
|
<?define Crt_DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615459&clcid=0x409"?>
|
||||||
|
<?define Crt_Hash="17B381D3ADB22F00E4AB47CBD91CE0A5B1CCBC70"?>
|
||||||
|
<?define Crt_Size="13977352"?>
|
||||||
|
<?elseif $(var.Platform)=x64?>
|
||||||
|
<?define Crt_DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615460&clcid=0x409"?>
|
||||||
|
<?define Crt_Hash="9A19A51D1F40CD5CD5ECB6E4E4F978F18DA8212A"?>
|
||||||
|
<?define Crt_Size="14773216"?>
|
||||||
|
<?else?>
|
||||||
|
<?error Invalid Platform ($(var.Platform))?>
|
||||||
|
<?endif?>
|
||||||
|
|
||||||
|
</Include>
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
|
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
|
||||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||||
<?include "Variables.wxi" ?>
|
<?include "Variables.wxi" ?>
|
||||||
|
<?include "..\inc\crtvariables.wxi" ?>
|
||||||
|
|
||||||
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
|
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
|
||||||
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
|
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
|
||||||
|
@ -28,6 +29,22 @@
|
||||||
<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">
|
||||||
|
<ExePackage Name="VC_redist.$(var.Platform).exe"
|
||||||
|
DownloadUrl="$(var.Crt_DownloadUrl)"
|
||||||
|
DetectCondition='(VCRedist_KeyExists AND VCRedist_KeyValue >= "v14.0.23506.00")'
|
||||||
|
InstallCommand="/q /norestart"
|
||||||
|
PerMachine="yes"
|
||||||
|
Vital="yes"
|
||||||
|
Permanent="yes"
|
||||||
|
Compressed="no">
|
||||||
|
<RemotePayload CertificatePublicKey="$(var.Crt_CertificatePublicKey)"
|
||||||
|
CertificateThumbprint="$(var.Crt_CertificateThumbprint)"
|
||||||
|
Description="$(var.Crt_Description)"
|
||||||
|
Hash="$(var.Crt_Hash)"
|
||||||
|
ProductName="$(var.Crt_ProductName)"
|
||||||
|
Size="$(var.Crt_Size)"
|
||||||
|
Version="$(var.Crt_Version)" />
|
||||||
|
</ExePackage>
|
||||||
<MsiPackage SourceFile="$(var.SharedFXMsiSourcePath)">
|
<MsiPackage SourceFile="$(var.SharedFXMsiSourcePath)">
|
||||||
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
|
||||||
</MsiPackage>
|
</MsiPackage>
|
||||||
|
@ -38,6 +55,23 @@
|
||||||
</Bundle>
|
</Bundle>
|
||||||
|
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<util:RegistrySearch
|
||||||
|
Id="VCRedist_KeyExists"
|
||||||
|
Variable="VCRedist_KeyExists"
|
||||||
|
Root="HKLM"
|
||||||
|
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\$(var.Platform)"
|
||||||
|
Value="Version"
|
||||||
|
Win64="no"
|
||||||
|
Result="exists" />
|
||||||
|
<util:RegistrySearch
|
||||||
|
Id="VCRedist_KeyValue"
|
||||||
|
Variable="VCRedist_KeyValue"
|
||||||
|
Root="HKLM"
|
||||||
|
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\$(var.Platform)"
|
||||||
|
Value="Version"
|
||||||
|
Win64="no"
|
||||||
|
Result="value" />
|
||||||
|
|
||||||
<PayloadGroup Id="DotnetCoreBAPayloads">
|
<PayloadGroup Id="DotnetCoreBAPayloads">
|
||||||
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
|
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
|
||||||
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />
|
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Microsoft.DotNet.Cli.Build.Framework;
|
using Microsoft.DotNet.Cli.Build.Framework;
|
||||||
using Microsoft.Extensions.PlatformAbstractions;
|
using Microsoft.Extensions.PlatformAbstractions;
|
||||||
|
@ -14,11 +15,13 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
{
|
{
|
||||||
private const string ENGINE = "engine.exe";
|
private const string ENGINE = "engine.exe";
|
||||||
|
|
||||||
|
private const string WixVersion = "3.10.2";
|
||||||
|
|
||||||
private static string WixRoot
|
private static string WixRoot
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return Path.Combine(Dirs.Output, "WixTools");
|
return Path.Combine(Dirs.Output, $"WixTools.{WixVersion}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,14 +57,24 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
Directory.CreateDirectory(WixRoot);
|
Directory.CreateDirectory(WixRoot);
|
||||||
|
|
||||||
c.Info("Downloading WixTools..");
|
c.Info("Downloading WixTools..");
|
||||||
// Download Wix version 3.10.2 - https://wix.codeplex.com/releases/view/619491
|
|
||||||
Cmd("powershell", "-NoProfile", "-NoLogo",
|
DownloadFile($"https://dotnetcli.blob.core.windows.net/build/wix/wix.{WixVersion}.zip", Path.Combine(WixRoot, "WixTools.zip"));
|
||||||
$"Invoke-WebRequest -Uri https://wix.codeplex.com/downloads/get/1540241 -Method Get -OutFile {WixRoot}\\WixTools.zip")
|
|
||||||
.Execute()
|
|
||||||
.EnsureSuccessful();
|
|
||||||
|
|
||||||
c.Info("Extracting WixTools..");
|
c.Info("Extracting WixTools..");
|
||||||
ZipFile.ExtractToDirectory($"{WixRoot}\\WixTools.zip", WixRoot);
|
ZipFile.ExtractToDirectory(Path.Combine(WixRoot, "WixTools.zip"), WixRoot);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void DownloadFile(string uri, string destinationPath)
|
||||||
|
{
|
||||||
|
using (var httpClient = new HttpClient())
|
||||||
|
{
|
||||||
|
var getTask = httpClient.GetStreamAsync(uri);
|
||||||
|
|
||||||
|
using (var outStream = File.OpenWrite(destinationPath))
|
||||||
|
{
|
||||||
|
getTask.Result.CopyTo(outStream);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Target]
|
[Target]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue