Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Visual C++ 2015-2019 Redistributable - 14.24.28127
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Bundle
Name="Example Product"
Version="1.2.3.4"
Manufacturer="John Doe"
Copyright="© 2019 John Doe"
AboutUrl="https://example.com/"
UpgradeCode="01234567-89AB-CDEF-0123-456789ABCDEF"
Condition="VersionNT >= v5.1">
<BootstrapperApplicationRef
Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication
LicenseFile="license.rtf"
ShowVersion="yes"
SuppressOptionsUI="yes" />
</BootstrapperApplicationRef>
<!-- v6.0 Service Pack 2 -->
<bal:Condition Message="This application requires Service Pack 2 for Windows Vista / Server 2008.">
<![CDATA[NOT (VersionNT = v6.0 AND ServicePackLevel < 2)]]>
</bal:Condition>
<!-- v6.1 Service Pack 1 -->
<bal:Condition Message="This application requires Service Pack 1 for Windows 7 / Server 2008 R2.">
<![CDATA[NOT (VersionNT = v6.1 AND ServicePackLevel < 1)]]>
</bal:Condition>
<!-- v6.3 KB2919355 -->
<util:FileSearch
Id="HAL.DLL"
Path="[WindowsFolder]System32\hal.dll"
Result="version"
Variable="NT603HALVER"
Condition="VersionNT = v6.3" />
<bal:Condition Message="This application requires S14 Update (KB2919355) for Windows 8.1 / Server 2012 R2.">
<![CDATA[NOT (VersionNT = v6.3 AND NT603HALVER < v6.3.9600.17031)]]>
</bal:Condition>
<!-- Visual C++ 2015-2019 Redistributable (x64) minimum runtime msi package version -->
<util:ProductSearch
Id="VCRedist2015x64"
Result="version"
Variable="VCRedist2015x64"
UpgradeCode="36F68A90-239C-34DF-B58C-64B30153CE35"
Condition="VersionNT64" />
<!-- Visual C++ 2015-2019 Redistributable (x86) minimum runtime msi package version -->
<util:ProductSearch
Id="VCRedist2015x86"
Result="version"
Variable="VCRedist2015x86"
UpgradeCode="65E5BD06-6392-3027-8C26-853107D3CF1A"
Condition="VersionNT" />
<!-- Visual C++ 2015-2019 Redistributable version -->
<Variable Name="VCRedist2015" Type="version" Value="14.24.28127.4" />
<Chain>
<!-- use heat command to get RemotePayload attributes -->
<!-- example: heat payload vc_redist.x64.exe -o x64.wxs -->
<!-- Visual C++ 2015-2019 Redistributable (x64) - 14.24.28127 -->
<ExePackage
Id="vc_redist.x64.exe"
Name="vc_redist.x64.14.24.28127.4.exe"
DisplayName="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.24.28127"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
InstallCondition="VersionNT64"
DetectCondition="VCRedist2015x64 >= VCRedist2015"
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/3b070396-b7fb-4eee-aa8b-102a23c3e4f4/40EA2955391C9EAE3E35619C4C24B5AAF3D17AEAA6D09424EE9672AA9372AEED/VC_redist.x64.exe"
InstallCommand="/install /quiet /norestart"
RepairCommand="/repair /quiet /norestart"
UninstallCommand="/uninstall /quiet /norestart" >
<RemotePayload
ProductName="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.24.28127"
Description="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.24.28127"
Version="14.24.28127.4"
CertificatePublicKey="6608A9DBA86701156A4C17CE63BA99BE8B932F8D"
CertificateThumbprint="62009AAABDAE749FD47D19150958329BF6FF4B34"
Hash="B87C38D093872D7BE7E191F01107B39C87888A5A"
Size="15060496" />
</ExePackage>
<!-- Visual C++ 2015-2019 Redistributable (x86) - 14.24.28127 -->
<ExePackage
Id="vc_redist.x86.exe"
Name="vc_redist.x86.14.24.28127.4.exe"
DisplayName="Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.24.28127"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="yes"
InstallCondition="VersionNT"
DetectCondition="VCRedist2015x86 >= VCRedist2015"
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/9307e627-aaac-42cb-a32a-a39e166ee8cb/E59AE3E886BD4571A811FE31A47959AE5C40D87C583F786816C60440252CD7EC/VC_redist.x86.exe"
InstallCommand="/install /quiet /norestart"
RepairCommand="/repair /quiet /norestart"
UninstallCommand="/uninstall /quiet /norestart" >
<RemotePayload
ProductName="Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.24.28127"
Description="Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.24.28127"
Version="14.24.28127.4"
CertificatePublicKey="6608A9DBA86701156A4C17CE63BA99BE8B932F8D"
CertificateThumbprint="62009AAABDAE749FD47D19150958329BF6FF4B34"
Hash="AFA5BADCE64EE67290ADD24E0DC3D8210954AC6C"
Size="14364440" />
</ExePackage>
<!-- x86 modules -->
<MsiPackage
Id="X86"
DisplayName="x86 modules"
ForcePerMachine="yes"
Compressed="yes"
SourceFile="x86.msi"
InstallCondition="VersionNT" />
<!-- x64 modules -->
<MsiPackage
Id="X64"
DisplayName="x64 modules"
ForcePerMachine="yes"
Compressed="yes"
SourceFile="x64.msi"
InstallCondition="VersionNT64" />
</Chain>
</Bundle>
</Wix>
@keithyipkw

This comment has been minimized.

Copy link

keithyipkw commented Jan 9, 2020

The condition for x86 should be VersionNT&lt;&gt;VersionNT64. VersionNT is the same as VersionNT64 on x64.

@nathancorvussolis

This comment has been minimized.

Copy link
Owner Author

nathancorvussolis commented Jan 9, 2020

The condition for x86 should be VersionNT&lt;&gt;VersionNT64. VersionNT is the same as VersionNT64 on x64.

You are right if you don't need x86 modules on 64bit Windows.
This sample installs only x86 module on 32bit Windows, and installs x86 and x64 modules on 64bit Windows.

@keithyipkw

This comment has been minimized.

Copy link

keithyipkw commented Jan 9, 2020

The condition for x86 should be VersionNT&lt;&gt;VersionNT64. VersionNT is the same as VersionNT64 on x64.

You are right if you don't need x86 modules on 64bit Windows.
This sample installs only x86 module on 32bit Windows, and installs x86 and x64 modules on 64bit Windows.

I was thinking if InstallCondition="VersionNT" is needed for x86. Then I realize that there are ancient non-NT Windows in the wild which Wix may be able to run on them.

@Coding-Badly

This comment has been minimized.

Copy link

Coding-Badly commented Feb 2, 2020

DownloadUrl="https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe"

...is timestamped 2016-Aug-26. The current version is timestamped 2019-Sep-27. This may be a better choice...

DownloadUrl="https://aka.ms/vs/16/release/vc_redist.x64.exe"

@nathancorvussolis

This comment has been minimized.

Copy link
Owner Author

nathancorvussolis commented Feb 3, 2020

DownloadUrl="https://download.microsoft.com/download/6/A/A/6AA4EDFF-645B-48C5-81CC-ED5963AEAD48/vc_redist.x64.exe"

...is timestamped 2016-Aug-26. The current version is timestamped 2019-Sep-27. This may be a better choice...

DownloadUrl="https://aka.ms/vs/16/release/vc_redist.x64.exe"

Thanks for your comment. Updated.

URL "https://aka.ms/vs/16/release/vc_redist.x64.exe" is redirected to latest vc redist installer.
We must use non-redirected URL to set RemotePayload attributes, instead of redirected URL like that.
See also https://renderdoc.org/vcredist_symbols/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.