title: installing a windows service with .exe path in c#
body: <p>I need to install a service programatically (It even can be done with InstallUtil but it can't be done manually)</p>
  
  <p>I have the following code but can't figure out how to do it properly since that code asks for some class info wich I dont know and I need to know how to use it in order to execute it using teh .exe.
  The code is as follows:</p>
  
  <pre><code>public static void InstallService(string ExeFilename)
  {
      System.Configuration.Install.AssemblyInstaller Installer = new System.Configuration.Install.AssemblyInstaller(ExeFilename,null);
      Installer.UseNewContext = true;
      Installer.Install(null);
      Installer.Commit(null);
  }
  </code></pre>