wix - custom action dialogbox on silent uninstall of application

后端 未结 1 810
礼貌的吻别
礼貌的吻别 2020-11-29 14:14

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. Wh

相关标签:
1条回答
  • 2020-11-29 14:36

    Cross-Link: Similar answer. And the older: I screwed up, how can I uninstall my program?


    Suppress Dialog: If that dialog is shown without a proper condition then no, you can not suppress it outright, but there are many workarounds.

    "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: There is a Microsoft FixIt tool that sometimes allows you to get rid of stuck installs (not sure if it applies to dialogs from custom actions). Try this first if you have one or just a few instances.
    • 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) Transform: Hack apply a transform that is then applied during uninstall (not recommended - too involved for comfort, error prone).

    • 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.

      • Works if you got a handful of machines (say 1-5 machines to clean up).
      • Support job - not without risk! Not recommended.
      • And don't delete custom actions! Just add a condition "AND 0" to the offending custom action sequencing - that will stop the custom action from running.
    • 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).

    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)


    Adding Condition:

    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>
    

    I guess I should make the condition NOT Installed AND FLAG="1". Didn't test that, leaving in what is there.


    Some Similar or Related Answer:

    • Problem with Wix uninstall using CustomAction
    • Deleted Program Files, can't run uninstall
    • I screwed up, how can I uninstall my program?
    • How to apply a Msi transform at uninstall?
    • Uninstall msi with full ui mode condition (wix toolset)
    • Uninstalling MSI-Package always gives reboot message
    • Unable to uninstall the application which is installed using wix installer
    • I screwed up, how can I uninstall my program?
    0 讨论(0)
提交回复
热议问题