473,806 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3692
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
misunderstandin g, 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/
frlrfSystemServ iceProcessServi ceInstallerClas sTopic.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.goog le.com...
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.goog le.com...
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_MACH INE\system\curr entcontrolset\s ervices). 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.goo gle.com...
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.ServiceP rocess.ServiceP rocessInstaller 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*********@pp aradise.biz> wrote in message
news:1p******** *************** *********@4ax.c om...
I don't think you would need the installer if you want to add all the
proper entries into the registry (under
HKEY_LOCAL_MACH INE\system\curr entcontrolset\s ervices). 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.goo gle.com...
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
9066
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. I've since made some changes to this service. I then proceded to uninstall it (Add/Remove Programs) to install the new one. However, the service still shows under Services, but the .exe is gone. I can't install the new version of the service,...
7
34389
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? ---------------------------------------------- when you fear to fail, you fear something that has not yet happened. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
57011
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 want to test this service on a Windows Server 2003 box that doesn't have the Visual Studio Command prompt. How do I go about installing the service on the Windows Server 2003 box? Thanks!
7
362
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 to it, using installutil.exe OR is it must to have an installer to the service project to be able to
2
4691
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 of the service is not set (this can be checked by right-clicking on the service in the Services window (Admin tools>Services), choosing Properties, LogOn tab). In order to enable my service to launch a GUI at startup, I added the following lines...
7
4390
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 sample, it provides the feature to install service under LocalSystem account. What I need is to install service under NT AUTHORITY\NetworkService, so that my service can access the shared network resources.
0
2701
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 to whether my solution is robust or whether there is a better way to do it. What I've been trying to do is to create a core project with different extension projects, one for each customer. I wanted to create a different Setup project for each...
5
3313
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? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
7
1359
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 Dot Net 2.0 (VB). Probably all it will do is monitor a directory (at intervals controled by a timer), do some stuff with text files, and ftp text files to an ftp. I believe I've successfully tested most of the techniques I'll be using but I was...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9187
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.