Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-01-10 06:41:57 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-10 06:41:57 +0300
commit86efcd95b92631e636aa6fc14bac66945eab2ea3 (patch)
tree8ee997d6a090c973994745430b5b2fd31bc9bb69 /bin
parent26da1ac37e057bf0b18a6b94dedeec9ec151ae99 (diff)
Remove windows-no-runnable
Fixes #440
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js32
1 files changed, 19 insertions, 13 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 8d5de17..f427567 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -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'