最近硬盘坏道了,没有过保,HP可给换了块新的,重装了x64版的win7,下载Tunnelier的时候意外发现,官网上有Running Tunnelier as a Windows Service条目,之前一直以为只有MyEnTunnel可以注册成Windows服务,原来通过工具可以将任何程序注册成服务。文章中提到了三个工具:
- srvany(windows Resource Kits中的工具)
- FireDaemon 一个比srvany更易用的工具
- Non-Sucking Service Manager 很多人推荐使用这个工具
下面我将介绍如何使用NSSM(Non-Sucking Service Manager)将Tunnelier注册成服务。
在命令行输入
tunnelier /?
根据上面的帮助,并结合本地环境可以使用如下命令行启动Tunnelier
"C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe" -loginOnStartup -profile="C:\Users\vangie\Documents\gfw.tlp" -hostKeyFile="C:\Users\vangie\Documents\hostkey.md5"
其中profile可以从Tunnelier中导出,hostKeyFile可以从Host Key manager中导出。
接下来下载并解压NSSM程序,以管理员身份在命令行执行如下命令注册服务
nssm install Tunnelied "C:\Program Files (x86)\Bitvise Tunnelier\Tunnelier.exe" -loginOnStartup -profile="C:\Users\vangie\Documents\gfw.tlp" -hostKeyFile="C:\Users\vangie\Documents\hostkey.md5"
其中Tunnelied是服务名称
在运行中键入services.msc打开服务,启动Tunnelied即可。

foxwoods
2011-02-16 at 02:00
现在最新的NSSM 2.7,按文章里的方式,用命令行注册服务会有问题。作者已经在代码里修复,只是没有放出最新的binary,可以下载最新的代码自己编译。
http://iain.cx/src/nssm/
Version 2.7: Installing services from the command line may not work properly if the application requires multiple arguments or if those arguments or the application itself contain spaces. The workaround is to install the service with dummy arguments and edit the registry manually. nssm does correctly run applications with multiple arguments or spaces if they are correctly listed in the registry. This will be fixed in nssm 2.8. The fix is available in git.
foxwoods
2011-02-16 at 02:09
开始我用nssm的GUI注册服务,都不好用,多亏找到你的这篇文章,发现原来是没有加 -hostKeyFile
Lihua
2011-05-21 at 04:39
[...] 2、利用 NSSM 将 Tunnelier 添加到 (A) 的 Windows 系统服务中,实现不进入桌面即可自动启动。过程可以参考这篇文章。 [...]