Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Service Install

2 views
Skip to first unread message

dlgproc

unread,
Jan 23, 2006, 1:50:06 PM1/23/06
to
I am installing a Windows Service application using a VS .NET 2003 setup
project. My service installs fine. I created an instance of the
System.ServiceProcess.ServiceInstaller class and set the StartType property
to System.ServiceProcess.ServiceStartMode.Automatic. My service starts
automatically after reboot but I would like to start my service after (or
during) install and not have to force a reboot. What is the best way to do
this?

Thanks for any help

dba...@cyberone.com.au

unread,
Jan 23, 2006, 3:38:42 PM1/23/06
to
Hi,

You can use the ServiceControl table for this.

Bye,
Dennis Bareis

dlgproc

unread,
Jan 23, 2006, 6:23:04 PM1/23/06
to
How do I access the ServiceControl table from my C# code? I have a custom
action on install calling an instance of a class derived from
System.Configuration.Install.Installer

Thanks

Richard [Microsoft Windows Installer MVP]

unread,
Jan 23, 2006, 6:29:22 PM1/23/06
to
[Please do not mail me a copy of your followup]

"=?Utf-8?B?ZGxncHJvYw==?=" <dlg...@discussions.microsoft.com> spake the secret code
<D4682C1E-AC89-42C1...@microsoft.com> thusly:

>I am installing a Windows Service application using a VS .NET 2003 setup

>project. My service installs fine. [...]

VS.NET setup projects don't really have support for installing
services.

Yes, you can code a custom action to do it, but instead I would
suggest writing some code that merges in the necessary rows for the
ServiceInstall and ServiceControl tables instead.

This is one of those things where VS.NET keeps trying to get you to
write custom action code when it is not necessary. Its better to use
standard actions and tables for installing services.
--
"The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ:
<http://www.xmission.com/~legalize/book/>
Pilgrimage: Utah's annual demoparty
<http://pilgrimage.scene.org>

0 new messages