InstallShield-2009: Basic MSI: How to run a custom action after user cancels uninstall (rollback)
InstallShield-2009 Premier: Bas开发者_StackOverflow中文版ic msi project:
What to do when I want a custom action to run when user clicks cancel button during uninstall?
I put a custom action (a C# exe which would just show a message box) with
Action Type:
Type: Launch an executable
Location: Stored in the Binary table
Action Parameters:
Source: exe path
Target: a b c (doesn't matter, I don't need it)
Additional Options:
Return Processing: Synchronous (Check exit code)
Run Only During Path Uninstall: unchecked
Respond Options:
In-Script Execution: Rollback Execution in System Context
Executing Scheduling: disabled
Insert into Sequence:
Install UI-Sequence: <Absent from sequence>
Install Execute Sequence: After InstallServices (what should I set here?)
Install Execute Condition: (do I need to set? I left it blank)
but it didn't fire the message box when I canceled the uninstall. How?
You may want to try to tie an event to the Cancel button of the dialog. In the Installation Designer, goto User Interface>Dialog, find SetupProgress and in behavior add an event to the Cancel PushButton. I haven't tried it, but it's worth a shot.
Rollback custom actions should be scheduled before the action they are rolling back. Since you want to handle any rollback, you can schedule the action after InstallInitialize in InstallExecuteSequence.
This way it will always run when the user cancels the installation after it actually started installing.
Please note that rollback custom actions cannot be used when cancelling an install before the process actually starts (the progress bar is shown). For this you would need a control event on that specific Cancel button.
精彩评论