wix - 静默卸载应用程序的自定义操作对话框 [英] wix - custom action dialogbox on silent uninstall of application

查看:18
本文介绍了wix - 静默卸载应用程序的自定义操作对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以静默方式卸载带有以下标志的 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) 次要升级/补丁:通过小幅升级修补现有安装(首选方法)- Chris Painter 的回答.这也可以大规模"使用.修复损坏的 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 on a large scale with many machines affected). There are some challenges in logistics.

      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 No:如果实例很少,您可以破解本地缓存的 MSI 数据库(基本上与通过补丁发生的相同,只是手动完成.

      4) Dr.No No: If there are few instances you can hack 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)

      抑制失败的自定义操作:当由于失败的自定义操作(与 rouge 对话框相反)而阻止卸载时,您可以求助于接种方法".您可以更新您的包,以便能够通过将特定属性设置为标志的命令行开关来抑制自定义操作:

      Suppress Failing Custom Actions: When uninstall is prevented by failing custom actions (as opposed to rouge dialogs), you could resort to an "inoculation method". You can update your package to be able to suppress custom actions via a command line switch which sets a specific property as a flag:

      msiexec.exe /x {PRODUCT-GUID} SUPPRESSERROR="1"
      

      查看此 WiX 示例,或下面的模型(略有不同,但概念相同):

      See this WiX sample, or the mockup below (slightly different, but the same concept):

      添加条件:

      关于如何将条件自定义操作添加到 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>
      

      使用这种方法,可以通过调用这种自定义的 msiexec.exe 命令来禁止运行所有自定义操作.因此,可以抑制卸载或升级期间有问题的自定义操作.这只是一种应急方法".卸载某些东西.

      With this approach all custom actions can be suppressed from running by invoking this kind of customized msiexec.exe command. Hence problematic custom action during uninstall or upgrade can be suppressed. This is just an "emergency method" to get something uninstalled.

      我想我应该设置条件 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.

      这是一个类似的先前答案:在卸载时禁止自定义操作.

      Here is a similar, previous answer: Suppress custom actions on uninstall.

      一些相似或相关的答案:

      这篇关于wix - 静默卸载应用程序的自定义操作对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆