Hi all.
It’s seems that the value I receive from using SystemInfo.deviceUniqueIdentifier changed after upgrading to Unity 5.6.1f1 to Unity 5.5.1f1. I’ve searched the forums and found some (old and new) topics on the same issue concerning Android (see: Unique Identifier Details - Unity Engine - Unity Discussions).
However this fix doesn’t work under Windows.
My question is: can I revert to the old way (I can’t go back to 5.5 though).
Also: Is there a way to read out the default Windows UUID (for instance: wmic csproduct get “UUID” in CMD).
Cheers!
For those wondering how to read out the Windows UUID through the registry. This code looks for the UUID in the HKEY_LOCAL_MACHINE / SYSTEM / HardwareConfig / LastConfig, which provides the same value as wmic csproduct get “UUID”
using Microsoft.Win32;
using System;
private string GetWindowsUUID()
{
string UUID = "";
try
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey("SYSTEM\\HardwareConfig"))
{
if (key != null)
{
System.Object o = key.GetValue("LastConfig");
string tempUUID = o as string;
UUID = tempUUID.Replace("{", "").Replace("}", "").ToUpper();
}
}
} catch (Exception ex)
{
Debug.LogError("foo"); // or throw error
}
return UUID;
}
}