Skip to content

Instantly share code, notes, and snippets.

@fasterthanlime
Created May 7, 2017 13:32
Show Gist options
  • Select an option

  • Save fasterthanlime/b85801149e409770b23d331c282002c7 to your computer and use it in GitHub Desktop.

Select an option

Save fasterthanlime/b85801149e409770b23d331c282002c7 to your computer and use it in GitHub Desktop.
const {Key, registry, windef} = require("windows-registry");
let key;
try {
const path = "SOFTWARE\\Wow6432Node\\Microsoft\\XNA\\Framework\\v4.0";
key = registry.openKeyFromPredefined(windef.HKEY.HKEY_LOCAL_MACHINE, path, windef.KEY_ACCESS.KEY_QUERY_VALUE);
const valBuf = registry.queryValueForKeyObject(key, "Refresh1Installed");
console.log("RefreshInstalled", valBuf.readInt32LE());
} finally {
if (key && key.handle) {
key.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment