We are currently using this to detect the version of vcruntime140. But it does not seem to be working when I install on MS Windows Server 2022 with Visual C++ 2015-2022 (x64) Redistributable. Should I be including registry detection? Is anyone able to share how to detect vcruntime140
w me and/or provide guidance on the best practice? This file detection method is working on our legacy windows 10 environment and we are using WiX 3.14.
<Bundle>
...
<!-- [SystemFolder] = C:\Windows\System32 -->
<util:FileSearch Id="GetVC14X64Exists" Condition="VersionNT64" Variable="vc14x64Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/>
<util:FileSearch Id="GetVC14X64Version" Condition="VersionNT64" Variable="vc14x64Version" Path="[SystemFolder]vcruntime140.dll" Result="version"/>
</Bundle>
<Fragment>
<PackageGroup Id ="vc_redist.modern.x64Pkg">
<ExePackage Id="vc_redist.modern.x64"
DisplayName="Visual C++ 2015-2022 Redistributable x64"
Cache="yes"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Protocol="burn"
Vital="yes"
SourceFile="$(var.ProjectDir)..\..\..\Dependencies\vc14_2015-2022\VC_redist.x64.exe"
DetectCondition="vc14x64Exists AND vc14x64Version >= v14.34.31938"
InstallCommand="/install /quiet /norestart"/>
</PackageGroup>
...
on my server 2022 instance the vcruntime140.dll
is present
We are currently using this to detect the version of vcruntime140. But it does not seem to be working when I install on MS Windows Server 2022 with Visual C++ 2015-2022 (x64) Redistributable. Should I be including registry detection? Is anyone able to share how to detect vcruntime140
w me and/or provide guidance on the best practice? This file detection method is working on our legacy windows 10 environment and we are using WiX 3.14.
<Bundle>
...
<!-- [SystemFolder] = C:\Windows\System32 -->
<util:FileSearch Id="GetVC14X64Exists" Condition="VersionNT64" Variable="vc14x64Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/>
<util:FileSearch Id="GetVC14X64Version" Condition="VersionNT64" Variable="vc14x64Version" Path="[SystemFolder]vcruntime140.dll" Result="version"/>
</Bundle>
<Fragment>
<PackageGroup Id ="vc_redist.modern.x64Pkg">
<ExePackage Id="vc_redist.modern.x64"
DisplayName="Visual C++ 2015-2022 Redistributable x64"
Cache="yes"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Protocol="burn"
Vital="yes"
SourceFile="$(var.ProjectDir)..\..\..\Dependencies\vc14_2015-2022\VC_redist.x64.exe"
DetectCondition="vc14x64Exists AND vc14x64Version >= v14.34.31938"
InstallCommand="/install /quiet /norestart"/>
</PackageGroup>
...
on my server 2022 instance the vcruntime140.dll
is present
1 Answer
Reset to default 0Here is a potential solution I am testing, not clear to me if I should be just check the registry or both registry and file like below:
<util:FileSearch Variable="vc14x64DllExists" Condition="VersionNT64" Path="[SystemFolder]vcruntime140.dll" Result="exists"/>
<util:FileSearch Variable="vc14x64DllVersion" Condition="VersionNT64" Path="[SystemFolder]vcruntime140.dll" Result="version"/>
<util:RegistrySearch Variable="vc14x64RegInstalled" Win64="yes"
Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" Value="Installed" Result="exist"/>
<util:RegistrySearch Variable="vc14x64RegVersion" Win64="yes"
Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" Value="Version" Result="value"/>
...
<PackageGroup Id ="vc_redist.modern.x64Pkg">
<ExePackage Id="vc_redist.modern.x64"
DisplayName="Visual C++ 2015-2022 Redistributable x64"
Cache="yes"
Compressed="yes"
PerMachine="yes"
Permanent="yes"
Protocol="burn"
Vital="yes"
SourceFile="$(var.ProjectDir)..\..\..\Dependencies\vc14_2015-2022\VC_redist.x64.exe"
DetectCondition="(vc14x64DllExists AND vc14x64DllVersion >= v14.34.31938) OR (vc14x64RegInstalled AND vc14x64RegVersion >= v14.34.31938)"
InstallCommand="/install /quiet /norestart"/>