internal static void UninstallService(ServiceConfiguration configuration) { try { _configuration = configuration; var args = new[] { "/u", Assembly.GetEntryAssembly().Location }; ManagedInstallerClass.InstallHelper(args); } catch (InstallException ex) { Console.WriteLine("Uninstall failed with: " + ex.Message); } }
internal static void InstallService(ServiceConfiguration configuration, List<string> serviceArgs) { try { _configuration = configuration; _serviceArgs = serviceArgs; var args = new[] { Assembly.GetEntryAssembly().Location}; ManagedInstallerClass.InstallHelper(args); } catch (Exception ex) { Console.WriteLine("Install falied with: " + ex.Message); } }