【问题标题】:Wix Windows 8 Launch ConditionWix Windows 8 启动条件
【发布时间】:2015-08-28 07:01:31
【问题描述】:

我正在开发一个支持 Windows 7 SP1、Windows 8 及更高版本的 Wix 安装程序。我可以使用 Service Pack 1 成功验证 Windows 7,但是我的 Windows 8 启动条件不断失败。我对 Windows 8 的剥离条件是,

<bal:Condition Message="Windows 8 or higher supported...."><![CDATA[Installed OR VersionNT >= 602]]></bal:Condition>

日志条目

[0638:0D20][2015-08-28T07:47:17]i001: Burn v3.9.1208.0, Windows v6.3 (Build 9600: Service Pack 0)
[0638:0D20][2015-08-28T07:47:18]i052: Condition 'Installed OR VersionNT >= 602' evaluates to false.

我是否使用了错误的 windows8 语法或错误的 versionNt 代码?

【问题讨论】:

    标签: wix windows-installer


    【解决方案1】:

    条件必须评估为真才能继续安装,因此不清楚您为什么将 Installed 作为条件的一部分。 Installed 在您的示例中指的是什么?

    另外,您对 VersionNT 使用了错误的语法。您使用的是 Windows Installer 格式,但 Burn 使用了不同的格式:

    http://wixtoolset.org/documentation/manual/v3/bundle/bundle_built_in_variables.html

    如果您不使用正确的属性(取而代之的是 VersionNT64),这也可能很重要。

    【讨论】:

    • Installed 关键字是 Windows Installer 属性,以确保仅在用户安装应用程序而不是删除或修复时检查条件,根据此处的文档,wixtoolset.org/documentation/manual/v3/howtos/…
    • 我了解 Installed 属性 - 我不确定您为什么在 Bundle 中使用它,您似乎是,带有 bal 扩展名,请注意您的链接是指已安装的 Windows Installer不是您正在使用的属性。
    • 所以我试图在我的包中使用 Windows Installer 属性,这是不正确的?我在 Burn 中使用的 VersionNT 变量的格式似乎也不正确,因为它与 MSI 属性 VersionNT 不同。我已经更新了我的启动条件,如下所示,这似乎有效。 = 1 )) 或 VersionNT > v6.1]]>
    【解决方案2】:

    如前所述,Burn 包使用的版本编号与 MSI (Wix documentation here).

    VersionNT - 代表操作系统版本的版本值。结果是一个 与 MSI 属性不同的版本变量 (v#.#.#.#) 'VersionNT' 是一个整数。例如,要在 捆绑条件尝试:“VersionNT > v6.1”。

    VersionNT64 - 版本 如果是 64 位,则表示操作系统版本的值。未定义,如果运行 32位操作系统。结果是一个版本变量 (v#.#.#.#) 它不同于 MSI 属性“VersionNT64”,后者是一个整数。 例如,要在 Bundle 条件中使用此变量,请尝试: “版本NT64 > v6.1”。

    Burn bundle 所需的值在此处列出 (Windows Documentation)

    Operating system Version number
    Windows 11 10.0*
    Windows 10 10.0*
    Windows Server 2022 10.0*
    Windows Server 2019 10.0*
    Windows Server 2016 10.0*
    Windows 8.1 6.3*
    Windows Server 2012 R2 6.3*
    Windows 8 6.2
    Windows Server 2012 6.2
    Windows 7 6.1
    Windows Server 2008 R2 6.1
    Windows Server 2008 6.0
    Windows Vista 6.0
    Windows Server 2003 R2 5.2
    Windows Server 2003 5.2
    Windows XP 64-Bit Edition 5.2
    Windows XP 5.1
    Windows 2000 5.0

    示例用法:

    <!-- Check OS is Win7 (6.1) or Win8.1 (v6.3) or higher - 32bit and 64bit checks -->
    <bal:Condition Message="Required OS is Win7, 8.1 or higher">
      <![CDATA[Installed OR (VersionNT = v6.1) OR (VersionNT >= v6.3) OR (VersionNT64 = v6.1) OR (VersionNT64 >= v6.3)]]>
    </bal:Condition>
    

    【讨论】:

      猜你喜欢
      • 2015-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-10
      相关资源
      最近更新 更多