How can I determine in my deferred synchronous custom action that the user pressed the Cancel button and confirmed setup termination while the custom action was executing?
(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.)
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
How can CA handle user's exit?
Started by
AKO
, Jan 27 2003 08:04
5 replies to this topic
Posted 17 February 2003 - 20:37
You should be able to intercept the cancel with an ExternalUI handler.
Ian Blake
(Currently Unemployed)
(Currently Unemployed)
Posted 26 June 2003 - 15:54
Hi Ian,
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 ?
Regards,
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 ?
Regards,
Kiril
Posted 26 June 2003 - 17:20
I find it very hard to believe that Windows Installer will terminate an installation during the execution of an action. But then again, if it takes really long...
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.
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
We do this by writing External UI that processes a bunch of messages including the progress bar and progress bar text messages.
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.
paracha3
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.
paracha3
Posted 29 June 2003 - 17:27
Certainly, developing of mechanism of External UI may take a lot of code.
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.
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.
Kiril