最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

WiX Issue detecting newer Visual C++ 2015-2022 Redistributable (x64) - Stack Overflow

programmeradmin0浏览0评论

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 &gt;= 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 &gt;= v14.34.31938"
                   InstallCommand="/install /quiet /norestart"/>
    </PackageGroup>
    ...

on my server 2022 instance the vcruntime140.dll is present

Share Improve this question edited Mar 27 at 22:26 simgineer asked Mar 27 at 21:53 simgineersimgineer 1,9082 gold badges24 silver badges51 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Here 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 &gt;= v14.34.31938) OR (vc14x64RegInstalled AND vc14x64RegVersion &gt;= v14.34.31938)"
       InstallCommand="/install /quiet /norestart"/>
发布评论

评论列表(0)

  1. 暂无评论