diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs | 5 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs | 32 |
2 files changed, 25 insertions, 12 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs index 301145975..19c465fb0 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/GeneralUtilities.cs @@ -123,6 +123,11 @@ namespace HandBrake.ApplicationServices.Utilities gpuBuilder.AppendLine(string.Format(" {0}", item));
}
+ if (string.IsNullOrEmpty(gpuBuilder.ToString().Trim()))
+ {
+ gpuBuilder.Append("GPU Information is unavailable");
+ }
+
logHeader.AppendLine(String.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion()));
logHeader.AppendLine(String.Format("OS: {0} - {1}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64bit" : "32bit"));
logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount));
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs index 2ea664f1a..f7e0ae0ed 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs @@ -127,27 +127,35 @@ namespace HandBrake.ApplicationServices.Utilities get
{
List<string> gpuInfo = new List<string>();
- ManagementObjectSearcher searcher = new ManagementObjectSearcher(
- "select * from " + "Win32_VideoController");
- foreach (ManagementObject share in searcher.Get())
+ try
{
- string gpu = string.Empty, version = string.Empty;
+ ManagementObjectSearcher searcher =
+ new ManagementObjectSearcher("select * from " + "Win32_VideoController");
- foreach (PropertyData PC in share.Properties)
+ foreach (ManagementObject share in searcher.Get())
{
- if (!string.IsNullOrEmpty(PC.Name) && PC.Value != null)
+ string gpu = string.Empty, version = string.Empty;
+
+ foreach (PropertyData PC in share.Properties)
{
- if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString();
- if (PC.Name.Equals("Name")) gpu = PC.Value.ToString();
+ if (!string.IsNullOrEmpty(PC.Name) && PC.Value != null)
+ {
+ if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString();
+ if (PC.Name.Equals("Name")) gpu = PC.Value.ToString();
+ }
}
- }
- if (!string.IsNullOrEmpty(gpu) && !string.IsNullOrEmpty(version))
- {
- gpuInfo.Add(string.Format("{0} - {1}", gpu, version));
+ if (!string.IsNullOrEmpty(gpu) && !string.IsNullOrEmpty(version))
+ {
+ gpuInfo.Add(string.Format("{0} - {1}", gpu, version));
+ }
}
}
+ catch (Exception)
+ {
+ // Do Nothing. We couldn't get GPU Information.
+ }
return gpuInfo;
}
|