如何禁用 WiX 工具集上的修复和选项按钮

How to disable Repair and option buttons on WiX toolset

关于这个问题有很多问题,但其中 none 解释了这两行的确切位置:

<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> 
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />

尝试在线搜索文档本身,但没有成功

编辑

我尝试将它们放入我的标签中,但它仍然存在:

您需要将它们放入 Product.wxs 文件的 Product 标签中。

示例:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <!-- TODO: Put your code here. -->
    <Product>

      <!-- Place them here. -->
      <Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
      <Property Id="ARPNOModify" Value="yes" Secure="yes" />

    </Product>
  </Fragment>
</Wix>

在您 运行 您的 MSI 并安装您的应用程序之后,如果您再次执行您的 MSI,您应该看到以下内容 window:

如您所见,程序和功能中的选项也将被禁用。

我今天 运行 遇到了同样的问题,接受的答案没有隐藏选项按钮或禁用我的 WiX 标准 boostrapper 中的修复按钮。

hide/disable WixStandardBootstrapperApplication 中的选项和修复按钮首先添加 BalExtension 命名空间(在您的 Bundle.wxs 顶部):

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">

然后在 BootstrapperApplicationRef 元素中添加 SuppressOptionsUISuppressRepair 属性设置两者至 yes.

<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">

    <bal:WixStandardBootstrapperApplication LicenseFile="YourLicense.rtf"
                                            LogoFile="YourLogo.png"
                                            SuppressOptionsUI="yes"
                                            SuppressRepair="yes" />

</BootstrapperApplicationRef>