diff options
-rwxr-xr-x | bin/cmd.js | 32 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 20 insertions, 14 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' diff --git a/package.json b/package.json index aeea0bc..2346156 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "ut_metadata": "^3.0.1", "ut_pex": "^1.0.1", "videostream": "^1.1.4", - "windows-no-runnable": "0.0.6", + "winreg": "0.0.15", "xtend": "^4.0.0", "zero-fill": "^2.2.0" }, |