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 / Distributed Applications / November 2003

Tip: Looking for answers? Try searching our database.

MSI to install and start a service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Russ Green - 13 Nov 2003 13:59 GMT
I'm using a Setup Project in VB.NET 2003 Standard to install a windows
service application. I would like this installer to start the service after
install. How do I do that?

Thanks,
Russ
konsu - 13 Nov 2003 18:41 GMT
implement a Commit override in your installer class and use
ServiceController to do that.

> I'm using a Setup Project in VB.NET 2003 Standard to install a windows
> service application. I would like this installer to start the service after
> install. How do I do that?
>
> Thanks,
> Russ
Phil Wilson - 13 Nov 2003 19:44 GMT
You're right, Commit is a better place than the Install method.
Signature

Phil Wilson [MVP Windows Installer]
----

> implement a Commit override in your installer class and use
> ServiceController to do that.
[quoted text clipped - 6 lines]
> > Thanks,
> > Russ
Phil Wilson - 13 Nov 2003 19:02 GMT
See the MSDN Topic "Walkthrough: Creating a Windows Service Application in the
Component Designer". Maybe you already did, but that refers to a custom action
that installs your service. In the Install method (override it) use
ServiceController to start it.

(If your company happens to use a commercial tool from InstallShield, Wise etc
etc, you don't need any of the above. They create the right entries in the MSI
file, ServiceInstall and ServiceControl tables, that get the Windows Installer
to do literally all of that stuff without you needing to write code).
Signature

Phil Wilson [MVP Windows Installer]
----

> I'm using a Setup Project in VB.NET 2003 Standard to install a windows
> service application. I would like this installer to start the service after
> install. How do I do that?
>
> Thanks,
> Russ
Russ Green - 14 Nov 2003 12:53 GMT
Thanks for your answers guys. Did it with the following code in
ProjectInstaller.vb

Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)

MyBase.OnAfterInstall(savedState)

Try

Microsoft.VisualBasic.Shell("net start IpNotifyService")

Catch ex As Exception

End Try

End Sub 'OnAfterInstall

> See the MSDN Topic "Walkthrough: Creating a Windows Service Application in the
> Component Designer". Maybe you already did, but that refers to a custom action
[quoted text clipped - 14 lines]
> > Thanks,
> > Russ
konsu - 14 Nov 2003 17:42 GMT
Is there a reason why you decided not to use the ServiceController class?

konst

> Thanks for your answers guys. Did it with the following code in
> ProjectInstaller.vb
[quoted text clipped - 37 lines]
> > > Thanks,
> > > Russ
Phil Wilson - 14 Nov 2003 17:55 GMT
Interesting - I wonder if there's a command prompt screen popping up?
Signature

Phil Wilson [MVP Windows Installer]
----

> Is there a reason why you decided not to use the ServiceController class?
>
[quoted text clipped - 44 lines]
> > > > Thanks,
> > > > Russ
Russ Green - 22 Nov 2003 17:16 GMT
Yes, a command prompt screen does popup.

Russ

> Interesting - I wonder if there's a command prompt screen popping up?
> --
[quoted text clipped - 48 lines]
> > > > > Thanks,
> > > > > Russ
konsu - 14 Nov 2003 17:43 GMT
Is there a reason why you decided not to use the ServiceController class?

konst

> Thanks for your answers guys. Did it with the following code in
> ProjectInstaller.vb
[quoted text clipped - 37 lines]
> > > Thanks,
> > > Russ

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.