diff --git a/lib/shadowsocks.js b/lib/shadowsocks.js index 807b197..8d68273 100644 --- a/lib/shadowsocks.js +++ b/lib/shadowsocks.js @@ -11,9 +11,9 @@ exports.require = global.require; var arch = SYS.getArch(); if(arch.indexOf("64") > -1) { - exports.binPath = "bin/shadowsocks-lib-mingw-x86_64/ss-local"; + exports.binPath = "bin/shadowsocks-lib-mingw-x86_64/ss-local.exe"; } else { - exports.binPath = "bin/shadowsocks-lib-mingw-x86/ss-local"; + exports.binPath = "bin/shadowsocks-lib-mingw-x86/ss-local.exe"; } exports.getRandomInt = function(min, max) { diff --git a/lib/wintap.js b/lib/wintap.js new file mode 100644 index 0000000..ab9f8b8 --- /dev/null +++ b/lib/wintap.js @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////// +// WindowsTAP API +//////////////////////////////////////////////////////////////////////// + +var SHELL = require("lib/shell"); +var SYS = require("lib/system"); + +exports.VERSIONINFO = "WindowsTAP Lib (wintap.js) version 0.1"; +exports.global = global; +exports.require = global.require; + +var arch = SYS.getArch(); +if(arch.indexOf("64") > -1) { + exports.binPath = "bin/tap-windows-9.24.2/amd64/tapinstall.exe"; +} else { + exports.binPath = "bin/tap-windows-9.24.2/i386/tapinstall.exe"; +} + +exports.install = function(inf, id) { + return SHELL.exec([exports.binPath, "install", inf, id]); +}; + +exports.update = function(inf, id) { + return SHELL.exec([exports.binPath, "update", inf, id]); +}; + +exports.query = function(id) { + return SHELL.exec([exports.binPath, "hwids", id]); +}; + +exports.remove = function(id) { + return SHELL.exec([exports.binPath, "remove", id]); +};