How to use the registry-js.HKEY.HKEY_CURRENT_USER function in registry-js

To help you get started, we’ve selected a few registry-js 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 desktop / desktop / app / src / lib / editors / win32.ts View on Github external
function getRegistryKeys(
  editor: ExternalEditor
): ReadonlyArray<{ key: HKEY; subKey: string }> {
  switch (editor) {
    case ExternalEditor.Atom:
      return [
        {
          key: HKEY.HKEY_CURRENT_USER,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\atom',
        },
      ]
    case ExternalEditor.AtomBeta:
      return [
        {
          key: HKEY.HKEY_CURRENT_USER,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\atom-beta',
        },
      ]
    case ExternalEditor.AtomNightly:
      return [
        {
          key: HKEY.HKEY_CURRENT_USER,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\atom-nightly',
        },
      ]
    case ExternalEditor.VisualStudioCode:
      return [
        // 64-bit version of VSCode (user) - provided by default in 64-bit Windows
        {
github desktop / desktop / app / src / lib / editors / win32.ts View on Github external
key: HKEY.HKEY_LOCAL_MACHINE,
          subKey:
            'SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1',
        },
      ]
    case ExternalEditor.VisualStudioCodeInsiders:
      return [
        // 64-bit version of VSCode (user) - provided by default in 64-bit Windows
        {
          key: HKEY.HKEY_CURRENT_USER,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{217B4C08-948D-4276-BFBB-BEE930AE5A2C}_is1',
        },
        // 32-bit version of VSCode (user)
        {
          key: HKEY.HKEY_CURRENT_USER,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{26F4A15E-E392-4887-8C09-7BC55712FD5B}_is1',
        },
        // 64-bit version of VSCode (system) - was default before user scope installation
        {
          key: HKEY.HKEY_LOCAL_MACHINE,
          subKey:
            'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1',
        },
        // 32-bit version of VSCode (system)
        {
          key: HKEY.HKEY_LOCAL_MACHINE,
          subKey:
            'SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1',
        },
      ]
github desktop / desktop / app / src / lib / shells / win32.ts View on Github external
async function findHyper(): Promise {
  const hyper = enumerateValues(
    HKEY.HKEY_CURRENT_USER,
    'Software\\Classes\\Directory\\Background\\shell\\Hyper\\command'
  )

  if (hyper.length === 0) {
    return null
  }

  const first = hyper[0]
  if (first.type === RegistryValueType.REG_SZ) {
    // Registry key is structured as "{installationPath}\app-x.x.x\Hyper.exe" "%V"

    // This regex is designed to get the path to the version-specific Hyper.
    // commandPieces = ['"{installationPath}\app-x.x.x\Hyper.exe"', '"', '{installationPath}\app-x.x.x\Hyper.exe', ...]
    const commandPieces = first.data.match(/(["'])(.*?)\1/)
    const localAppData = process.env.LocalAppData
github bytedance / debugtron / src / main / win.ts View on Github external
async readApps() {
    const items = [
      ...this.enumRegeditItems(
        HKEY.HKEY_LOCAL_MACHINE,
        'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
      ),
      ...this.enumRegeditItems(
        HKEY.HKEY_LOCAL_MACHINE,
        'Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
      ),
      ...this.enumRegeditItems(
        HKEY.HKEY_CURRENT_USER,
        'Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall',
      ),
    ]
    return Promise.all(
      items.map(itemValues => this.getAppInfoFromRegeditItemValues(itemValues)),
    )
  }

registry-js

A simple and opinionated library for working with the Windows registry

MIT
Latest version published 3 months ago

Package Health Score

73 / 100
Full package analysis

Similar packages