Custom Action -EXE how to abort install

Hi All,

I am experimenting with deployment of a VB solution and specifically with a custom action in the deployment project. The custom action EXE works with SSE 2005 databases and verify special encrypted files required by the solution. Every thing works fine but I would like to be able to abort and reverse the installation from within the custom action EXE.

I guess the question is simple but here it is : Can we abort the installation from a custom action EXE ? If yes, how?

Thank you very much.

[507 byte] By [Wacha] at [2008-2-10]
# 1

Yes, you can abort an install from a custom action. If you are using a .NET installer class to implement your custom action, you can force an abort simply by throwing an exception.

You can also override the Abort and Rollback methods to implement your own custom logic.

Hope this helps,
Sean: VBPM

SeanDr_MS at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 2
I'm pretty sure the right exception to use is a System.Configuration.Install.InstallException. Other exceptions, if I remember correctly, won't necessarily abort the install.

The best method to throw these is in the Install method. In Commit, it's too late to roll back.

DavidGuyerMS at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic IDE...