删除"添加或删除程序"中的"更改"和"修复"按钮

use*_*023 22 wix

我创建了一个Wix安装程序并将其打包在一个引导程序中.

当我执行引导程序时,它在注册表中创建以下条目:

alt text http://n2.nabble.com/file/n4011693/Up.jpg

当我运行引导程序时,它安装得很好,当我运行添加/删除程序时,它会显示"更改"按钮和"修复"按钮.我的要求是

  • 我希望这两个按钮在其他应用程序中像"更改/修复"一样
  • 当我选择此按钮时,我希望我的引导程序(setup.exe)运行而不是msi

这是我的代码区域:

<Property Id="EXTUNINSTALL" Value="0"/>
<Property Id="UNINSTALLEXE" Value="msiexec.exe"/>

<!-- The Uninstall shortcut target executable & arguments-->
<CustomAction Id="SetUNINSTALLEXE_EXT" Property="UNINSTALLCMD"
                     Value="[INSTALLEREXEDIR][INSTALLEREXE]"/>
<CustomAction Id="SetUNINSTALLARG_EXT"
              Property="UNINSTALLARG"
              Value="/MAINTENANCE /SILENT="SGWLRPFCE"  
                     /LANG="[ProductLanguage]""/>
<CustomAction Id="SetSYSTEMARPCOMPONENT"
              Property="ARPSYSTEMCOMPONENT"
              Value="1"/>

<CustomAction Id="SetUNINSTALLARG"
              Property="UNINSTALLARG"
              Value="/x [ProductCode]"/>
<CustomAction Id="SetUNINSTALLEXE"
              Property="UNINSTALLCMD"
              Value="[SystemFolder]msiexec.exe"/>

<CustomAction Id="SetARPINSTALLLOCATION" Property="ARPINSTALLLOCATION"
         Value="[MAININSTALLERFOLDER]" />

<InstallExecuteSequence>
  <RemoveExistingProducts Before="InstallInitialize" />
  <Custom Action="SetARPINSTALLLOCATION" After="CostFinalize"/>
  <Custom Action="SetUNINSTALLEXE_EXT"
          After="SetARPINSTALLLOCATION"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetUNINSTALLARG_EXT"
          After="SetUNINSTALLEXE_EXT"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetSYSTEMARPCOMPONENT"
          After="SetUNINSTALLARG_EXT"><![CDATA[EXTUNINSTALL=1]]></Custom>
  <Custom Action="SetUNINSTALLARG"
          After="SetSYSTEMARPCOMPONENT"><![CDATA[EXTUNINSTALL=0]]></Custom>
  <Custom Action="SetUNINSTALLEXE"
          After="SetUNINSTALLARG"><![CDATA[EXTUNINSTALL=0]]></Custom>
</InstallExecuteSequence>
Run Code Online (Sandbox Code Playgroud)

Wim*_*nen 43

您可以在wix中设置ARPNOMODIFYARPNOREPAIR属性,这将在"添加/删除程序"列表中禁用产品的"更改"和"修复"选项.(这实际上相当于leppie的答案,但是使用Windows Installer属性而不是直接在注册表中进行攻击是个更好的主意.)

<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> 
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
Run Code Online (Sandbox Code Playgroud)

  • 嗨wcoenen,我的要求不仅是在添加/删除程序中禁用修改和修复,还要将删除按钮显示为更改/删除.当我点击这个按钮时,我想让我的setup.exe工作.Thanx为您的回复.BR.,电视 (2认同)

Rik*_*tel 7

根据@Wim Coenen要禁用删除"添加或删除程序"中的"更改"和"修复"按钮,请设置以下属性.

ARPNOREPAIRARPNOMODIFY

这是禁用"修复和升级"选项的示例代码.

<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" /> 
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
Run Code Online (Sandbox Code Playgroud)


Hen*_*rik 5

对问题第一部分的建议:

“与其他应用程序一样,我希望将这两个按钮作为“更改/修复”之一。

我正在运行Windows 7,唯一接近此选项的地方是一些合并了“卸载/更改”的应用程序。

要完成一个按钮(存在于Wix 3.7中),必须分别如下调整“卸载/更改”而不是“卸载”和“更改”。

<Bundle ...
        DisableModify="button">
Run Code Online (Sandbox Code Playgroud)


lep*_*pie 0

以下是 NSIS 的一些注册表项示例。应该让你朝着正确的方向前进。

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2 "NoModify" 1
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2 "NoRepair" 1
Run Code Online (Sandbox Code Playgroud)