Skip to content

Instantly share code, notes, and snippets.

@anaisbetts
Created September 17, 2016 01:06
Show Gist options
  • Save anaisbetts/41a7cfbd2c2fc198bf32801663139dc0 to your computer and use it in GitHub Desktop.
Save anaisbetts/41a7cfbd2c2fc198bf32801663139dc0 to your computer and use it in GitHub Desktop.
is64BitOperatingSystem: () => {
if (process.arch === 'x64') return true;
let sysRoot = 'C:\\Windows';
if (fs.statSyncNoException(process.env.SYSTEMROOT || 'C:\\__nothere__')) {
sysRoot = process.env.SYSTEMROOT;
}
// If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application.
return !!fs.statSyncNoException(path.join(sysRoot, 'sysnative'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment