wix - 如何在安装程序中可靠地检测已安装的 Net Core 3.1.x Windows 桌面运行时版本
问题描述
以下答案建议进行目录搜索以检测已安装的 Net Core 3.1.x Windows 桌面运行时:How to detect net core 3.1 windows desktop app runtime is installed
例如,以下代码检测 32 位 Net Core 桌面运行时的 3.1.4 版本:
<!-- check for 32-bit runtime -->
<util:DirectorySearch
Id="NetCoreDesktopSearch"
Variable="NetCoreDesktopInstalled"
Path="[ProgramFilesFolder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.4"
Result="exists"
/>
这工作了一段时间,但随着最近的更新(可能是 Windows 更新到更高的运行时版本,即版本 3.1.14),似乎有些机器的“3.1.4”文件夹已经消失,而实际的桌面运行时版本为 3.1。 4 保持安装状态(即显示为dotnet --info
)。因此,安装程序可能会尝试再次运行 .Net Core Desktop 3.1.4 安装程序,这又会失败并出现错误0x80070666 - Another version of this product is already installed.
并中止安装。
DirectorySearch
因此不是检测特定版本的可靠方法。
有没有更好的办法?
如果系统上存在较新版本,是否可以指示官方 .Net Core Desktop 安装程序静默成功?
是否有官方认可的方法来检测安装程序中的特定 .Net Core 桌面版本(即注册表搜索)?
解决方案
推荐阅读
- javascript - 切换按钮上的背景颜色(keydown / keycodes)
- http - Http操作,管道模式,url,
- testing - 每次测试后用玩笑重置 Redux 存储
- java - 带有 BrowserMobProxy 的 Selenium ReomteWebDriver 提供空的 HarEntries
- plot - plot_tree 不返回 class_names
- unity3d - 我的 AddForce 方法不起作用或推动 Rigidbody2D
- macros - 如何将宏参数传递给同一宏中的表达式?
- c++ - 当在标头中声明的函数是自定义定义时,C++ 中的未定义符号
- javascript - springboot的跨域配置没有效果吗?
- android - 如何在 Android 上使用 mediastore 访问其他应用程序创建的文件?