uuid(): fixed hardware uuid different platforme (win)
This commit is contained in:
parent
40366de1a9
commit
15b8bd97b5
@ -1123,7 +1123,11 @@ echo -n "hardware: "; sysctl -n kern.hostuuid; echo;`;
|
||||
});
|
||||
}
|
||||
if (_windows) {
|
||||
exec('%windir%\\System32\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid', util.execOptsWin, function (error, stdout) {
|
||||
let sysdir = '%windir%\\System32';
|
||||
if (process.arch === 'ia32' && Object.prototype.hasOwnProperty.call(process.env, 'PROCESSOR_ARCHITEW6432')) {
|
||||
sysdir = '%windir%\\sysnative\\cmd.exe /c %windir%\\System32';
|
||||
}
|
||||
exec(`${sysdir}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`, util.execOptsWin, function (error, stdout) {
|
||||
parts = stdout.toString().split('\n\r')[0].split('REG_SZ');
|
||||
result.os = parts.length > 1 ? parts[1].replace(/\r+|\n+|\s+/ig, '').toLowerCase() : '';
|
||||
util.wmic('csproduct get /value').then((stdout) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user