Search code examples
uwpvirtual-machineuniqueidentifier

UWP GetSystemIdForPublisher Reset registry Source


I have an UWP App that uses the GetSystemIdForPublisher API to get an Unique ID. A customer of ours uses the App in Virtual Machines, so is getting IDs based on the Registry.

The problem is that the customer had to create new work stations, so he just cloned the existing VM to create new ones faster. So now, all the VMs are retrieving the same ID.

Does anyone know how to reset this value in the registry, so the VM starts generating different IDs? I did not find any information in the Docs specifying where in the registry this is stored.


Solution

  • Does anyone know how to reset this value in the registry, so the VM starts generating different IDs? I did not find any information in the Docs specifying where in the registry this is stored.

    I'm afraid, you could not approach by this way, derive from GetSystemIdForPublisher document

    The method will first attempt to use the Trusted Platform Module (TPM), if present, to get an ID. If a TPM is not present, the method will try to get an ID from the Unified Extensible Firmware Interface (UEFI). If neither of these sources is available, this method will return an ID that is backed by the Windows registry. In the case of the Windows registry, the ID will not satisfy all the above guarantees. For example, if a system does not have a TPM or UEFI support, and thus an ID was obtained from the registry, a clean install of Windows will result in a new, different ID being returned. Callers of this method should refer to the Source property of the returned SystemIdentificationInfo to determine where the ID was obtained from in order to understand the guarantees provided.

    But you cloned the existing VM that can't make it's clean install, I'm afraid you can't get unique for this system.

    I did not find any information in the Docs specifying where in the registry this is stored.

    The registry is system level, and there is no document to explain it clearly, for this scenario, the better way is make clean install for the new VM.