473,472 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Auto start service after (or during) setup

I have created a windows service and added a installer for the service.

The service is set to autostart. After installation the service is listed in
services as autostart. This is all fine, but I also want to start the service
after or during installation.

How can I start the service in my setup? (using setup project in vs.net 2003)
--
AccoN Accountants & Adviseurs
ICT Project Bureau
Postbus 5090
6802 EB Arnhem
The Netherlands

tel. +31 (0)26-3842384
fax. +31 (0)26-3630222
mobile: +31 (0)6-25388935
http://www.accon.nl
Nov 16 '05 #1
2 10941
Hey there,

an idea maybe?

you can launch custom scripts at different stages in the install, so after
the setup and installed the service you could call
"net start <servicename>"

Dan.
"Philip Wagenaar" <p.********@accon.nl> wrote in message
news:8A**********************************@microsof t.com...
I have created a windows service and added a installer for the service.

The service is set to autostart. After installation the service is listed
in
services as autostart. This is all fine, but I also want to start the
service
after or during installation.

How can I start the service in my setup? (using setup project in vs.net
2003)
--
AccoN Accountants & Adviseurs
ICT Project Bureau
Postbus 5090
6802 EB Arnhem
The Netherlands

tel. +31 (0)26-3842384
fax. +31 (0)26-3630222
mobile: +31 (0)6-25388935
http://www.accon.nl

Nov 16 '05 #2
Here is how you could do it:
- Extend the ServiceInstaller class and register an Event handler for the
base class "Committed" event in the class constructor.
- In your Event handler you just create an instance of the ServiceController
class for your service and call it's Start method.
- Optionally you can wait for the service to start by calling
ServiceController .WaitForStatus before you close the ServiceController by
calling Close.

Willy.
"Philip Wagenaar" <p.********@accon.nl> wrote in message
news:8A**********************************@microsof t.com...
I have created a windows service and added a installer for the service.

The service is set to autostart. After installation the service is listed
in
services as autostart. This is all fine, but I also want to start the
service
after or during installation.

How can I start the service in my setup? (using setup project in vs.net
2003)
--
AccoN Accountants & Adviseurs
ICT Project Bureau
Postbus 5090
6802 EB Arnhem
The Netherlands

tel. +31 (0)26-3842384
fax. +31 (0)26-3630222
mobile: +31 (0)6-25388935
http://www.accon.nl

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Frank Py | last post by:
I have a SQL Server 2000 that failed to start after a Windows reboot. Agent properties are checked to auto start if stopped. Under the Agent Error Log, I have the following data: Information:...
2
by: db2group88 | last post by:
How to auto start DB2 service on Linux Suse 9? we have db2 udb v8.2. I search the /etc/inittab file and don't find db:234:once:/etc/rc.db2 > /dev/console 2>&1 # Autostart DB2 Services so i...
3
by: Vai2000 | last post by:
Hi All, I need to execute custom action during installation of my program (through MSI). Creating the MSI was pretty straight fwd. After that I went into the Custom Action Editor and added the...
3
by: Eric Renken | last post by:
Does anyone know of a good auto update service. Using .NET 2.0 C#. I do not want to use InstallShields, even though that is who we use to create setups. There sales policies are starting to...
1
by: 1Cajun | last post by:
I have an Administration form that I would like to use to not only set some variables for the service but also install and start and stop the service. I have created an install project and can...
3
by: Robert | last post by:
Hello, I have created a windows service that performs some automatic backups. It works, and it is set to start automatically. However, it is not started directly after the installation...
1
by: scott | last post by:
I create a service project and build into service.exe , intall it as system service. With a service.exe.config file in the directory as service.exe. so that I can not start service. I use vs2005...
0
by: =?Utf-8?B?TWljaGVs?= | last post by:
Hello, When creating a setup project for my VB.NET application, the setup installs my program in c:\program files\default company name\Program name. I can rename then name of the map "Default...
1
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I am reviewing Windows service programming. I'm running VS2005 and programming in VB. I've just found an example in Support: 'How to create a Setup project for a Windows Service in Visual Basic...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.