Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to install windows service application created with c#

I am trying to Install a windows service I made with the following command :

C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug>InstallU til.exe filechecker.exe

but I am getting the following message:

Running a transacted installation.

Beginning the Install phase of the installation. See the contents of the log file for the C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.exe assembly's progress. The file is located at C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.InstallLog.

An exception occurred during the Install phase. System.ArgumentException: Must specify value for source.

The Rollback phase of the installation is beginning. See the contents of the log file for the C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.exe assembly's progress. The file is located at C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.InstallLog.

The Rollback phase completed successfully.

The transacted install has completed.

Running a transacted installation.

Beginning the Install phase of the installation. See the contents of the log file for the C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.exe assembly's progress. The file is located at C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.InstallLog.

An exception occurred during the Install phase. System.ArgumentException: Must specify value for source.

The Rollback phase of the installation is beginning. See the contents of the log file for the C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.exe assembly's progress. The file is located at C:\$(MyFiles)\Projects\Win Service\c#\filechecker\filechecker\bin\Debug\filechecker.InstallLog.

The Rollback phase completed successfully.

The transacted install has completed.

How can I solve this issue?

like image 571
themhz Avatar asked May 04 '12 10:05

themhz


People also ask

How do I install Windows Service service?

In Solution Explorer, access Design view for the service for which you want to add an installation component. Click the background of the designer to select the service itself, rather than any of its contents. With the designer in focus, right-click, and then click Add Installer.

Where is InstallUtil exe located?

The InstallUtil binary may also be digitally signed by Microsoft and located in the . NET directories on a Windows system: C:\Windows\Microsoft.NET\Framework\v \InstallUtil.exe and C:\Windows\Microsoft.NET\Framework64\v \InstallUtil.exe .


1 Answers

A ServiceInstaller always1 creates an event log source, and sets the Source name to the ServiceName. The error suggests to me that you're not setting the ServiceName on your ServiceInstaller instance (although I'd have hoped for a better error).


1Unless you manually iterate its installers collection and remove it, after it's instantiated. You'd also have to make sure you turn off all of the automatic logging and/or manually add your own EventLogInstaller using the same source name - this can be useful if you wish all logging from the service (including automatic logging) to go to somewhere other than the Application event log.

like image 155
Damien_The_Unbeliever Avatar answered Nov 01 '22 13:11

Damien_The_Unbeliever