1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-24 19:13:31 +03:00

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",
"ps-node": "^0.1.6",
"runes": "^0.4.2",
"windows-native-registry": "^1.0.4"
"windows-native-registry": "^1.0.6"
},
"optionalDependencies": {
"macos-native-processlist": "^1.0.0",

View File

@ -1,6 +1,6 @@
import * as path from 'path'
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 { ShellProvider, IShell } from '../api'
@ -18,7 +18,7 @@ export class Cygwin32ShellProvider extends ShellProvider {
return []
}
let cygwinPath = getRegistryValue('HKLM', 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
let cygwinPath = getRegistryValue(HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []

View File

@ -1,6 +1,6 @@
import * as path from 'path'
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 { ShellProvider, IShell } from '../api'
@ -18,7 +18,7 @@ export class Cygwin64ShellProvider extends ShellProvider {
return []
}
let cygwinPath = getRegistryValue('HKLM', 'Software\\Cygwin\\setup', 'rootdir')
let cygwinPath = getRegistryValue(HK.LM, 'Software\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []

View File

@ -1,6 +1,6 @@
import * as path from 'path'
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 { ShellProvider, IShell } from '../api'
@ -18,10 +18,10 @@ export class GitBashShellProvider extends ShellProvider {
return []
}
let gitBashPath = getRegistryValue('HKLM', 'Software\\GitForWindows', 'InstallPath')
let gitBashPath = getRegistryValue(HK.LM, 'Software\\GitForWindows', 'InstallPath')
if (!gitBashPath) {
gitBashPath = getRegistryValue('HKCU', 'Software\\GitForWindows', 'InstallPath')
gitBashPath = getRegistryValue(HK.CU, 'Software\\GitForWindows', 'InstallPath')
}
if (!gitBashPath) {

View File

@ -1,5 +1,5 @@
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 { ShellProvider, IShell } from '../api'
@ -16,7 +16,7 @@ export class PowerShellCoreShellProvider extends ShellProvider {
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) {
return []

View File

@ -1,7 +1,7 @@
import * as fs from 'mz/fs'
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 { HostAppService, Platform } from 'terminus-core'
@ -36,7 +36,7 @@ export class WSLShellProvider extends ShellProvider {
}]
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 (await fs.exists(bashPath)) {
return [{
@ -52,8 +52,8 @@ export class WSLShellProvider extends ShellProvider {
return []
}
}
for (let child of listRegistrySubkeys('HKCU', lxssPath)) {
let childKey = getRegistryKey('HKCU', lxssPath + '\\' + child)
for (let child of listRegistrySubkeys(HK.CU, lxssPath)) {
let childKey = getRegistryKey(HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName) {
continue
}

View File

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