如何检测安装了 net core 3.1 windows 桌面应用程序运行时 [英] How to detect net core 3.1 windows desktop app runtime is installed

查看:94
本文介绍了如何检测安装了 net core 3.1 windows 桌面应用程序运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检测是否安装了 net core 3.1 Windows 桌面应用程序运行时,如果已安装则不运行安装程序.

I am trying to detect if the net core 3.1 windows desktop app runtime is installed and not run the installer if it is.

但是,在安装了 net core 3.1 windows 桌面应用程序运行时的测试系统上,我可以看到安装程序在运行,并且在查看日志后,NetCoreInstalled 评估为 0,即使该目录存在.我怎样才能让它工作?

However on a test system that has net core 3.1 windows desktop app runtime installed I can see the installer run and after looking at the log, NetCoreInstalled, evaluates to 0 even though the directory exists. How can I get this working?

<Fragment>

    <util:FileSearch 
      Id="NetCoreInstalled" 
      Variable="NetCoreInstalled"
      Path="[ProgramFiles64Folder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.0"
      Result="exists" />
    
    <PackageGroup Id="NetCore310x64">


        <ExePackage
					Id="NetCore310x64"
					Cache="no"
					Compressed="yes"
					PerMachine="yes"
					InstallCondition="(VersionNT64) AND (NOT NetCoreInstalled)"
          DetectCondition="NetCoreInstalled"
          InstallCommand="/quiet /passive"
					Vital="yes"
					Permanent="yes"
					SourceFile="..\..\..\Requirements\windowsdesktop-runtime-3.1.0-win-x64.exe"
					Name="Redist\windowsdesktop-runtime-3.1.0-win-x64.exe" />

    </PackageGroup>


  </Fragment>

推荐答案

你想要的是 DirectorySearch,而不是 FileSearch.

You want DirectorySearch, not FileSearch.

这篇关于如何检测安装了 net core 3.1 windows 桌面应用程序运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆