How to use the regedit.setExternalVBSLocation 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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dreamnettech / dreamtime / src / electron / src / modules / tools / system.js View on Github external
async _hasWindowsMedia() {
    if (!is.windows) {
      return true
    }

    const version = this.os.release

    if (toInteger(version) < 10) {
      // no windows 10
      return true
    }

    if (!is.development) {
      // regedit commands
      regedit.setExternalVBSLocation(
        getAppResourcesPath('vbs'),
      )
    }

    const value = await new Promise((resolve) => {
      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 dreamnettech / dreamtime / src / electron / tools / shell.js View on Github external
hasWindowsMedia() {
    if (is.windows && !is.development) {
      regedit.setExternalVBSLocation(
        paths.getGuiResources('vbs'),
      )
    }

    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
github dreamnettech / dreamtime / src / electron / src / modules / tools / shell.js View on Github external
export const hasWindowsMedia = () => {
  if (is.windows && !is.development) {
    regedit.setExternalVBSLocation(
      getAppResourcesPath('vbs'),
    )
  }

  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

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 2 months ago

Package Health Score

71 / 100
Full package analysis