Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2005

Tip: Looking for answers? Try searching our database.

How to abort an install in an installer class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roy Chastain - 13 Sep 2005 15:47 GMT
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
-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
Lloyd Dupont - 14 Sep 2005 04:50 GMT
I think throwing an exception will do the trick...

>I have a custom installer derived from System.Configuration.Install
> I have overridden the Install and some of the other methods.
[quoted text clipped - 9 lines]
> KMSYS Worldwide, Inc.
> http://www.kmsys.com 
Roy Chastain - 14 Sep 2005 11:22 GMT
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...
>
[quoted text clipped - 11 lines]
>> KMSYS Worldwide, Inc.
>> http://www.kmsys.com 

-------------------------------------------
Roy Chastain
KMSYS Worldwide, Inc.
http://www.kmsys.com
"Peter Huang" [MSFT] - 15 Sep 2005 07:41 GMT
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

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Lloyd Dupont - 15 Sep 2005 08:20 GMT
Try to throw a System.Configuration.Install.InstallException instead.
That might fix it, perhaps...

>I was hoping for something cleaner.  When these class get run via
>InstallUtil, the exception get displayed etc.  Not really what I
[quoted text clipped - 21 lines]
> KMSYS Worldwide, Inc.
> http://www.kmsys.com 

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.