title: Unable to install windows service with the help of InstallUtil tool
body: <p>I use VS 2012 and since the setup projects have been removed from it I have to use InstallUtil.exe.</p>
  
  <p>I don't have projectInstaller class in my windows service app. I run in command prompt: </p>
  
  <pre><code>installutil FilesMonitoringService.exe 
  </code></pre>
  
  <p>I get: </p>
  
  <blockquote>
    <p>C:\Program Files\Microsoft Visual Studio 8\VC#>installutil "C:\Program Files\Mic
    rosoft Visual Studio 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyServ
    ice.exe"
    Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
    Copyright (c) Microsoft Corporation.  All rights reserved.</p>
    
    <p>Running a transacted installation.</p>
    
    <p>Beginning the Install phase of the installation.
    See the contents of the log file for the C:\Program Files\Microsoft Visual Studi
    o 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyService.exe assembly's
    progress.
    The file is located at C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProj
    ects\MyService\MyService\bin\Release\MyService.InstallLog.
    Installing assembly 'C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjec
    ts\MyService\MyService\bin\Release\MyService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\
    MyService\MyService\bin\Release\MyService.exe
       logfile = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MySer
    vice\MyService\bin\Release\MyService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found
     in the C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MyService\
    MyService\bin\Release\MyService.exe assembly.</p>
    
    <p>The Install phase completed successfully, and the Commit phase is beginning.
    See the contents of the log file for the C:\Program Files\Microsoft Visual Studi
    o 8\VC#\CSharpProjects\MyService\MyService\bin\Release\MyService.exe assembly's
    progress.
    The file is located at C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProj
    ects\MyService\MyService\bin\Release\MyService.InstallLog.
    Committing assembly 'C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjec
    ts\MyService\MyService\bin\Release\MyService.exe'.
    Affected parameters are:
       logtoconsole =
       assemblypath = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\
    MyService\MyService\bin\Release\MyService.exe
       logfile = C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MySer
    vice\MyService\bin\Release\MyService.InstallLog
    No public installers with the RunInstallerAttribute.Yes attribute could be found
     in the C:\Program Files\Microsoft Visual Studio 8\VC#\CSharpProjects\MyService\
    MyService\bin\Release\MyService.exe assembly.
    Remove InstallState file because there are no installers.</p>
    
    <p>The Commit phase completed successfully.</p>
    
    <p>The transacted install has completed.</p>
    
    <p>C:\Program Files\Microsoft Visual Studio 8\VC#></p>
  </blockquote>
  
  <p><strong>OK</strong>, seems like everything have been installed. But! When I go to task manager to the Services page I can't find my service.</p>
  
  <p>What could be the reason? </p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edits:</strong> I pointed out that I don't have projectInstaller class because if I add it (in designer -> add installer) and run installutil command I get: (approximate translation)</p>
  
  <blockquote>
    <p>Installation of FilesMonitoringService...
    Creation of EventLog FilesMonitoringService in a log jornal Application...</p>
  </blockquote>
  
  <p>On this setup stage the exception occured.</p>
  
  <blockquote>
    <p>System.Security.SecurityException: The source is not found, but failed to find by any or all log jornals. Not available jornals: Security.</p>
    
    <p>The recoil stage starts. </p>
    
    <p>// lots of text </p>
    
    <p>The recoil stage has succeded</p>
    
    <p>Setup group operation executed.
    Setup failed and recoil was executed.</p>
  </blockquote>
  
  <p>So, if I add projectInstller to my windows service it definitely fails to install with installUtil.<br>
  Here is the generated code: </p>
  
  <pre><code>[RunInstaller(true)]
  public partial class ProjectInstaller : Installer
  {
      public ProjectInstaller()
      {
          InitializeComponent();
      }
      private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
      {}
      private void serviceProcessInstaller1_AfterInstall(object sender, InstallEventArgs e)
      {}
  }
  </code></pre>
  
  <p>Mabby I need to put some code into afterInstall methods? I also set this properies in a <code>properties</code> window:  </p>
  
  <p>serviceInstaller1: ServiceName -> FileMonitoringService, StartType -> Automatic<br>
  serviceProcessInstaller1: Account -> LocalSystem</p>
  
  <p>Or can it be implemented without projectInstaller? </p>