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

Trigger roll back from CA


6 replies to this topic

jungchoi

jungchoi
  • Members
  • 6 posts

Posted 01 December 2001 - 00:17

I have a CA dialog.  When the dialog is cancelled, the installation exits with an error.  How can I enforece a roll back when the dialog is cancelled?

Dave I

Dave I
  • Members
  • 195 posts

Posted 03 December 2001 - 10:09

If its an installscript CA use:

  return ERROR_INSTALL_FAILURE;

This will invoke a rollback.


jungchoi

jungchoi
  • Members
  • 6 posts

Posted 03 December 2001 - 19:54

Unfortunately, it is a executable custom action.
Does ISWI catch the return code of executable and roll back?
How does it decide when to roll bakck?

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 03 December 2001 - 21:17

return ERROR_INSTALL_FAILURE applies to C custom actions also.

A roll back will occur (unless disabled) whenever a deferred action or custom action,  returns with an error.   Other actions are either before or after the time the installation is performed so I would not expect a roll back.



jungchoi

jungchoi
  • Members
  • 6 posts

Posted 04 December 2001 - 01:43

Our custom action is an mfc dialog asking some config information. What our QA asked is to roll back whole installation when user cancels the dialog.
I updated the dialog to return ERROR_INSTALL_FAILUER when it is cancelled.  But, it still doesn't roll back and just displays Internal Error 2744.

Roll back can't be triggered if the custom action occurs after InstallFinalize?  Does this mean the executable should be stored in the Binary table?  Our custom action's location is "Installed with the product" so that it needed to be after the InstallFinalize in the sequences.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 04 December 2001 - 09:59

That is right., there is no possibility to roll back after InstallFinalize.   One of the functions of InstallFinalize is to delete the roll back script.

It would only need to be after the InstallFiles or MoveFiles action.

I am not sure that custom user interface in the execute sequence complies with best practice.



jungchoi

jungchoi
  • Members
  • 6 posts

Posted 05 December 2001 - 01:12

Thanks a bunch.
After replacing InstallFinalize with InstallExecute in the Sequeces, the rollback can be triggerred from our mfc dialog when it is cancelled.
The reason I used the dialog in Execute is that the dialog not only just ask some info, it also does lots of configurations works (e.g. CreateProcess...), and I wanted the configurator that can be re-run after install if users want to change the config.