MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
794 stars 118 forks source link

MacAddress changes #75

Open AlexHolly opened 1 year ago

AlexHolly commented 1 year ago

Related: https://github.com/MatthewKing/DeviceId/issues/67 version: 6.4.0

I encountered an issue with AddMacAddress and setting the excludeWireless is not helping.

After installing Windows Updates the deviceId changed so I investigated a little bit.

The resulting devideId is changing in case of:

  1. Windows Update (driver updates?)
  2. Enable/Disable Bluetooth also changes the results even with excludeWireless: true

Is there a way to improve it so it will use the Mainboard NetworkAdapter or first LanAdapter found and return the Physical Address always?

MatthewKing commented 1 year ago

Yep, this is definitely possible, and it's something I'd like to do in the future - the MAC address component(s) have a few problems with edge cases. However, I'm reluctant to make the changes in v6 because that will break backwards compatibility with any existing device identifiers. Maybe in version 7...

Until then, it's really easy to create your own custom version of the MAC address component and add it to your project.. You can just copy+paste the existing MacAddressDeviceIdComponent (or the WMI/MMI alternatives) into your project, make the changes you want, and then add it to your DeviceIdBuilder via AddComponent.