【问题标题】:WiX environment component conditionWiX 环境组件条件
【发布时间】:2019-08-21 04:34:11
【问题描述】:

仅在首次安装应用程序时创建环境变量的最佳方法是什么? 使用 NOT Installed 属性条件对我来说并不奏效。

【问题讨论】:

    标签: wix wix3.5


    【解决方案1】:

    自定义操作:您是否为此使用自定义操作?没有必要这样做 (propaganda against custom actions)。 MSI 中有内置功能可以更新环境变量。

    WiXUpdating the Path variable using WiX is simple enough。这是来自 WiX 制造商自己的样本。您需要非常密切注意如何配置它以查看所需的行为。在所有安装模式下测试:installrepairself-repairuninstallpatchmajor upgradeetc...

    来自上述链接的内联示例:

    <Feature Id='Git'>
      <Component Directory='INSTALLFOLDER'>
        <RegistryValue Root='HKLM' Key='Software\Git' Name='InstallFolder' Value='[INSTALLFOLDER]' Type='string' />
        <Environment Id='UpdatePath' Name='PATH' Value='[dir6224ijVLx94XYG2KL6z4YR8qrrs]' Action='set' Part='last' System='yes' />
      </Component>
    

    链接

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-24
      • 1970-01-01
      • 2011-11-25
      • 1970-01-01
      • 2013-01-11
      • 2014-11-04
      相关资源
      最近更新 更多