registry fixes

This commit is contained in:
Eugene Pankov 2019-03-02 17:44:02 +01:00
parent 04d621d62b
commit ef4e1e5a0d
7 changed files with 18 additions and 18 deletions

View File

@ -47,7 +47,7 @@
"node-pty": "^0.8.0", "node-pty": "^0.8.0",
"ps-node": "^0.1.6", "ps-node": "^0.1.6",
"runes": "^0.4.2", "runes": "^0.4.2",
"windows-native-registry": "^1.0.4" "windows-native-registry": "^1.0.6"
}, },
"optionalDependencies": { "optionalDependencies": {
"macos-native-processlist": "^1.0.0", "macos-native-processlist": "^1.0.0",

View File

@ -1,6 +1,6 @@
import * as path from 'path' import * as path from 'path'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { getRegistryValue } from 'windows-native-registry' import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core' import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api' import { ShellProvider, IShell } from '../api'
@ -18,7 +18,7 @@ export class Cygwin32ShellProvider extends ShellProvider {
return [] return []
} }
let cygwinPath = getRegistryValue('HKLM', 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir') let cygwinPath = getRegistryValue(HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) { if (!cygwinPath) {
return [] return []

View File

@ -1,6 +1,6 @@
import * as path from 'path' import * as path from 'path'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { getRegistryValue } from 'windows-native-registry' import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core' import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api' import { ShellProvider, IShell } from '../api'
@ -18,7 +18,7 @@ export class Cygwin64ShellProvider extends ShellProvider {
return [] return []
} }
let cygwinPath = getRegistryValue('HKLM', 'Software\\Cygwin\\setup', 'rootdir') let cygwinPath = getRegistryValue(HK.LM, 'Software\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) { if (!cygwinPath) {
return [] return []

View File

@ -1,6 +1,6 @@
import * as path from 'path' import * as path from 'path'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { getRegistryValue } from 'windows-native-registry' import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core' import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api' import { ShellProvider, IShell } from '../api'
@ -18,10 +18,10 @@ export class GitBashShellProvider extends ShellProvider {
return [] return []
} }
let gitBashPath = getRegistryValue('HKLM', 'Software\\GitForWindows', 'InstallPath') let gitBashPath = getRegistryValue(HK.LM, 'Software\\GitForWindows', 'InstallPath')
if (!gitBashPath) { if (!gitBashPath) {
gitBashPath = getRegistryValue('HKCU', 'Software\\GitForWindows', 'InstallPath') gitBashPath = getRegistryValue(HK.CU, 'Software\\GitForWindows', 'InstallPath')
} }
if (!gitBashPath) { if (!gitBashPath) {

View File

@ -1,5 +1,5 @@
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { getRegistryValue } from 'windows-native-registry' import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core' import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api' import { ShellProvider, IShell } from '../api'
@ -16,7 +16,7 @@ export class PowerShellCoreShellProvider extends ShellProvider {
return [] return []
} }
const pwshPath = getRegistryValue('HKLM', 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '') const pwshPath = getRegistryValue(HK.LM, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '')
if (!pwshPath) { if (!pwshPath) {
return [] return []

View File

@ -1,7 +1,7 @@
import * as fs from 'mz/fs' import * as fs from 'mz/fs'
import slug from 'slug' import slug from 'slug'
import { getRegistryKey, listRegistrySubkeys } from 'windows-native-registry' import { getRegistryKey, listRegistrySubkeys, HK } from 'windows-native-registry'
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'terminus-core' import { HostAppService, Platform } from 'terminus-core'
@ -36,7 +36,7 @@ export class WSLShellProvider extends ShellProvider {
}] }]
const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss' const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss'
let lxss = getRegistryKey('HKCU', lxssPath) let lxss = getRegistryKey(HK.CU, lxssPath)
if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) { if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
if (await fs.exists(bashPath)) { if (await fs.exists(bashPath)) {
return [{ return [{
@ -52,8 +52,8 @@ export class WSLShellProvider extends ShellProvider {
return [] return []
} }
} }
for (let child of listRegistrySubkeys('HKCU', lxssPath)) { for (let child of listRegistrySubkeys(HK.CU, lxssPath)) {
let childKey = getRegistryKey('HKCU', lxssPath + '\\' + child) let childKey = getRegistryKey(HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName) { if (!childKey.DistributionName) {
continue continue
} }

View File

@ -239,10 +239,10 @@ uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
windows-native-registry@^1.0.4: windows-native-registry@^1.0.6:
version "1.0.4" version "1.0.6"
resolved "https://registry.yarnpkg.com/windows-native-registry/-/windows-native-registry-1.0.4.tgz#95cf1b9eb4d7a00fc7fe8299ac530d9d87c40b06" resolved "https://registry.yarnpkg.com/windows-native-registry/-/windows-native-registry-1.0.6.tgz#6271cef068ffb432337751fc1f971a25187cd8d5"
integrity sha512-RVjg0af8EXYypw452jQzrhkvg0Lh3IXTrE7NZjAuLq+j1Hwey43AZigWb5eecOoXUIs0rGVMqC8wea7khWwKbw== integrity sha512-GTu4yRg4FOThNbBkuP/OeTOt8kZm+nTNCoZjmIol0HFefXoYCkzBZX0METJYZLL0nbgis+QzqRhJAKkMfy/VDA==
dependencies: dependencies:
nan "^2.12.1" nan "^2.12.1"