Client/Bootstrapper Fix: Try gathering model from BaseBoard
This commit is contained in:
@@ -8,13 +8,13 @@ namespace Disco.Client.Extensions
|
|||||||
{
|
{
|
||||||
public static class ClientServicesExtensions
|
public static class ClientServicesExtensions
|
||||||
{
|
{
|
||||||
#if DEBUG
|
//#if DEBUG
|
||||||
public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}";
|
// public const string ServicePathAuthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Authenticated/{0}";
|
||||||
public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}";
|
// public const string ServicePathUnauthenticatedTemplate = "http://WS-GSHARP:57252/Services/Client/Unauthenticated/{0}";
|
||||||
#else
|
//#else
|
||||||
public const string ServicePathAuthenticatedTemplate = "http://DISCO:9292/Services/Client/Authenticated/{0}";
|
public const string ServicePathAuthenticatedTemplate = "http://DISCO:9292/Services/Client/Authenticated/{0}";
|
||||||
public const string ServicePathUnauthenticatedTemplate = "http://DISCO:9292/Services/Client/Unauthenticated/{0}";
|
public const string ServicePathUnauthenticatedTemplate = "http://DISCO:9292/Services/Client/Unauthenticated/{0}";
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public static ResponseType Post<ResponseType>(this ServiceBase<ResponseType> Service, bool Authenticated)
|
public static ResponseType Post<ResponseType>(this ServiceBase<ResponseType> Service, bool Authenticated)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace Disco.Client.Interop
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var mSearcher = new ManagementObjectSearcher("SELECT SerialNumber, SMBIOSBIOSVersion FROM Win32_BIOS WHERE PrimaryBios=true"))
|
using (var mSearcher = new ManagementObjectSearcher("SELECT SerialNumber, Manufacturer, SMBIOSBIOSVersion FROM Win32_BIOS WHERE PrimaryBios=true"))
|
||||||
{
|
{
|
||||||
using (var mResults = mSearcher.Get())
|
using (var mResults = mSearcher.Get())
|
||||||
{
|
{
|
||||||
@@ -65,6 +65,12 @@ namespace Disco.Client.Interop
|
|||||||
DeviceHardware.SerialNumber = serialNumber.Trim();
|
DeviceHardware.SerialNumber = serialNumber.Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var manufacturer = (string)mItem.GetPropertyValue("Manufacturer");
|
||||||
|
if (DeviceHardware.Manufacturer == null && !string.IsNullOrWhiteSpace(manufacturer))
|
||||||
|
{
|
||||||
|
DeviceHardware.Manufacturer = manufacturer.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
ErrorReporting.DeviceIdentifier = DeviceHardware.SerialNumber;
|
ErrorReporting.DeviceIdentifier = DeviceHardware.SerialNumber;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -85,7 +91,7 @@ namespace Disco.Client.Interop
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var mSearcher = new ManagementObjectSearcher("SELECT Manufacturer, Model, PartOfDomain, PCSystemType, Domain FROM Win32_ComputerSystem"))
|
using (var mSearcher = new ManagementObjectSearcher("SELECT Manufacturer, Model, PCSystemType FROM Win32_ComputerSystem"))
|
||||||
{
|
{
|
||||||
using (var mResults = mSearcher.Get())
|
using (var mResults = mSearcher.Get())
|
||||||
{
|
{
|
||||||
@@ -155,17 +161,10 @@ namespace Disco.Client.Interop
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void ApplyBaseBoardInformation(this DeviceHardware DeviceHardware)
|
private static void ApplyBaseBoardInformation(this DeviceHardware DeviceHardware)
|
||||||
{
|
|
||||||
// Added 2012-11-22 G# - Lenovo IdeaPad Serial SHIM
|
|
||||||
// http://www.discoict.com.au/forum/feature-requests/2012/11/serial-number-detection-on-ideapads.aspx
|
|
||||||
if (string.IsNullOrWhiteSpace(DeviceHardware.SerialNumber) ||
|
|
||||||
(DeviceHardware.Manufacturer.Equals("LENOVO", StringComparison.OrdinalIgnoreCase) &&
|
|
||||||
(DeviceHardware.Model.Equals("S10-3", StringComparison.OrdinalIgnoreCase) // S10-3
|
|
||||||
|| DeviceHardware.Model.Equals("2957", StringComparison.OrdinalIgnoreCase)))) // S10-2
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var mSearcher = new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_BaseBoard"))
|
using (var mSearcher = new ManagementObjectSearcher("SELECT SerialNumber, Manufacturer, Model, Product FROM Win32_BaseBoard"))
|
||||||
{
|
{
|
||||||
using (var mResults = mSearcher.Get())
|
using (var mResults = mSearcher.Get())
|
||||||
{
|
{
|
||||||
@@ -173,8 +172,33 @@ namespace Disco.Client.Interop
|
|||||||
{
|
{
|
||||||
if (mItem != null)
|
if (mItem != null)
|
||||||
{
|
{
|
||||||
|
// Apply Manufacturer/Model information only if not previously found in Win32_ComputerSystem
|
||||||
|
var manufacturer = (string)mItem.GetPropertyValue("Manufacturer");
|
||||||
|
if (DeviceHardware.Manufacturer == null && !string.IsNullOrWhiteSpace(manufacturer))
|
||||||
|
{
|
||||||
|
DeviceHardware.Manufacturer = manufacturer.Trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
var model = (string)mItem.GetPropertyValue("Model");
|
||||||
|
if (DeviceHardware.Model == null && !string.IsNullOrWhiteSpace(model))
|
||||||
|
{
|
||||||
|
DeviceHardware.Model = model.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
var product = (string)mItem.GetPropertyValue("Product");
|
||||||
|
if (DeviceHardware.Model == null && !string.IsNullOrWhiteSpace(product))
|
||||||
|
{
|
||||||
|
DeviceHardware.Model = product.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Added 2012-11-22 G# - Lenovo IdeaPad Serial SHIM
|
||||||
|
// http://www.discoict.com.au/forum/feature-requests/2012/11/serial-number-detection-on-ideapads.aspx
|
||||||
var serialNumber = (string)mItem.GetPropertyValue("SerialNumber");
|
var serialNumber = (string)mItem.GetPropertyValue("SerialNumber");
|
||||||
if (!string.IsNullOrWhiteSpace(serialNumber))
|
if (!string.IsNullOrWhiteSpace(serialNumber) &&
|
||||||
|
(DeviceHardware.SerialNumber == null ||
|
||||||
|
((DeviceHardware.Manufacturer?.Equals("LENOVO", StringComparison.OrdinalIgnoreCase) ?? false) &&
|
||||||
|
((DeviceHardware.Model?.Equals("S10-3", StringComparison.OrdinalIgnoreCase) ?? false) // S10-3
|
||||||
|
|| (DeviceHardware.Model?.Equals("2957", StringComparison.OrdinalIgnoreCase) ?? false)))))
|
||||||
{
|
{
|
||||||
DeviceHardware.SerialNumber = serialNumber.Trim();
|
DeviceHardware.SerialNumber = serialNumber.Trim();
|
||||||
ErrorReporting.DeviceIdentifier = DeviceHardware.SerialNumber;
|
ErrorReporting.DeviceIdentifier = DeviceHardware.SerialNumber;
|
||||||
@@ -193,7 +217,6 @@ namespace Disco.Client.Interop
|
|||||||
throw new Exception("Disco Client was unable to retrieve BaseBoard information from WMI", ex);
|
throw new Exception("Disco Client was unable to retrieve BaseBoard information from WMI", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private static void ApplySystemProductInformation(this DeviceHardware DeviceHardware)
|
private static void ApplySystemProductInformation(this DeviceHardware DeviceHardware)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ namespace Disco.ClientBootstrapper
|
|||||||
private StringBuilder errorMessage;
|
private StringBuilder errorMessage;
|
||||||
private Process clientProcess;
|
private Process clientProcess;
|
||||||
|
|
||||||
#if DEBUG
|
//#if DEBUG
|
||||||
public const string DiscoServerName = "WS-GSHARP";
|
// public const string DiscoServerName = "WS-GSHARP";
|
||||||
public const int DiscoServerPort = 57252;
|
// public const int DiscoServerPort = 57252;
|
||||||
#else
|
//#else
|
||||||
public const string DiscoServerName = "DISCO";
|
public const string DiscoServerName = "DISCO";
|
||||||
public const int DiscoServerPort = 9292;
|
public const int DiscoServerPort = 9292;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
|
public BootstrapperLoop(IStatus StatusUI, LoopCompleteCallback Callback)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user