2008-11-09 8 views
1

.NET 2.0에서 간단한 Windows 서비스를 설계했습니다.명령 프롬프트를 사용하여 Windows 서비스를 설치하는 것에 대한 혼란

로컬 컴퓨터에 배포하려고합니다. 디자인보기로 전환하고 ServiceInstaller 및 ServiceProcessInstaller 개체를 설정했습니다. Project Installer가 있습니다. 또한 Windows 서비스를 .NET 설치 프로젝트로 싸고 설치하여 지정한 디렉터리에 .exe를 남깁니다.

나는 cmd를 실행하고 installutil의 경로를 입력했습니다. 이 잘 작동하지만 Visual Studio 명령 프롬프트에서 서비스에 대한 전체 경로 및 installutil 입력하고이 작동하지 않습니다. 또한 installutil/i 및 모든 종류의 절망에서 물건을 시도했습니다. 사용 권한은 로컬 시스템 (확장)입니다.

내가 잘못하고있는 아이디어가 있습니까? Windows 서비스를 설치 한 사용자의 경우 서비스를 설치하는 방법은 무엇입니까?

감사

답변

2

우리는 실제로 우리의 응용 프로그램에 내장 된 설치 프로그램을 만들 수 있습니다. 그것은 서비스로 또는 콘솔 모드로 실행뿐만 아니라 서버를 설치/제거하는 명령 줄이있는 콘솔 응용 프로그램입니다.

자세한 내용은 Self Installing Service에서이 기사를 참조하십시오. 유연성을 제공하므로이 방법이 마음에 듭니다.

+0

링크가 작동하지 않습니다. – JumpingJezza

1
 
DESCRIPTION: 
     SC is a command line program used for communicating with the 
     NT Service Controller and services. 
USAGE: 
     sc [command] [service name] ... 

     The option has the form "\\ServerName" 
     Further help on commands can be obtained by typing: "sc [command]" 
     Commands: 
      query-----------Queries the status for a service, or 
          enumerates the status for types of services. 
      queryex---------Queries the extended status for a service, or 
          enumerates the status for types of services. 
      start-----------Starts a service. 
      pause-----------Sends a PAUSE control request to a service. 
      interrogate-----Sends an INTERROGATE control request to a service. 
      continue--------Sends a CONTINUE control request to a service. 
      stop------------Sends a STOP request to a service. 
      config----------Changes the configuration of a service (persistant). 
      description-----Changes the description of a service. 
      failure---------Changes the actions taken by a service upon failure. 
      qc--------------Queries the configuration information for a service. 
      qdescription----Queries the description for a service. 
      qfailure--------Queries the actions taken by a service upon failure. 
      delete----------Deletes a service (from the registry). 
      create----------Creates a service. (adds it to the registry). 
      control---------Sends a control to a service. 
      sdshow----------Displays a service's security descriptor. 
      sdset-----------Sets a service's security descriptor. 
      GetDisplayName--Gets the DisplayName for a service. 
      GetKeyName------Gets the ServiceKeyName for a service. 
      EnumDepend------Enumerates Service Dependencies. 

     The following commands don't require a service name: 
     sc 
      boot------------(ok | bad) Indicates whether the last boot should 
          be saved as the last-known-good boot configuration 
      Lock------------Locks the Service Database 
      QueryLock-------Queries the LockStatus for the SCManager Database 
EXAMPLE: 
     sc start MyService 
0

내 설치 패키지에 installutil 전화 했어 그리고 그것은 나를 위해 잘 작동합니다.

installutil을 실행할 때 발생하는 오류 메시지를 게시하면 좋을 것입니다.

관련 문제