added a check on startup to see if the corsiar service has started

This commit is contained in:
Conor 2020-11-27 20:08:19 +00:00
parent cd252ddca4
commit 7850d957f4
10 changed files with 166 additions and 38 deletions

Binary file not shown.

View File

@ -28,6 +28,7 @@
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.0.1" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0-rc.2.20475.5" />
<PackageReference Include="System.IO.Ports" Version="4.7.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -11,6 +11,7 @@ using System.Windows;
using System.Xml;
using System.IO;
using System.Linq;
using System.ServiceProcess;
using RGBController2.Boards;
namespace RGBController2.ViewModels
@ -100,7 +101,13 @@ namespace RGBController2.ViewModels
break;
}
case "cue":
{
{
// This checks if the Corsair Cue SDK service has been started
// This should prevent error when lauching the application at
// windows startup
ServiceController sc = new ServiceController("CorsairLLAService");
sc.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(30));
var tab = new CueDeviceTab(name);
switch (device)
{

View File

@ -78,5 +78,16 @@ C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\logo.ico
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\obj\Debug\netcoreapp3.1\Views\Tabs\ChromaDeviceTabView.g.cs
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\obj\Debug\netcoreapp3.1\Views\Tabs\ChromaDeviceTabView.baml
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\obj\Debug\netcoreapp3.1\RGBController2.csproj.CoreCompileInputs.cache
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\Corale.Colore.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\Microsoft.Win32.Registry.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\System.Diagnostics.EventLog.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\System.Security.AccessControl.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\System.Security.Principal.Windows.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\System.ServiceProcess.ServiceController.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\Microsoft.Win32.Registry.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Diagnostics.EventLog.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Security.AccessControl.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.1\System.Security.Principal.Windows.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.1\System.Security.Principal.Windows.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.ServiceProcess.ServiceController.dll
C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\obj\Debug\netcoreapp3.1\RGBController2.csproj.CoreCompileInputs.cache

View File

@ -13,8 +13,8 @@ C:\Users\Conor\Desktop\RGB Contorller Tabs Test\RGBController\RGBController2\App
8-227857051
281574310649
202-997140824
203622001835
Views\Dialogs\NewTabDialogView.xaml;Views\LightingModes\AnimationView.xaml;Views\LightingModes\InformationView.xaml;Views\LightingModes\StaticView.xaml;Views\MainWindow.xaml;Views\Tabs\ArduinoTabView.xaml;Views\Tabs\ChromaDeviceTabView.xaml;Views\Tabs\CUEDeviceTabView.xaml;
True
False

View File

@ -57,6 +57,10 @@
"System.IO.Ports": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.ServiceProcess.ServiceController": {
"target": "Package",
"version": "[5.0.0, )"
}
},
"imports": [

View File

@ -75,7 +75,7 @@
}
}
},
"Microsoft.NETCore.Platforms/5.0.0-rc.2.20475.5": {
"Microsoft.NETCore.Platforms/5.0.0": {
"type": "package",
"compile": {
"lib/netstandard1.0/_._": {}
@ -84,11 +84,11 @@
"lib/netstandard1.0/_._": {}
}
},
"Microsoft.Win32.Registry/4.7.0": {
"Microsoft.Win32.Registry/5.0.0": {
"type": "package",
"dependencies": {
"System.Security.AccessControl": "4.7.0",
"System.Security.Principal.Windows": "4.7.0"
"System.Security.AccessControl": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/_._": {}
@ -97,10 +97,6 @@
"lib/netstandard2.0/Microsoft.Win32.Registry.dll": {}
},
"runtimeTargets": {
"runtimes/unix/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
"assetType": "runtime",
"rid": "unix"
},
"runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll": {
"assetType": "runtime",
"rid": "win"
@ -170,6 +166,26 @@
}
}
},
"System.Diagnostics.EventLog/5.0.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.Platforms": "5.0.0",
"Microsoft.Win32.Registry": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/System.Diagnostics.EventLog.dll": {}
},
"runtime": {
"lib/netstandard2.0/System.Diagnostics.EventLog.dll": {}
},
"runtimeTargets": {
"runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll": {
"assetType": "runtime",
"rid": "win"
}
}
},
"System.Drawing.Common/5.0.0-rc.2.20475.5": {
"type": "package",
"dependencies": {
@ -219,11 +235,11 @@
}
}
},
"System.Security.AccessControl/4.7.0": {
"System.Security.AccessControl/5.0.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.Platforms": "3.1.0",
"System.Security.Principal.Windows": "4.7.0"
"Microsoft.NETCore.Platforms": "5.0.0",
"System.Security.Principal.Windows": "5.0.0"
},
"compile": {
"ref/netstandard2.0/_._": {}
@ -238,10 +254,10 @@
}
}
},
"System.Security.Principal.Windows/4.7.0": {
"System.Security.Principal.Windows/5.0.0": {
"type": "package",
"compile": {
"ref/netcoreapp3.0/_._": {}
"ref/netcoreapp3.0/System.Security.Principal.Windows.dll": {}
},
"runtime": {
"lib/netstandard2.0/System.Security.Principal.Windows.dll": {}
@ -256,6 +272,24 @@
"rid": "win"
}
}
},
"System.ServiceProcess.ServiceController/5.0.0": {
"type": "package",
"dependencies": {
"System.Diagnostics.EventLog": "5.0.0"
},
"compile": {
"ref/netstandard2.0/System.ServiceProcess.ServiceController.dll": {}
},
"runtime": {
"lib/netstandard2.0/System.ServiceProcess.ServiceController.dll": {}
},
"runtimeTargets": {
"runtimes/win/lib/netstandard2.0/System.ServiceProcess.ServiceController.dll": {
"assetType": "runtime",
"rid": "win"
}
}
}
}
},
@ -319,10 +353,10 @@
"tools/install.ps1"
]
},
"Microsoft.NETCore.Platforms/5.0.0-rc.2.20475.5": {
"sha512": "AKhVEYbvVKx5xiG76M5yIn8TzWWUMYuMaeyizohVvdyiwPa5OQwVjqwlzaKG8KDu3l6y96jWZbSCYZi54mJ63A==",
"Microsoft.NETCore.Platforms/5.0.0": {
"sha512": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==",
"type": "package",
"path": "microsoft.netcore.platforms/5.0.0-rc.2.20475.5",
"path": "microsoft.netcore.platforms/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
@ -330,20 +364,21 @@
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/netstandard1.0/_._",
"microsoft.netcore.platforms.5.0.0-rc.2.20475.5.nupkg.sha512",
"microsoft.netcore.platforms.5.0.0.nupkg.sha512",
"microsoft.netcore.platforms.nuspec",
"runtime.json",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"Microsoft.Win32.Registry/4.7.0": {
"sha512": "KSrRMb5vNi0CWSGG1++id2ZOs/1QhRqROt+qgbEAdQuGjGrFcl4AOl4/exGPUYz2wUnU42nvJqon1T3U0kPXLA==",
"Microsoft.Win32.Registry/5.0.0": {
"sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==",
"type": "package",
"path": "microsoft.win32.registry/4.7.0",
"path": "microsoft.win32.registry/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/Microsoft.Win32.Registry.dll",
@ -352,13 +387,11 @@
"lib/netstandard1.3/Microsoft.Win32.Registry.dll",
"lib/netstandard2.0/Microsoft.Win32.Registry.dll",
"lib/netstandard2.0/Microsoft.Win32.Registry.xml",
"microsoft.win32.registry.4.7.0.nupkg.sha512",
"microsoft.win32.registry.5.0.0.nupkg.sha512",
"microsoft.win32.registry.nuspec",
"ref/net46/Microsoft.Win32.Registry.dll",
"ref/net461/Microsoft.Win32.Registry.dll",
"ref/net461/Microsoft.Win32.Registry.xml",
"ref/net472/Microsoft.Win32.Registry.dll",
"ref/net472/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/Microsoft.Win32.Registry.dll",
"ref/netstandard1.3/Microsoft.Win32.Registry.xml",
"ref/netstandard1.3/de/Microsoft.Win32.Registry.xml",
@ -372,8 +405,6 @@
"ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml",
"ref/netstandard2.0/Microsoft.Win32.Registry.dll",
"ref/netstandard2.0/Microsoft.Win32.Registry.xml",
"runtimes/unix/lib/netstandard2.0/Microsoft.Win32.Registry.dll",
"runtimes/unix/lib/netstandard2.0/Microsoft.Win32.Registry.xml",
"runtimes/win/lib/net46/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/net461/Microsoft.Win32.Registry.dll",
"runtimes/win/lib/net461/Microsoft.Win32.Registry.xml",
@ -491,6 +522,32 @@
"version.txt"
]
},
"System.Diagnostics.EventLog/5.0.0": {
"sha512": "FHkCwUfsTs+/5tsK+c0egLfacUgbhvcwi3wUFWSEEArSXao343mYqcpOVVFMlcCkdNtjU4YwAWaKYwal6f02og==",
"type": "package",
"path": "system.diagnostics.eventlog/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net461/System.Diagnostics.EventLog.dll",
"lib/net461/System.Diagnostics.EventLog.xml",
"lib/netstandard2.0/System.Diagnostics.EventLog.dll",
"lib/netstandard2.0/System.Diagnostics.EventLog.xml",
"ref/net461/System.Diagnostics.EventLog.dll",
"ref/net461/System.Diagnostics.EventLog.xml",
"ref/netstandard2.0/System.Diagnostics.EventLog.dll",
"ref/netstandard2.0/System.Diagnostics.EventLog.xml",
"runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll",
"runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.xml",
"system.diagnostics.eventlog.5.0.0.nupkg.sha512",
"system.diagnostics.eventlog.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.Drawing.Common/5.0.0-rc.2.20475.5": {
"sha512": "5RZPu5QvUviulcWusr1giGW4u9zch4LBwU8OeHccKkWMxm79JiqtLHqejxlJ1jwpYT7q2G9EsjAg86QBbSJMgg==",
"type": "package",
@ -567,13 +624,14 @@
"version.txt"
]
},
"System.Security.AccessControl/4.7.0": {
"sha512": "JECvTt5aFF3WT3gHpfofL2MNNP6v84sxtXxpqhLBCcDRzqsPBmHhQ6shv4DwwN2tRlzsUxtb3G9M3763rbXKDg==",
"System.Security.AccessControl/5.0.0": {
"sha512": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==",
"type": "package",
"path": "system.security.accesscontrol/4.7.0",
"path": "system.security.accesscontrol/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/System.Security.AccessControl.dll",
@ -607,19 +665,20 @@
"runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.xml",
"runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll",
"runtimes/win/lib/uap10.0.16299/_._",
"system.security.accesscontrol.4.7.0.nupkg.sha512",
"system.security.accesscontrol.5.0.0.nupkg.sha512",
"system.security.accesscontrol.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.Security.Principal.Windows/4.7.0": {
"sha512": "ojD0PX0XhneCsUbAZVKdb7h/70vyYMDYs85lwEI+LngEONe/17A0cFaRFqZU+sOEidcVswYWikYOQ9PPfjlbtQ==",
"System.Security.Principal.Windows/5.0.0": {
"sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==",
"type": "package",
"path": "system.security.principal.windows/4.7.0",
"path": "system.security.principal.windows/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net46/System.Security.Principal.Windows.dll",
@ -661,11 +720,52 @@
"runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml",
"runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll",
"runtimes/win/lib/uap10.0.16299/_._",
"system.security.principal.windows.4.7.0.nupkg.sha512",
"system.security.principal.windows.5.0.0.nupkg.sha512",
"system.security.principal.windows.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"System.ServiceProcess.ServiceController/5.0.0": {
"sha512": "p2yX167GW1pr2DCR6cW+cBKrvhli4thckXk108faFaTPHnoudb0AYPcIPq3nmrwn7IQj9FEmjpyJlXzcOmIjjw==",
"type": "package",
"path": "system.serviceprocess.servicecontroller/5.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/net461/System.ServiceProcess.ServiceController.dll",
"lib/net461/System.ServiceProcess.ServiceController.xml",
"lib/netstandard1.4/System.ServiceProcess.ServiceController.dll",
"lib/netstandard2.0/System.ServiceProcess.ServiceController.dll",
"lib/netstandard2.0/System.ServiceProcess.ServiceController.xml",
"ref/net461/System.ServiceProcess.ServiceController.dll",
"ref/net461/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/System.ServiceProcess.ServiceController.dll",
"ref/netstandard1.4/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/de/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/es/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/fr/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/it/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/ja/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/ko/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/ru/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/zh-hans/System.ServiceProcess.ServiceController.xml",
"ref/netstandard1.4/zh-hant/System.ServiceProcess.ServiceController.xml",
"ref/netstandard2.0/System.ServiceProcess.ServiceController.dll",
"ref/netstandard2.0/System.ServiceProcess.ServiceController.xml",
"runtimes/win/lib/net461/System.ServiceProcess.ServiceController.dll",
"runtimes/win/lib/net461/System.ServiceProcess.ServiceController.xml",
"runtimes/win/lib/netstandard1.5/System.ServiceProcess.ServiceController.dll",
"runtimes/win/lib/netstandard2.0/System.ServiceProcess.ServiceController.dll",
"runtimes/win/lib/netstandard2.0/System.ServiceProcess.ServiceController.xml",
"system.serviceprocess.servicecontroller.5.0.0.nupkg.sha512",
"system.serviceprocess.servicecontroller.nuspec",
"useSharedDesignerContext.txt",
"version.txt"
]
}
},
"projectFileDependencyGroups": {
@ -674,7 +774,8 @@
"Colore >= 5.2.0",
"Extended.Wpf.Toolkit >= 4.0.1",
"System.Drawing.Common >= 5.0.0-rc.2.20475.5",
"System.IO.Ports >= 4.7.0"
"System.IO.Ports >= 4.7.0",
"System.ServiceProcess.ServiceController >= 5.0.0"
]
},
"packageFolders": {
@ -733,6 +834,10 @@
"System.IO.Ports": {
"target": "Package",
"version": "[4.7.0, )"
},
"System.ServiceProcess.ServiceController": {
"target": "Package",
"version": "[5.0.0, )"
}
},
"imports": [