-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf11d0b
commit b1cb008
Showing
1 changed file
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | ||
; #Warn ; Enable warnings to assist with detecting common errors. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | ||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | ||
|
||
; Set the new running directory,当前为 weasel-0.15.0 的默认安装目录 | ||
NewRunningDir := "C:\Program Files (x86)\Rime\weasel-0.15.0" | ||
|
||
; 脚本启动即检测「小狼毫算法服务」是否运行,未运行即手动启动 | ||
Process, Exist, WeaselServer.exe | ||
NewPID := ErrorLevel ; 由于 ErrorLevel 会经常发生改变, 所以要立即保存这个值. | ||
if not NewPID | ||
{ | ||
Run %A_WorkingDir%\WeaselServer.exe | ||
} | ||
StartWeaselServer(NewRunningDir) | ||
; 脚本休眠 30 秒 | ||
Sleep, 30000 | ||
; 休眠过后,第二次检测「小狼毫算法服务」是否运行 | ||
Process, Exist, WeaselServer.exe | ||
NewPID := ErrorLevel ; 由于 ErrorLevel 会经常发生改变, 所以要立即保存这个值. | ||
if not NewPID | ||
{ | ||
Run %A_WorkingDir%\WeaselServer.exe | ||
} | ||
StartWeaselServer(NewRunningDir) | ||
return | ||
|
||
StartWeaselServer(RunningDir) { | ||
Process, Exist, WeaselServer.exe | ||
NewPID := ErrorLevel ; 由于 ErrorLevel 会经常发生改变, 所以要立即保存这个值. | ||
if not NewPID | ||
{ | ||
Run, %RunningDir%\WeaselServer.exe | ||
} | ||
} |