title: Solving Another version of program is already installed exception
body: <p>I am trying to install a windows service and start it afterwards.I do not understand why after a couple of cycles (install+uninstall) i cannot install or uninstall the service anymore since i get the error:</p>
  
  <blockquote>
    <p>Another version of this product is already installed</p>
  </blockquote>
  
  <p>but the service is no longer present in the <code>Services</code> window , nor is the installer present in the <code>Programs</code> section.</p>
  
  <p>If i try to uninstall i get :</p>
  
  <blockquote>
    <p>Error 1001: An exception occured while uninstalling.This exception
    will be ignored and the uninstall will continue.However the uninstall
    might not be fully uninstalled after the uininstall is complete.</p>
  </blockquote>
  
  <p>I do not understand what i am doing wrong.
  I have added my project output to all custom actions: </p>
  
  <pre><code>-Install
  -Uninstall
  -Commit
  -Rollback
  </code></pre>
  
  <p>How is one supposed to perform clean installs/uninstalls ?</p>
  
  <p><strong>Installer Code</strong></p>
  
  <pre><code>    [RunInstaller(true)]
      public partial class ProjectInstaller : Installer {
          public ProjectInstaller() {
              InitializeComponent();
              this.AfterInstall += ProjectInstaller_AfterInstall;
              this.BeforeUninstall += ProjectInstaller_BeforeUninstall;
          }
  
          private void ProjectInstaller_AfterInstall(object sender, InstallEventArgs e) {
              StartService();
          }
  
          private void ProjectInstaller_BeforeUninstall(object sender, InstallEventArgs e) {
              StopService();
          }
  
          private void StartService() {
              Debugger.Launch();
              bool isAdmin = IsAdmin();
              if (isAdmin) {
                  using (ServiceController controller = new ServiceController(serviceInstaller1.ServiceName)) {
                      controller.Start();
                  }
              } else {
                  ProcessStartInfo info = new ProcessStartInfo {
                      Verb = "runas",
                      FileName = "net",
                      Arguments = $"start {serviceInstaller1.ServiceName}"
                  };
                  Process.Start(info);
              }
          }
  
          private void StopService() {
              bool isAdmin = IsAdmin();
              if (isAdmin) {
                  using (ServiceController controller = new ServiceController(serviceInstaller1.ServiceName)) {
                      controller.Stop();
                  }
              } else {
                  ProcessStartInfo info = new ProcessStartInfo {
                      Verb = "runas",
                      FileName = "net",
                      Arguments = $"stop {serviceInstaller1.ServiceName}"
                  };
                  Process.Start(info);
              }
          }
  
          private static bool IsAdmin() {
             var identity = WindowsIdentity.GetCurrent();
             var princ = new WindowsPrincipal(identity);
             return princ.IsInRole(WindowsBuiltInRole.Administrator);
          }
  }
  </code></pre>