How to abort an install in an installer class

  • Thread starter Thread starter Roy Chastain
  • Start date Start date
R

Roy Chastain

I have a custom installer derived from System.Configuration.Install
I have overridden the Install and some of the other methods.
I would like to be able to signal that the install is/has failed and cause a rollback when I detect errors in the Install or even
the BeforeInstall methods.

How do I indicate that the install is/has failed?

Thanks
 
I was hoping for something cleaner. When these class get run via InstallUtil, the exception get displayed etc. Not really what I
want most of the time.

I think throwing an exception will do the trick...
 
Hi

I think Lloyd's suggestion is to try...catch.... the problem code, so if
there is any error occur, the exception will catch in the catch block, and
then you can do something to indicate the installation is failed. e.g.
write a file or popup a messagebox......

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Try to throw a System.Configuration.Install.InstallException instead.
That might fix it, perhaps...

Roy Chastain said:
I was hoping for something cleaner. When these class get run via
InstallUtil, the exception get displayed etc. Not really what I
want most of the time.
 
Back
Top