473,226 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

windows service... when do we need installer

Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
..net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.

thanks
siddharth
Jul 21 '05 #1
7 3635
sidd wrote:
Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe
My experience ( I have writen a few windows services so far ) is that it
needs the installer. I have seen some articles ( in c-sharpfriends, for
example ) where they don't mention the installer. But in the MS
documentation for creating a web service, they say to add the installer.

It's very simple to do anyway and it adds a lot of properties, such as start
automatically, or manually , so why not do it.

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
.net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.
The installer seems to be the 'hook' for allowing the OS to install and run
the service.

Other than adding it to allow me to 'install' the service, I have never used
it for anything else. Like you, I put all the tracing and logging and so
on in the service code itself.

thanks
siddharth


--
incognito @ http://kentpsychedelic.blogspot.com/

Jul 21 '05 #2
Hi siddharth,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know when an installer
class is needed in a windows service application. If there is any
misunderstanding, please feel free to let me know.

As far as I know, if you need to install the windows service to your
computer, the installer class is required. The installutil.exe need to get
information from it to decide properties for that service. For example, a
service's StartType may be set to start the service automatically at reboot
or require a user to start the service manually. Also Install and Uninstall
methods are called during installation and uninstallation. The service
cannot be installed onto the machine without the installer class.

The OnStart or the constructor of the windows service does things when
service starts, while the installer class does things when the service is
being installed.

For more information, please check the following link:

http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemServiceProcessServiceInstallerClassTopi c.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3
Hello Sidd,

I've only created two production windows services, and this wasn't a
stumbling block. However, from my experience:

The application needs code, in it, that will run on installation. It does
not need for you to package it as an MSI. You can run the code (the
installer class) by calling installutil.

--- N

"sidd" <si************@hotmail.com> wrote in message
news:af*************************@posting.google.co m...
Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
.net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.

thanks
siddharth

Jul 21 '05 #4
Sidd,
In addition to the other comments.

The installer for a Windows Service will install the Windows Service itself,
allowing you to start it in the first place.

I would recommend using Installers for the custom event log & performance
counters, as the account that the service runs under may not be authorized
to create event logs & performance counters.

Also the Windows Service itself has a "default" event log that it may use
before OnStart or your code has a chance to execute.

Hope this helps
Jay

"sidd" <si************@hotmail.com> wrote in message
news:af*************************@posting.google.co m...
Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
.net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.

thanks
siddharth

Jul 21 '05 #5
I don't think you would need the installer if you want to add all the
proper entries into the registry (under
HKEY_LOCAL_MACHINE\system\currentcontrolset\servic es). Also, the
system account does have permissions to create
Its own source and log name, in our services we have our own log name
other than the Application logs.
Michael
On Mon, 19 Jul 2004 10:34:57 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************@msn.com> wrote:
Sidd,
In addition to the other comments.

The installer for a Windows Service will install the Windows Service itself,
allowing you to start it in the first place.

I would recommend using Installers for the custom event log & performance
counters, as the account that the service runs under may not be authorized
to create event logs & performance counters.

Also the Windows Service itself has a "default" event log that it may use
before OnStart or your code has a chance to execute.

Hope this helps
Jay

"sidd" <si************@hotmail.com> wrote in message
news:af*************************@posting.google.c om...
Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
.net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.

thanks
siddharth


Jul 21 '05 #6
Michael,
That's the key word, if you want to add the proper entries into the
registry. I question why would I want to add all the proper entries myself,
when the InstallerUtil knows what they are by virtue of using reflection to
call the System.ServiceProcess.ServiceProcessInstaller class.

The Service itself cannot do it, as it can't run as a Service without them
(chicken & egg problem).

You're assuming the Service is running under the system account, Services do
not have to run under the service account!

Otherwise you are correct.

If you really don't want to use InstallUtil.exe, I would create my own
InstallUtil that did the same thing, use reflection to find all the
Installer attributes, creating an instance of them and invoking the
methods...

Hope this helps
Jay

"Michael" <ma*********@pparadise.biz> wrote in message
news:1p********************************@4ax.com...
I don't think you would need the installer if you want to add all the
proper entries into the registry (under
HKEY_LOCAL_MACHINE\system\currentcontrolset\servic es). Also, the
system account does have permissions to create
Its own source and log name, in our services we have our own log name
other than the Application logs.
Michael
On Mon, 19 Jul 2004 10:34:57 -0500, "Jay B. Harlow [MVP - Outlook]"
<Ja************@msn.com> wrote:
Sidd,
In addition to the other comments.

The installer for a Windows Service will install the Windows Service itself,allowing you to start it in the first place.

I would recommend using Installers for the custom event log & performance
counters, as the account that the service runs under may not be authorizedto create event logs & performance counters.

Also the Windows Service itself has a "default" event log that it may use
before OnStart or your code has a chance to execute.

Hope this helps
Jay

"sidd" <si************@hotmail.com> wrote in message
news:af*************************@posting.google.c om...
Hi All,
i have some doubts on .net windows services..
please see if some one could help me understand this..

1)is it possible to install a windows service which does not have a
installer added to it,
using installutil.exe

OR
is it must to have an installer to the service project to be able to
install it using installutil.exe

2)why exactly do you have to add installer to a
.net windows service project .
some of the samples i saw were for creating a custom event log ,or for
performance counter ..but it should be possible to do all this even
in the "OnStart" or in the constructor of the windows service.
so when exactly would you need a installer.

thanks
siddharth

Jul 21 '05 #7
thanks all.
-siddharth
Jul 21 '05 #8

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

Similar topics

6
by: tuuky | last post by:
I've created a Windows Service in C# and an installer project for it. I installed the service using the packaged installer project and the service was installed correctly and it runs fine. ...
7
by: scarred wind | last post by:
when i run my program, an error message prompt me that i should add the installutil.exe. How do i checked for the installutil.exe? How can i add it to my Timer program? ...
3
by: Jeremy S. | last post by:
On my dev machine (XP/Pro with VS.NET 2003) I have been developing a Windows Service and installing it on the local machine by opening the Visual Studio Command Prompt and then executing . Now I...
7
by: sidd | last post by:
Hi All, i have some doubts on .net windows services.. please see if some one could help me understand this.. 1)is it possible to install a windows service which does not have a installer added...
2
by: letibal | last post by:
Hello, I have written a windows service and created an installer for it. The service runs under the system accounts. When started, it launches a GUI. By default, the InteractiveProcess property...
7
by: sunil | last post by:
Hi all, I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based on the code...
0
by: =?Utf-8?B?U2ltb25EZXY=?= | last post by:
Hi All I would like to install the same Windows Service project on the same server under different names, one for each customer. I have been able to do it but I would like an expert opinion as...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
7
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I have not touched a Windows Service app since my MCAD certs (about 5 years ago...) I've just been assigned to write a quickie app. I could use a 2nd opinion here. The app is to be written in...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.