Chain in VC++ Redist to Bundle

This commit is contained in:
Matt Ellis 2016-03-18 14:39:40 -07:00
parent e957736721
commit ea317f9386
3 changed files with 93 additions and 0 deletions

View file

@ -4,6 +4,7 @@
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include "Variables.wxi" ?>
<?include "..\inc\crtvariables.wxi" ?>
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
@ -32,6 +33,22 @@
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
<Chain DisableSystemRestore="yes" ParallelCache="yes">
<ExePackage Name="VC_redist.$(var.Platform).exe"
DownloadUrl="$(var.Crt_DownloadUrl)"
DetectCondition='(VCRedist_KeyExists AND VCRedist_KeyValue &gt;= "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)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
@ -45,6 +62,23 @@
</Bundle>
<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">
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />

View 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&amp;clcid=0x409"?>
<?define Crt_Hash="17B381D3ADB22F00E4AB47CBD91CE0A5B1CCBC70"?>
<?define Crt_Size="13977352"?>
<?elseif $(var.Platform)=x64?>
<?define Crt_DownloadUrl="http://go.microsoft.com/fwlink/?LinkID=615460&amp;clcid=0x409"?>
<?define Crt_Hash="9A19A51D1F40CD5CD5ECB6E4E4F978F18DA8212A"?>
<?define Crt_Size="14773216"?>
<?else?>
<?error Invalid Platform ($(var.Platform))?>
<?endif?>
</Include>

View file

@ -4,6 +4,7 @@
xmlns:swid="http://schemas.microsoft.com/wix/TagExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?include "Variables.wxi" ?>
<?include "..\inc\crtvariables.wxi" ?>
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
@ -28,6 +29,22 @@
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
<Chain DisableSystemRestore="yes" ParallelCache="yes">
<ExePackage Name="VC_redist.$(var.Platform).exe"
DownloadUrl="$(var.Crt_DownloadUrl)"
DetectCondition='(VCRedist_KeyExists AND VCRedist_KeyValue &gt;= "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)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
@ -38,6 +55,23 @@
</Bundle>
<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">
<Payload Name="thm.xml" Compressed="yes" SourceFile="bundle.thm" />
<Payload Name="thm.wxl" Compressed="yes" SourceFile="bundle.wxl" />