How can CA handle user's exit?
Posted 27 January 2003 - 08:04
(I've written a custom action that installs MTS\COM+ components and it takes rather long time for execution and I need to interrupt the custom action when the user interrupts my setup. Setting some property from ControlEvent for Cancel button doesn't help: the property takes the desired value only when my custom action is terminated.)
Posted 17 February 2003 - 20:37
Posted 26 June 2003 - 15:54
Excuse me, but I don't understand, what do you mean: "be able to intercept the cancel with an ExternalUI"
I have a very long deferred custom action, which runs many different utilities and programs, copies and removes temp files .
I would like to know, if user pressed the cancel button when my custom action is running. And if he canceled it , I want return error code to Installer and start Rollback process.
I am sure that it is feasible, because it perfectly works with all standard actions ( InstallFiles, WriteRegistryValue, etc ).
That is very interestingly what even after an exit from my custom action, Install proceeds, though CleanUp function has been called from CancelSetup dialog.
Any ideas ?
Posted 26 June 2003 - 17:20
Anyway, you can always get a notification on a rollback by writing a Rollback Custom Action. In that CA, you've got to figure out whether the Custom Action happened while executing your CA. For instance, in your main CA set a registry key at the beginning, and remove it at the end.
Posted 27 June 2003 - 02:15
Basically you create a worker thread, that starts the installer session. When user presses CANCEL button, you trap that in your user interface thread and kill the worker thread.
Let me tell you, its a lot more code than you think.
Posted 29 June 2003 - 17:27
But it sounds very strange, because cancellation in SetupProgress dialog looks very natural and simple, when InstallShield standard action is executed.
If I already use the SetupProgress dialog and I able to send to it MsiProcessMessage for progress bar incremention,
it would be very reasonable to enable to stop my custom action, when user has pressed a cancel button.