detect 32-bit Cygwin setups (fixes #106)

This commit is contained in:
Eugene Pankov 2017-07-10 18:11:47 +02:00
parent 475c4f91be
commit 6f8f83d178

View file

@ -68,11 +68,10 @@ export class TerminalSettingsTabComponent {
// Detect Cygwin
let cygwinPath = await new Promise<string>(resolve => {
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup' })
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x64' })
reg.get('rootdir', (err, item) => {
if (err) {
resolve(null)
return
return resolve(null)
}
resolve(item.value)
})
@ -81,6 +80,20 @@ export class TerminalSettingsTabComponent {
this.shells.push({ name: 'Cygwin', command: path.join(cygwinPath, 'bin', 'bash.exe') })
}
// Detect 32-bit Cygwin
let cygwin32Path = await new Promise<string>(resolve => {
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\Cygwin\\setup', arch: 'x86' })
reg.get('rootdir', (err, item) => {
if (err) {
return resolve(null)
}
resolve(item.value)
})
})
if (cygwin32Path) {
this.shells.push({ name: 'Cygwin (32 bit)', command: path.join(cygwin32Path, 'bin', 'bash.exe') })
}
// Detect Git-Bash
let gitBashPath = await new Promise<string>(resolve => {
let reg = new Registry({ hive: Registry.HKLM, key: '\\Software\\GitForWindows' })