.NETGURU
Windows Service won't instal
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Schoo
I am trying to install a windows service on my XP workstation (XP
Professional) which I do development on. I am using an example from an
article by Billy Hollis but when I try to run the installutil.exe, it stops
and asks me for a Username and Password (Set Service Login) dialogue box.
This is not mentioned in the article, but then it was written in 2001, so XP
may be more restrictive. I have tried my login and used my
domainName\UserName, but that didn't work either. In the end, it will not
install. Is there anything I am doing wrong or can do differently to
install this Windows Service?

Scott

Reply to this message...
 
    
Phil Wilson
Probably the way you have the Account property set. See the point about
asking for user account at install time:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemserviceprocessserviceprocessinstallerclassaccounttopic.asp
--
Phil Wilson [MVP Windows Installer]
----
"Schoo" <Click here to reveal e-mail address> wrote in message
news:#Yez3$Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Schoo
I don't understand... the link you provided seems to point to a way to set
the ServiceAccount property programmatically. The service is already built
and I am trying to use the DOS window and installutil.exe to get the service
installed. I don't see what VB program code like the
ServiceProcessInstaller.Account Property has to do with this. (maybe it is
just me. :) )

I am not sure what other accounts are available on the workstation, but
there is a "Guest" account. I tried my account info and the Guest acct.
with blank password boxes and still it will not let me install. The actual
error in the DOS window is:

"An exception occurred during the Install phase.
System.CompnentModel.Win32Exception: The account name is invalisd or does
not exist, or the password is invalid for the account name specified".

Then it initializes a rollback.

I can confirm that my user account is set up as "Computer Administrator"
from the control panel.

I hope someone here has some thoughts because I don't see why this wouldn't
work.

Schoo

"Phil Wilson" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

frlrfsystemserviceprocessserviceprocessinstallerclassaccounttopic.asp
[Original message clipped]

Reply to this message...
 
    
Peter Huang (VIP)
Hi Scott,

If we need to install the windows service with the installutil tool, we
need to add the Installer class into the project by right click on the
service design view and select Add installer. The serviceProcessInstaller1
will handle the service logon account.
1. Set the Account property to User
2. Set the pass and user
        private void InitializeComponent()
        {
            this.serviceProcessInstaller1 = new
System.ServiceProcess.ServiceProcessInstaller();
            this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
            this.serviceProcessInstaller1.Password = "pass";
            this.serviceProcessInstaller1.Username = @"domain\user";
            this.serviceProcessInstaller1.AfterInstall += new
System.Configuration.Install.InstallEventHandler(this.serviceProcessInstalle
r1_AfterInstall);
            this.serviceInstaller1.ServiceName = "TestAccount";
            this.serviceInstaller1.AfterInstall += new
System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_Afte
rInstall);
            this.Installers.AddRange(new System.Configuration.Install.Installer[] {    
this.serviceProcessInstaller1, this.serviceInstaller1});
        }

3. rebuild the solution
4. run the installutil tool to install the service which will logon as
{domain\user, pass} pair.

If we do not specified the information the installutil tool do not know how
to do that. You may also look into the link Phil posted.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Reply to this message...
 
 
System.Configuration.Install.Installer
System.Configuration.Install.InstallEventHandler
System.ServiceProcess.ServiceAccount
System.ServiceProcess.ServiceInstaller
System.ServiceProcess.ServiceProcessInstaller




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification