Search Issue Tracker

Fixed in 5.6.0

Votes

15

Found in

5.3.5f1

Issue ID

826298

Regression

No

SystemInfo.deviceUniqueIdentifier changes after pluging in flash drive

Windows Standalone

-

To reproduce:
1. Open attached project
2. Run gen scene
3. Copy the string from the console
4. Close editor
5. Plug in flash drive
6. Open attached project and run scene
7. Notice that SystemInfo.deviceUniqueIdentifier has changed

Reproducible: 5.5.0b1, 5.4.0p4, 5.3.6p3, 5.1.5f1

Comments (9)

  1. itami64

    Jun 27, 2017 01:29

    it's fixed, sorry my fault I was using Unity version below 5.6! IT"S WORKING FINE <3 :)

  2. itami64

    Jun 27, 2017 01:11

    still not fixed... damn you unity :(

  3. Promet

    Apr 27, 2017 13:03

    Unfortunately this issue is not fixed and still exists in Unity 5.6 (v5.6.03f).

  4. neil_digimania

    Mar 04, 2017 22:47

    @JONAU, how would you get that working from within Unity?

    I've modified your LINQPad snippet to work as a static class within my project. To fix the dependency issues, I've copied the DLLs for System.Configuration.Install, System.Management and System.Windows.Forms to my Unity Assets/Plugins folder and configured them for the Windows Editor and Windows Standalone builds.

    The code compiles and runs, but it throws a NotImplementedException at "new ManagementObjectSearcher("SELECT SerialNumber FROM Win32_BaseBoard")".

  5. JonAU

    Feb 02, 2017 01:35

    I've created a LINQPad snippet here: http://share.linqpad.net/vwp4td.linq

    What I've done is generate a MD5 hash using the same things Unity does but excluding removable/external/usb drives.

    NOTE: The Processor UniqueId on my PC was blank.

  6. JonAU

    Feb 02, 2017 01:12

    http://stackoverflow.com/a/10018438/364111 contains a more robust solution for determining if a drive is a USB drive.

  7. JonAU

    Feb 02, 2017 01:01

    A simple fix would be to exclude drives where the Win32_DiskDrive::MediaType != "Fixed hard disk media"

    Anyone looking to roll their own solution may find the WMI Code Creator handy:
    https://www.microsoft.com/en-us/download/confirmation.aspx?id=8572

  8. neil_digimania

    Jan 23, 2017 18:47

    Please fix this issue, Unity. I think a simple, workable solution would be to remove the disk drive from the equation when calculating the deviceUniqueIdentifier hash.

    I need to use a UUID like this on three desktop platforms (Windows, MacOS and Linux), and it seems a waste of my time to have to build a custom native solution when this should already work.

  9. DeepStream

    Dec 01, 2016 19:36

    It would be very helpful if this issue could be addressed. It is confusing to our users when we ask them to remove all external drives, flash drives, etc. A simple, non-breaking solution would be to supply an argument that specifies which components are used to make the UID. If we could opt-out of including the drive serials (which change any time they are reformatted anyway), that would be much more robust.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.