public static void UninstallBuiltInDrivers() { LogWriter.Write("Uninstalling Built-in drivers"); try { var path = ResourceExtractor.ExtractResource(Assembly.GetExecutingAssembly(), "KeyboardSplitter.Lib.keyboard_driver.exe"); string msg1 = InterceptionDriver.Uninstall(path); string msg2 = VirtualXboxBus.Uninstall(); LogWriter.Write(msg1); LogWriter.Write(msg2); Controls.MessageBox.Show( "Uninstallation finished. You must reboot the system to completely remove the drivers.\r\n\r\n Application will now close.", ApplicationInfo.AppName, MessageBoxButton.OK, MessageBoxImage.Information); Environment.Exit(0); } catch (Exception ex) { LogWriter.Write("Uninstalling Built-in drivers FAILED:\r\n" + ex.ToString()); Controls.MessageBox.Show( "Uninstall failed: " + ex.Message, "Uninstall failed", MessageBoxButton.OK, MessageBoxImage.Error); } }