diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-01-10 06:41:57 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-01-10 06:41:57 +0300 |
commit | 86efcd95b92631e636aa6fc14bac66945eab2ea3 (patch) | |
tree | 8ee997d6a090c973994745430b5b2fd31bc9bb69 /bin | |
parent | 26da1ac37e057bf0b18a6b94dedeec9ec151ae99 (diff) |
Remove windows-no-runnable
Fixes #440
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cmd.js | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -389,26 +389,32 @@ function runDownload (torrentId) { var cmd if (argv.vlc && process.platform === 'win32') { - var registry = require('windows-no-runnable').registry + var Registry = require('winreg') + var key if (process.arch === 'x64') { - try { - key = registry('HKLM/Software/Wow6432Node/VideoLAN/VLC') - } catch (e) {} + key = new Registry({ + hive: Registry.HKLM, + key: '\\Software\\Wow6432Node\\VideoLAN\\VLC' + }) } else { - try { - key = registry('HKLM/Software/VideoLAN/VLC') - } catch (err) {} + key = new Registry({ + hive: Registry.HKLM, + key: '\\Software\\VideoLAN\\VLC' + }) } if (key) { - var vlcPath = key.InstallDir.value + path.sep + 'vlc' - VLC_ARGS = VLC_ARGS.split(' ') - VLC_ARGS.unshift(href) - cp.execFile(vlcPath, VLC_ARGS, function (err) { + key.get('InstallDir', function (err, item) { if (err) return fatalError(err) - torrentDone() - }).unref() + var vlcPath = item.value + path.sep + 'vlc' + VLC_ARGS = VLC_ARGS.split(' ') + VLC_ARGS.unshift(href) + cp.execFile(vlcPath, VLC_ARGS, function (err) { + if (err) return fatalError(err) + torrentDone() + }).unref() + }) } } else if (argv.vlc) { var root = '/Applications/VLC.app/Contents/MacOS/VLC' |