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 can I execute a rollback from a CA


2 replies to this topic

TommyBergquist

TommyBergquist
  • Full Members
  • 2 posts

Posted 16 July 2007 - 12:26

I have a question according to windows installer in VS2005.

If something goes wrong and I want to make a rollback from a CA what kind of actions should I do?

An example could be that a wrong path to a file was given by the user, and therefore the install had to rollback, when the installer found out of that.

Right now it just stops when it hit an error and the Installer writes that the install was succesful.

Thanks in advance

Tommy Bergquist

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 18 July 2007 - 17:59

Return ERROR_INSTALL_FAILURE but your custom action must be deferred - which I think all Visual Studio custom actions are. Installer class action may not work that way, I'm not sure.

TommyBergquist

TommyBergquist
  • Full Members
  • 2 posts

Posted 20 July 2007 - 08:24

Thanks for your quick response Stefan.

I found out that I can throw an exception,

throw new InstallException()

That makes the rollback.

Tommy Bergquist