wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
130 stars 24 forks source link

Document how to fail installation on missing or too old VCREDIST #8786

Open forderud opened 1 month ago

forderud commented 1 month ago

User story

Windows installers often require Microsoft Visual C++ Redistributable as a prerequisite. This is unfortunately poorly documented online, which makes it tricky for new installer authors to implement such a check. It would therefore be beneficial with some WiX documentation that explains how to implement a VCREDIST check in a MSI installer.

Proposal

Add new documentation content that explains how to implement a VCREDIST version check in a MSI installer.

Example of how this can be done:

<!-- VC_redist 2015-2022 x64 UpgradeCode from https://stackoverflow.com/questions/35872374/detect-presence-of-vcredist-using-the-upgradecode
     Minimum version obtained by downloading "Visual C++ Redistributable for Visual Studio 2022" (x64) 17.2 from https://my.visualstudio.com/Downloads and checking the EXE file version. -->
<Upgrade Id="36F68A90-239C-34DF-B58C-64B30153CE35">
    <UpgradeVersion OnlyDetect="yes" Property="VCREDIST_X64" Minimum="14.32.31332.0" />
</Upgrade>
<Launch Condition="Installed OR VCREDIST_X64" Message="Microsoft Visual C++ 2015-2022 (x64) Redistributable missing or too old." />

Considerations

No response

barnson commented 1 month ago

We'll review the PR and provide some feedback there.