Removed some ViGEmBus checks

This commit is contained in:
Travis Nickles 2020-04-15 18:37:53 -05:00
parent 19344c40b0
commit efd90d56a1
3 changed files with 15 additions and 7 deletions

View File

@ -525,7 +525,8 @@ namespace DS4Windows
if (showlog) if (showlog)
LogDebug(DS4WinWPF.Properties.Resources.Starting); LogDebug(DS4WinWPF.Properties.Resources.Starting);
LogDebug($"Connection to ViGEmBus {Global.vigembusVersion} established"); //LogDebug($"Connection to ViGEmBus {Global.vigembusVersion} established");
LogDebug($"Connection to ScpVBus established");
DS4Devices.isExclusiveMode = getUseExclusiveMode(); DS4Devices.isExclusiveMode = getUseExclusiveMode();
//uiContext = tempui as SynchronizationContext; //uiContext = tempui as SynchronizationContext;
@ -681,14 +682,15 @@ namespace DS4Windows
else else
{ {
string logMessage = string.Empty; string logMessage = string.Empty;
if (!vigemInstalled) /*if (!vigemInstalled)
{ {
logMessage = "ViGEmBus is not installed"; logMessage = "ViGEmBus is not installed";
} }
else else
{ {
logMessage = "Could not connect to ViGEmBus. Please check the status of the System device in Device Manager and if Visual C++ 2017 Redistributable is installed."; logMessage = "Could not connect to ViGEmBus. Please check the status of the System device in Device Manager and if Visual C++ 2017 Redistributable is installed.";
} }*/
logMessage = "Could not connect to ScpVBus";
LogDebug(logMessage); LogDebug(logMessage);
AppLogger.LogToTray(logMessage); AppLogger.LogToTray(logMessage);

View File

@ -262,9 +262,9 @@ namespace DS4Windows
public static OutContType[] activeOutDevType = new OutContType[5] { DS4Windows.OutContType.None, DS4Windows.OutContType.None, public static OutContType[] activeOutDevType = new OutContType[5] { DS4Windows.OutContType.None, DS4Windows.OutContType.None,
DS4Windows.OutContType.None, DS4Windows.OutContType.None, DS4Windows.OutContType.None, DS4Windows.OutContType.None,
DS4Windows.OutContType.None }; DS4Windows.OutContType.None };
public static bool vigemInstalled = IsViGEmBusInstalled(); //public static bool vigemInstalled = IsViGEmBusInstalled();
public static bool hidguardInstalled = IsHidGuardianInstalled(); public static bool hidguardInstalled = IsHidGuardianInstalled();
public static string vigembusVersion = ViGEmBusVersion(); //public static string vigembusVersion = ViGEmBusVersion();
public static X360Controls[] defaultButtonMapping = { X360Controls.None, X360Controls.LXNeg, X360Controls.LXPos, public static X360Controls[] defaultButtonMapping = { X360Controls.None, X360Controls.LXNeg, X360Controls.LXPos,
X360Controls.LYNeg, X360Controls.LYPos, X360Controls.RXNeg, X360Controls.RXPos, X360Controls.RYNeg, X360Controls.RYPos, X360Controls.LYNeg, X360Controls.LYPos, X360Controls.RXNeg, X360Controls.RXPos, X360Controls.RYNeg, X360Controls.RYPos,
@ -634,6 +634,11 @@ namespace DS4Windows
return CheckForDevice(VIGEMBUS_GUID); return CheckForDevice(VIGEMBUS_GUID);
} }
public static bool IsScpVBusInstalled()
{
return CheckForSysDevice(@"root\ScpVBus");
}
public static string ViGEmBusVersion() public static string ViGEmBusVersion()
{ {
return GetViGEmDriverProperty(NativeMethods.DEVPKEY_Device_DriverVersion); return GetViGEmDriverProperty(NativeMethods.DEVPKEY_Device_DriverVersion);

View File

@ -126,7 +126,7 @@ namespace DS4WinWPF.DS4Forms
{ {
Task tempTask = Task.Run(() => Task tempTask = Task.Run(() =>
{ {
CheckDrivers(); //CheckDrivers();
if (!parser.Stop) if (!parser.Stop)
{ {
Dispatcher.BeginInvoke((Action)(() => Dispatcher.BeginInvoke((Action)(() =>
@ -1193,7 +1193,8 @@ Suspend support not enabled.", true);
private void CheckDrivers() private void CheckDrivers()
{ {
bool deriverinstalled = Global.IsViGEmBusInstalled(); //bool deriverinstalled = Global.IsViGEmBusInstalled();
bool deriverinstalled = Global.IsScpVBusInstalled();
if (!deriverinstalled) if (!deriverinstalled)
{ {
Process p = new Process(); Process p = new Process();