How to use the regedit.list function in regedit

To help you get started, we’ve selected a few regedit examples, based on popular ways it is used in public projects.

github soapdog / patchfox / scripts / check-configuration-win.js View on Github external
if (process.platform !== "win32") {
  console.log("This script works only on windows")
  process.exit(1)
}

var regedit = require('regedit')
var key = 'HKCU\\Software\\Mozilla\\NativeMessagingHosts\\patchfox'
var fs = require("fs")

regedit.list(key, (err, results) => {
  if (err) {
    console.log(`[ERROR] Registry key: ${key} doesn't exist\n\nTry: npm run setup-win\n`)
    process.exit(1)
  }

  let manifestPath = results[key].values[""].value

  if (!fs.existsSync(manifestPath)) {
    console.log("[ERROR] App manifest not found at declared location", manifestPath)
    console.log("\nTry: npm run setup-win\n")
    process.exit(1)
  }

  console.log("[INFO] App manifest path location:", manifestPath)

  let manifest = JSON.parse(fs.readFileSync(manifestPath))
github keybase / client / shared / actions / kbfs / index.platform.desktop.js View on Github external
return new Promise((resolve, reject) => {
    const regedit = require('regedit')
    const keybaseRegPath = 'HKCU\\SOFTWARE\\Keybase\\Keybase'
    try {
      regedit.list(keybaseRegPath).on('data', function(entry) {
        console.log('findKeybaseUninstallString on data')
        if (entry.data.values && entry.data.values.BUNDLEKEY) {
          const uninstallRegPath =
            'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\' +
            entry.data.values.BUNDLEKEY.value

          regedit.list(uninstallRegPath).on('data', function(entry) {
            console.log('findKeybaseUninstallString on data of', uninstallRegPath)
            if (
              entry.data.values &&
              entry.data.values.DisplayName &&
              entry.data.values.DisplayName.value === 'Keybase' &&
              entry.data.values.Publisher &&
              entry.data.values.Publisher.value === 'Keybase, Inc.' &&
              entry.data.values.ModifyPath &&
              entry.data.values.BundleCachePath
github ssbc / scuttle-shell / scripts / check-configuration.js View on Github external
function checkWin (cb) {
  var regedit = require('regedit')
  const key = APPPaths.regKey
  regedit.list(key, (err, results) => {
    if (err) {
      return cb(new Error(`Registry key: ${key} doesn't exist. `))
    }

    if (!results[key] || !results[key].values) {
      console.warn('registry list results:', results)
      return cb(new Error(`Registry key does not contain expected values field`))
    }

    let manifestPath = results[key].values[''].value

    if (!fs.existsSync(manifestPath)) {
      return cb(new Error('App manifest not found at declared location:' + manifestPath))
    }

    let applicationLauncherPath
github ssbc / scuttle-shell / scripts / check-configuration-win.js View on Github external
function check (cb) {
  if (process.platform !== 'win32') {
    return cb(new Error('This script works only on windows'))
  }

  regedit.list(key, (err, results) => {
    if (err) {
      return cb(new Error(`Registry key: ${key} doesn't exist. `))
    }

    if (!results[key] || !results[key].values) {
      console.warn('registry list results:', results)
      return cb(new Error(`Registry key does not contain expected values field`))
    }

    let manifestPath = results[key].values[''].value

    if (!fs.existsSync(manifestPath)) {
      return cb(new Error('App manifest not found at declared location:' + manifestPath))
    }

    let applicationLauncherPath
github microsoft / azure-pipelines-tasks / Tasks / VsTest / taskinputparser.ts View on Github external
export function isDontShowUIRegKeySet(regPath: string): Q.Promise<boolean> {
    const defer = Q.defer<boolean>();
    const regValue = 'DontShowUI';
    regedit.list(regPath).on('data', (entry) => {
        if (entry && entry.data && entry.data.values &&
            entry.data.values[regValue] && (entry.data.values[regValue].value === 1)) {
            defer.resolve(true);
        }
        defer.resolve(false);
    });
    return defer.promise;
}
github dreamnettech / dreamtime / src / electron / tools / shell.js View on Github external
return new Promise((resolve) => {
      if (!is.windows) {
        resolve(true)
        return
      }

      const regKey = 'HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\WindowsFeatures'

      regedit.list(regKey, (err, result) => {
        if (!_.isNil(err)) {
          resolve(false)
          return
        }

        resolve(result[regKey].keys.includes('WindowsMediaVersion'))
      })
    })
  },
github imweb / lan-settings / lib / win32 / index.js View on Github external
return new Promise((resolve, reject) => {
    regedit.list(SETTINGS_PATH, (err, result) => {
      if (err) {
        return reject(err);
      }
      result = result && result[SETTINGS_PATH];
      result = result && result.values;
      result = result && result[SETTINGS_KEY];
      resolve(util.parseSettings(result && result.value));
    });
  });
}
github microsoft / azure-pipelines-tasks / Tasks / VsTestV2 / taskinputparser.ts View on Github external
export function isDontShowUIRegKeySet(regPath: string): Q.Promise<boolean> {
    const defer = Q.defer<boolean>();
    const regValue = 'DontShowUI';
    regedit.list(regPath).on('data', (entry) => {
        if (entry && entry.data && entry.data.values &&
            entry.data.values[regValue] && (entry.data.values[regValue].value === 1)) {
            defer.resolve(true);
        }
        defer.resolve(false);
    });
    return defer.promise;
}

regedit

Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis

Similar packages