我已经创建了一个Wix安装程序并将其打包在一个引导程序中。
当我执行引导程序时,它在注册表中创建以下条目:
alt text http://n2.nabble.com/file/n4011693/Up.jpg
当我运行引导程序时,它安装得很好,当我运行添加/删除程序时,它会显示“更改”按钮和“修复”按钮。我的要求是
这是我的代码区域:
<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>
答案 0 :(得分:41)
您可以在wix中设置ARPNOMODIFY和ARPNOREPAIR属性,这会在“添加/删除程序”列表中禁用产品的“更改”和“修复”选项。 (这实际上相当于leppie的答案,但最好使用Windows Installer属性而不是直接在注册表中进行攻击。)
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
答案 1 :(得分:6)
根据@Wim Coenen 要禁用在属性下设置的“添加或删除程序”中删除“更改”和“修复”按钮。
ARPNOREPAIR 和 ARPNOMODIFY
这是禁用“修复和升级”选项的示例代码。
<Property Id="ARPNOREPAIR" Value="yes" Secure="yes" />
<Property Id="ARPNOMODIFY" Value="yes" Secure="yes" />
答案 2 :(得分:5)
对问题第一部分的建议:
“我希望这两个按钮与其他应用程序中的”更改/修复“一样”
我正在运行Windows 7,唯一接近此选项的是一些将“卸载/更改”合并在一起的应用程序。
要完成一个按钮(存在于Wix 3.7中)“卸载/更改”而不是“单独卸载”和“更改”,捆绑标记必须按如下方式进行调整。
<Bundle ...
DisableModify="button">
答案 3 :(得分:-1)
以下是NSIS的一些注册表项示例。应该让你朝着正确的方向前进。
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2 "NoModify" 1
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Example2 "NoRepair" 1