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 / October 2007

Tip: Looking for answers? Try searching our database.

Service installer fails on "repair" install

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric Smith - 06 Oct 2007 00:03 GMT
I have a VS Setup project for a C# Windows Service. In the Control Panel's
"Add/Remove Programs" applet, my service appears with a change button, which
when clicked gives an option to repair the install. If I do that, I get an
error message saying "The specified service already exists" and the install
fails. It seems like the repair install ought to be more forgiving. If
someone is repairing an install, stuff could be in some random state of
chaos, but if the service is fine, the repair will fail.

Similarly, I've noticed that if the uninstall successfully removes the
service but fails in some later step, rerunning the uninstall also won't
work. This time the uninstall is unhappy because you're trying to remove a
service that doesn't exist and the process fails again.

Is there some way for these scenarios to work in a more robust way?
Phil Wilson - 08 Oct 2007 18:34 GMT
This is a consequence of the fact that Visual Studio setups run custom
action code to install services (instead of the built-in MSI support). So
what happens is that a repair attempts to run your custom action again
because a repair is effectively a re-install. The install custom action
needs a condition (case-sensitive) of Not Installed so it doesn't run again
on a repair.

Signature

Phil Wilson
[MVP Windows Installer]

>I have a VS Setup project for a C# Windows Service. In the Control Panel's
> "Add/Remove Programs" applet, my service appears with a change button,
[quoted text clipped - 12 lines]
>
> Is there some way for these scenarios to work in a more robust way?
Eric Smith - 09 Oct 2007 16:31 GMT
Hi Phil,

Thanks for your reply. Adding the "Not Installed" condition to the custom
action does in fact prevent the "repair" from failing. I don't understand
conditions all that well, but it seems that adding this condition prevents
the custom action from being called at all. While an improvement for the
repair case, it's still not ideal. What if the service got removed somehow?
Running the repair won't fix it if the service installation step is skipped,
right?

> This is a consequence of the fact that Visual Studio setups run custom
> action code to install services (instead of the built-in MSI support). So
[quoted text clipped - 19 lines]
> >
> > Is there some way for these scenarios to work in a more robust way?

Rate this thread:







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.