Groups | Blog | Home
all groups > dotnet setup > november 2003 >

dotnet setup : MSI to install and start a service


konsu
11/13/2003 10:41:49 AM
implement a Commit override in your installer class and use
ServiceController to do that.

[quoted text, click to view]

Phil Wilson
11/13/2003 11:02:44 AM
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).
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Phil Wilson
11/13/2003 11:44:41 AM
You're right, Commit is a better place than the Install method.
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Russ Green
11/13/2003 1:59:09 PM
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
11/14/2003 9:42:52 AM
Is there a reason why you decided not to use the ServiceController class?

konst

[quoted text, click to view]

konsu
11/14/2003 9:43:19 AM
Is there a reason why you decided not to use the ServiceController class?

konst

[quoted text, click to view]


Phil Wilson
11/14/2003 9:55:31 AM
Interesting - I wonder if there's a command prompt screen popping up?
--
Phil Wilson [MVP Windows Installer]
----
[quoted text, click to view]

Russ Green
11/14/2003 12:53:23 PM
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



[quoted text, click to view]

Russ Green
11/22/2003 5:16:25 PM
Yes, a command prompt screen does popup.

Russ

[quoted text, click to view]

AddThis Social Bookmark Button