/// <summary>Uninstall the ScpVBus driver.</summary> /// <remarks>Throws exceptions upon errors.</remarks> /// <returns>false if a reboot is still required to complete installation, else true to indicate completion.</returns> public static bool Uninstall() { string infPath = @".\Driver\"; string devPath = ""; string instanceId = ""; uint result = 0; bool rebootRequired = false; var installer = Difx.Factory(); if (Devcon.Find(new Guid(SCP_BUS_CLASS_GUID), ref devPath, ref instanceId)) { if (!Devcon.Remove(new Guid(SCP_BUS_CLASS_GUID), devPath, instanceId)) { throw new ScpDriverInstallException("Unable to remove SCP Virtual Bus, cannot continue with uninstallation."); } } result = installer.Uninstall(infPath + @"ScpVBus.inf", DifxFlags.DRIVER_PACKAGE_DELETE_FILES, out rebootRequired); if (result == 0xe0000302) { throw new ScpDriverInstallException("Driver not found, please ensure it is installed."); } else if (result != 0) { throw new ScpDriverInstallException("Driver uninstall failed with DIFxAPI error 0x" + result.ToString("X8")); } return(rebootRequired); }
/// <summary>Install the ScpVBus driver.</summary> /// <remarks>Throws exceptions upon errors.</remarks> /// <returns>false if a reboot is still required to complete installation, else true to indicate completion.</returns> public static bool Install() { var infPath = @".\Driver\"; var devPath = ""; var instanceId = ""; var installer = Difx.Factory(); uint result = 0; bool rebootRequired = false; DifxFlags flags = DifxFlags.DRIVER_PACKAGE_ONLY_IF_DEVICE_PRESENT | DifxFlags.DRIVER_PACKAGE_FORCE; if (!Devcon.Find(new Guid(SCP_BUS_CLASS_GUID), ref devPath, ref instanceId)) { if (!Devcon.Create("System", new Guid("{4D36E97D-E325-11CE-BFC1-08002BE10318}"), "root\\ScpVBus\0\0")) { throw new ScpDriverInstallException("Unable to create SCP Virtual Bus. Cannot continue with installation."); } } result = installer.Install(infPath + @"ScpVBus.inf", flags, out rebootRequired); if (result != 0) { throw new ScpDriverInstallException("Driver installation failed with DIFxAPI error 0x" + result.ToString("X8")); } return(!rebootRequired); }
private void Window_Initialized(object sender, EventArgs e) { Log.InfoFormat("SCP Driver Installer {0} [Built: {1}]", Assembly.GetExecutingAssembly().GetName().Version, AssemblyHelper.LinkerTimestamp); _installer = Difx.Instance; _installer.OnLogEvent += Logger; var info = OsInfoHelper.OsInfo; _valid = OsInfoHelper.OsParse(info); Log.InfoFormat("{0} detected", info); // get all local USB devices foreach (var usbDevice in WdiWrapper.Instance.UsbDeviceList) { BluetoothStackPanel.Children.Add(new CheckBox { Content = usbDevice }); DualShock3StackPanel.Children.Add(new CheckBox { Content = usbDevice }); DualShock4StackPanel.Children.Add(new CheckBox { Content = usbDevice }); } }
private void Window_Initialized(object sender, EventArgs e) { Log.InfoFormat("SCP Driver Installer {0} [Built: {1}]", Assembly.GetExecutingAssembly().GetName().Version, AssemblyHelper.LinkerTimestamp); _installer = Difx.Instance; _installer.OnLogEvent += Logger; Log.InfoFormat("{0} detected", OsInfoHelper.OsInfo); }
public static Difx Factory() { Difx RetVal = null; if (Environment.Is64BitProcess) { RetVal = new Difx_64(); } else { RetVal = new Difx_32(); } return(RetVal); }