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

@@ -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
}