A Microsoft platform for building and publishing apps for Windows devices.
Hi @Anjali Narvekar ,
Thanks for reaching out.
The currently recommended API is
SystemIdentification.GetSystemIdForPublisher()
from the Windows.System.Profile namespace.
→ Official method documentation: https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentification.getsystemidforpublisher
This has emerged as the preferred choice:
- It generates a stable, device-bound ID that is scoped to your publisher (all apps published by you on the same device will see the same ID; apps from other publishers will see completely different values).
→ Explanation of publisher scoping & uniqueness: https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentification.getsystemidforpublisher#remarks - The ID survives most real-world changes: app reinstalls, Windows upgrades, restarts, and — in the majority of cases — even full clean installs of Windows.
→ Persistence / durability documented here: https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentification.getsystemidforpublisher#remarks - It is generated from the most stable sources the system can access (in priority order):
- TPM (Trusted Platform Module) → highest stability
- UEFI firmware → still very reliable
- Registry fallback → least persistent (can change after a clean Windows install or major reset)
→ Detailed explanation of each source (Tpm, Uefi, Registry): https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentificationsource
You should always check the .Source property to understand how trustworthy the ID is on that particular machine.
Here’s a simple code sample:
using Windows.System.Profile;
using Windows.Security.Cryptography;
var info = SystemIdentification.GetSystemIdForPublisher();
if (info == null || info.Source == SystemIdentificationSource.None)
{
// Rare case — treat as new/unknown device
return null;
}
string deviceId = CryptographicBuffer.EncodeToHexString(info.Id);
// or: string deviceId = Convert.ToBase64String(info.Id.ToArray());
string source = info.Source.ToString(); // "Tpm", "Uefi", or "Registry"
// Typically send both deviceId + source to your server
- If Source is Tpm or Uefi → treat the ID as highly reliable and use it as the main license key
- If Source is Registry → treat it as temporary (consider allowing a one-time reactivation or additional verification)
→ Guidance on handling different sources: https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.systemidentification.getsystemidforpublisher#remarks
It’s far too sensitive to driver updates, CPU microcode patches, storage controller changes, etc.
→ HardwareIdentification class reference (notice the reduced recommendation): https://learn.microsoft.com/en-us/uwp/api/windows.system.profile.hardwareidentification
Give it a try on a few different machines (ones with TPM and some older ones without) and check what. values you’re getting. If anything looks unexpected (e.g., mostly falling back to Registry or IDs changing unexpectedly), just reply with more details (Windows build, device type, Source value) and I’ll help dig deeper.
Hope this clears things up and gives you a solid path forward!