public static void InstallServerTask() { if (!Helpers.IsAdministrator()) { Console.WriteLine("Installation requires admin permission."); return; } Console.WriteLine("Registering the FlexSearch service"); Helpers.Exec("FlexSearch Server.exe", "install"); Console.WriteLine("Installing the ETW manifest"); var parameters = new StringBuilder(); var args = parameters .Append("im ") .Append(Helpers.ToQuotedString(Path.Combine(Helpers.BasePath, "FlexSearch.Logging.FlexSearch.etwManifest.man"))) .Append(" /rf:") .Append(Helpers.ToQuotedString(Path.Combine(Helpers.BasePath, "FlexSearch.Logging.FlexSearch.etwManifest.dll"))) .Append(" /mf:") .Append(Helpers.ToQuotedString(Path.Combine(Helpers.BasePath, "FlexSearch.Logging.FlexSearch.etwManifest.dll"))) .ToString(); Helpers.Exec("wevtutil.exe", args); Helpers.Exec("netsh.exe", "http add urlacl url=http://+:9800/ user=everyone listen=yes"); }
private void TaskRegisteration() { this.Actions.Add(new Tuple <string, System.Action>("Install Windows Service", Tasks.InstallServerTask)); this.Actions.Add(new Tuple <string, System.Action>("Un-install Windows Service", Tasks.UnInstallServerTask)); this.Actions.Add(new Tuple <string, System.Action>("Start Service", Tasks.StartServerTask)); this.Actions.Add(new Tuple <string, System.Action>("Stop Service", Tasks.StopServiceTask)); this.Actions.Add(new Tuple <string, System.Action>("Open Event Viewer", () => Helpers.Exec("eventvwr.exe", ""))); this.Actions.Add(new Tuple <string, System.Action>("Open Services", () => Helpers.Exec("mmc.exe", "services.msc"))); this.Actions.Add(new Tuple <string, System.Action>("Explore", () => Helpers.Exec("explorer.exe", Helpers.BasePath))); this.Actions.Add(new Tuple <string, System.Action>("Settings", () => Helpers.Exec("explorer.exe", Path.Combine(Helpers.BasePath, "Conf")))); this.Actions.Add(new Tuple <string, System.Action>("About", () => Helpers.Exec("http://flexsearch.net", "", true))); this.Actions.Add(new Tuple <string, System.Action>("Exit", () => Application.Current.Shutdown())); }