c# - 启动条件 : Windows OS service pack version with OS bit

标签 c# visual-studio-2010 setup-deployment

对于 Windows 应用程序,我在 VS2010 中创建部署项目。我想添加 Launch Condition 例如:

安装应该开始于:

  • Windows XP 有 Service Pack 3 32 位

    OR

  • Windows XP 有 Service Pack 2 64 位

目前我尝试使用 Condition (VersionNT = "501") AND (ServicePackLevel = "3") 但此条件仅检查 Windows XP 和适用于 32 位 Windows XP 的 Service Pack 版本 3,但是当我在 64 位 Windows XP 上运行时,它给出了我已经给出的消息。

那么如何检查 Windows 版本和 Bit 以及服务包版本?

最佳答案

我通过编写这个启动条件实现了这一点:

((VersionNT = "501") AND (Not VersionNT64) AND (ServicePackLevel = "3")) OR ((VersionNT = "501") AND (VersionNT64) AND (ServicePackLevel = "2"))

VersionNTServicePackLevel 将检查 Windows 操作系统名称和服务包版本。阅读更多 @ https://msdn.microsoft.com/en-us/library/aa370556%28v=vs.85%29.aspx

VersionNT64 表示 64 位操作系统,Not VersionNT64 操作系统是 32 位。阅读更多 @ http://blogs.flexerasoftware.com/installtalk/2010/11/using-msi-launch-conditions-to-prevent-installation-on-unsupported-windows-platforms.html

关于c# - 启动条件 : Windows OS service pack version with OS bit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30352562/

相关文章:

c# - Xamarin 中的 Objective-c 绑定(bind)问题

c# - 从 json 格式对象获取值

c# - 方法Up中的变量动态Sql语句变化

c# - 当观察变量改变时暂停执行?

c# - 我们如何在设置和部署项目中设置产品名称、公司名称等?

c# - 清理非托管内存

c# - 尾递归优化发生在 visual studio 10 x64 调试中但不是在发布中?

visual-studio - Resharper 5 Beta - 转到声明(CTRL + 单击)不起作用

installation - 如何从 .msi 设置中删除 .net 框架启动条件?

google-chrome - 在一个设置中安装 native 应用程序及其相关的 chrome 扩展