wix - 静默卸载应用程序时的自定义操作对话框 [英] wix - custom action dialogbox on silent uninstall of application
问题描述
我正在尝试以静默方式卸载带有以下标志的 Windows 应用程序:/quiet 和/uninstall,但安装程序当前未禁止显示 CustomAction 对话框.当对话框出现时,用户需要确认(通过按是按钮)以删除所有程序生成的数据.
I am attempting to silently uninstall a windows application with the flags: /quiet and /uninstall but the installer currently does not suppress a CustomAction dialog box. When the dialog box appears, the user needs to confirm (by pressing the yes button) to remove all program-generated data.
有没有办法告诉卸载程序在安静模式下单击是"?
Is there a way to tell the uninstaller to click "yes" on quiet mode?
以下是当前的 wix 代码.
Below is the current wix code.
<!-- Remove app data custom action -->
<CustomAction Id="SetPathToRemove" Property="ShowRemoveFilesDialog" Value="[ApplicationAppDataDir]" />
<CustomAction Id="ShowRemoveFilesDialog" BinaryKey='CustomActionsBinary' DllEntry='ShowDialogRemoveFiles'
Execute='deferred' Return='ignore' Impersonate='no'/>
推荐答案
交叉链接:类似答案和简短版本.还有更老的:我搞砸了,怎么能我卸载了我的程序?
抑制对话框:如果该对话框在没有适当条件的情况下显示,则不可以,您不能完全抑制它,但有很多解决方法.
Suppress Dialog: If that dialog is shown without a proper condition then no, you can not suppress it outright, but there are many workarounds.
修复":有一些修复"不同程度的疯狂"对于失败或卡住的卸载(通常对于失败的卸载,其中自定义操作导致卸载回滚并无法完成 - 无法前进或后退的 catch 22 情况):
"Fixes": There are some "fixes" of varying degrees of "insanity" for failing or stuck uninstalls (generally for the failing ones where custom actions cause the uninstall to roll-back and fail to complete - a catch 22 situation where you can't go forwards or backwards):
1)
MS FixIt:有一个Microsoft FixIt 工具 有时可以让您摆脱卡住的安装(不确定它是否适用于来自自定义操作的对话框).如果你有,请先试试这个一个或几个实例.
2)
次要升级/补丁:通过小幅升级修补现有安装
(首选方法)- 克里斯画家的回答.这也可以大规模"使用.修复损坏的 MSI 卸载序列,然后可以在所有计算机上调用该序列.真正的解决方法(一旦问题出现).2)
Minor Upgrade / Patch:Patch the existing installation with a minor upgrade
(preferred approach) - Chris Painter's answer. This can also be used "large scale" to fix a broken MSI's uninstall sequence which can then be invoked on all machines. The real fix if you like (once the problem is there).3)
转换:Hack 应用转换
,然后在卸载过程中应用(不推荐 - 过于复杂,容易出错).3)
Transform:Hack apply a transform
that is then applied during uninstall (not recommended - too involved for comfort, error prone).4)
Dr.No 没有:如果实例很少,您可以破解本地缓存的 MSI 数据库
(基本上与通过补丁发生的相同,只能手动完成.4)
Dr.No No: If there are few instances you canhack the locally cached MSI database
(basically the same that happens via a patch, only done manually.- 如果您有几台机器(比如要清理 1-5 台机器),就可以工作.
- 支持工作 - 并非没有风险!不推荐.
并且不要删除自定义操作!只需添加一个条件AND 0"即可到违规的自定义操作序列 - 这将阻止自定义操作运行
.
5)
Lunacy:有些使用来自陌生海岸"的工具;- 例如 AutoIt,它模拟击键以消除卡住的对话框.规模不够大,但可能适用于较小的场景.不建议.试试像这样的工具来对付安全软件!不好了!(任何事情都可能发生,它会崩溃——只是时间问题).5)
Lunacy: Some use tools from "stranger shores" - such as AutoIt which simulates keystrokes to dismiss stuck dialogs. Not at all good enough large-scale, but might work for smaller scenarios. Not recommended. Try tools like these against security software! Oh no! (anything can happen, it WILL break - just a matter of time).条件:您不应该显示来自
InstallExecuteSequence
中排序的自定义操作的对话框,尽管您可以使用 UILevel 属性.您可以使用上述方法 1-3 将此类条件添加到 MSI.(NOT UILevel = 2
可以尝试.Level 2 是完全无声运行)Conditions: You should never show a dialog from a custom action sequenced in the
InstallExecuteSequence
, though you can control its display using the UILevel property. You can add such a condition to the MSI using approaches 1-3 above. (NOT UILevel = 2
can be tried. Level 2 is completely silent running)添加条件:
关于如何向
InstallExecuteSequence
添加条件自定义操作的快速模型:Quick mock-up for how to add a conditioned custom action to the
InstallExecuteSequence
:<Property Id="FLAG" Value="1"/> <..> <CustomAction Id='Something' Property='INSTALLFOLDER' Value='[CMDLINE_INSTALLFOLDER]' Execute='firstSequence' /> <..> <InstallExecuteSequence> <Custom Action='Something' Before='AppSearch'>NOT Installed AND FLAG</Custom> </InstallExecuteSequence>
我想我应该使条件
NOT Installed AND FLAG=1"
.没有测试,留在那里的东西.I guess I should make the condition
NOT Installed AND FLAG="1"
. Didn't test that, leaving in what is there.一些类似或相关的答案:
- 使用 CustomAction 卸载 Wix 的问题
- 已删除的程序文件,无法运行卸载
- 我搞砸了,我该怎么办卸载我的程序?
- 如何在卸载时应用 Msi 转换?
- 卸载带有完整 ui 模式条件的 msi(wix 工具集)
- 卸载 MSI-Package 总是给出重启消息
- 无法卸载使用 wix 安装程序安装的应用程序
- 我搞砸了,我该怎么办卸载我的程序?
这篇关于wix - 静默卸载应用程序时的自定义操作对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!