Jump to content


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

How to trigger a CA when user cancels the setup


5 replies to this topic

dio

dio
  • Members
  • 2 posts

Posted 06 September 2005 - 15:05

I want to trigger a CA when user cancels the installation.

I don't want to have immediate CA on button click....

Please tell me if i can do in some other way.

What type of CA should i use?

Where exactly should it be sequenced?

Thanks in advance.



lavocat

lavocat
  • Full Members
  • 158 posts

Posted 07 September 2005 - 11:10

You should use a rollback custom action (deferred action). This kind of CA is triggered when the installation is not successfully completed.

The rollback custom action has to be placed after InstallInitialize and before InstallFinalize and must be sequenced before the action it rolls back if any.

Edited by lavocat, 07 September 2005 - 11:12.


lavocat

lavocat
  • Full Members
  • 158 posts

Posted 07 September 2005 - 11:10

You should use a rollback custom action (deferred action). This kind of CA is triggered when the installation is not successfully completed.

The rollback custom action has to be placed after InstallInitialize and before InstallFinalize and must be sequenced before the action it rolls back if any.

Edited by lavocat, 07 September 2005 - 11:12.


dio

dio
  • Members
  • 2 posts

Posted 08 September 2005 - 11:50


Thanks 4 reply. But still I am not able to get that fixed. I have used

<CustomAction Id="CA_RollbackAction" BinaryKey="CALibrary" DllEntry="RollbackAction" Excute="deferred" />
....
In InstallExecuteSequence i have put
<Custom Action="CA_RollbackAction" Before="InstallFinalize" ></Custom>

Do I need to add any condition for the custom action.

I want this CA to be called when the user cancels the setup or when some problem occurs and cancels the setup.

I am not keeping any other CAs in the InstallExecuteSequence.

I have used a MSGBOX in my CA to check whether it is getting called or not.... But Its not calling the CA.

Thanks,
Dio

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 08 September 2005 - 18:57

Try scheduling the CA after InstallInitialize.

It works like this: Between InstallInitialize and InstallFinalize, all actions are executed consequetively. When it attempts to execute a rollback action, the installer 'promotes' the action to be executed during rollback. I other words: if you cancel the install during CopyFiles, all rollback CAs before CopyFiles are executed, but rollback CAs after copyfiles are not.

lavocat

lavocat
  • Full Members
  • 158 posts

Posted 09 September 2005 - 08:37

Here an another way:

The sequence numer -2 means the action will be executed ONLY if the installation was interrupted (-3 if error, -1 if success and -4 if suspended).

For example in the UI sequence you may find the dialog "SetupInterrupted" with the sequence number -2.
You may use the sequence number -2 for your own dialog which may also call the "SetupInterrupted" using "newdialog" event...

This solution is the most suitable if you only whant to trigger a CA on CANCEL but not on ERROR

Edited by lavocat, 09 September 2005 - 08:37.