public void InstallWith(WindowsServiceInstaller installer) { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); using (var ti = new TransactedInstaller()) { ti.Installers.Add(installer); var assembly = Assembly.GetEntryAssembly(); if (assembly == null) { throw new NullReferenceException("assembly"); } var path = string.Format("/assemblypath={0}", assembly.Location); string[] commandLine = {path}; var context = new InstallContext(null, commandLine); ti.Context = context; ti.Install(new Hashtable()); } }
public void InstallWith(WindowsServiceInstaller installer) { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); using (var ti = new TransactedInstaller()) { ti.Installers.Add(installer); var assembly = Assembly.GetEntryAssembly(); if (assembly == null) { throw new NullReferenceException("assembly"); } var path = string.Format("/assemblypath={0}", assembly.Location); string[] commandLine = { path }; var context = new InstallContext(null, commandLine); ti.Context = context; ti.Install(new Hashtable()); } }
public void UninstallWith(WindowsServiceInstaller windowsServiceInstaller) { windowsServiceInstaller.Uninstall(new Hashtable()); }