Skip to content

Commit 2777226

Browse files
committed
Force usage of x64 registry on x64 systems from x86 builds
Building an app for a x86 environment and running that app on an amd64 environment led to a `file not found` (aka failed to lookup relevant registry key) error. The added flag gets ignored on x86 systems, but will be followed on x64 systems. fixes denisbrodbeck#2
1 parent e59b4a9 commit 2777226

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

id_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// machineID returns the key MachineGuid in registry `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`.
1010
// If there is an error running the commad an empty string is returned.
1111
func machineID() (string, error) {
12-
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, registry.QUERY_VALUE)
12+
k, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, registry.QUERY_VALUE|registry.WOW64_64KEY)
1313
if err != nil {
1414
return "", err
1515
}

0 commit comments

Comments
 (0)