<?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="© 2020 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 minimum runtime msi package version --> | |
<Variable Name="VCRedist2015" Type="version" Value="14.28.29325.0" /> | |
<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.28.29325 --> | |
<ExePackage | |
Id="vc_redist.x64.exe" | |
Name="vc_redist.x64.14.28.29325.2.exe" | |
DisplayName="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.28.29325" | |
Cache="no" | |
Compressed="no" | |
PerMachine="yes" | |
Permanent="yes" | |
InstallCondition="VersionNT64" | |
DetectCondition="VCRedist2015x64 >= VCRedist2015" | |
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/89a3b9df-4a09-492e-8474-8f92c115c51d/B1A32C71A6B7D5978904FB223763263EA5A7EB23B2C44A0D60E90D234AD99178/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.28.29325" | |
Description="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.28.29325" | |
Version="14.28.29325.2" | |
CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" | |
CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" | |
Hash="1786EE165231D491F209FD27B6E3029556AF25BC" | |
Size="14887048" /> | |
</ExePackage> | |
<!-- Visual C++ 2015-2019 Redistributable (x86) - 14.28.29325 --> | |
<ExePackage | |
Id="vc_redist.x86.exe" | |
Name="vc_redist.x86.14.28.29325.2.exe" | |
DisplayName="Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.28.29325" | |
Cache="no" | |
Compressed="no" | |
PerMachine="yes" | |
Permanent="yes" | |
InstallCondition="VersionNT" | |
DetectCondition="VCRedist2015x86 >= VCRedist2015" | |
DownloadUrl="https://download.visualstudio.microsoft.com/download/pr/8ecb9800-52fd-432d-83ee-d6e037e96cc2/50A3E92ADE4C2D8F310A2812D46322459104039B9DEADBD7FDD483B5C697C0C8/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.28.29325" | |
Description="Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.28.29325" | |
Version="14.28.29325.2" | |
CertificatePublicKey="3756E9BBF4461DCD0AA68E0D1FCFFA9CEA47AC18" | |
CertificateThumbprint="2485A7AFA98E178CB8F30C9838346B514AEA4769" | |
Hash="85354326EF8FBE908D9331446B8C8463577C5633" | |
Size="14337656" /> | |
</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> |
This comment has been minimized.
This comment has been minimized.
You are right if you don't need x86 modules on 64bit Windows. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
...is timestamped 2016-Aug-26. The current version is timestamped 2019-Sep-27. This may be a better choice...
|
This comment has been minimized.
This comment has been minimized.
Thanks for your comment. Updated. URL "https://aka.ms/vs/16/release/vc_redist.x64.exe" is redirected to latest vc redist installer. |
This comment has been minimized.
This comment has been minimized.
Do we know what the confidence score on that link is, i.e. how likely is it that MS will decide to put the redistributable somewhere else just because? |
This comment has been minimized.
This comment has been minimized.
No guarantee. |
This comment has been minimized.
This comment has been minimized.
I removed Permanent="yes" from the Redistributable and tried uninstall. They didn't uninstall because VCRedist2015x86 and VCRedist2015x64 were 14.26.28720.0 (instead of 14.26.28720.3), so conditions evaluated false. I changed the VCRedist2015 variable to 14.26.28720.0 and it seems to work. I hope that's a good fix. |
This comment has been minimized.
This comment has been minimized.
Thank you for your comment. It is fixed. |
This comment has been minimized.
The condition for x86 should be
VersionNT<>VersionNT64
. VersionNT is the same as VersionNT64 on x64.