|
20.9.24改进了代码,50台计算机批量测试通过,主要是增加了验证是否粘贴正确
- $hklm = "HKLM"
- If StringInStr(@OSArch, "64") Then $hklm = "HKLM64"
- $luj = RegRead($hklm & "\SOFTWARE\Shield", "InstallDir")
- If @error Then
- MsgBox(1, "错误!", "请先安装RBRX再运行本程序!!")
- Exit
- EndIf
- ProcessClose("NetReg.exe")
- ProcessClose("keymaker.1.5.exe")
- If FileExists($luj & "\NetReg.exe") Then
- Run($luj & "\NetReg.exe")
- $hWndNetReg = WinWait("[class:#32770]", "RollBack Rx", 60)
- If $hWndNetReg Then
- ControlClick($hWndNetReg, "", "Button3")
- ControlClick($hWndNetReg, "", "Button4")
- $hWndNetReg = WinWait("[class:#32770]", "离线激活 RollBack Rx", 60)
- If $hWndNetReg Then
- For $i = 1 To 10
- $jqcode = ControlGetText($hWndNetReg, "", "Edit2")
- If StringRegExp($jqcode, "\d{8}-\d{8}-\d{8}") Then ExitLoop
- Sleep(500)
- Next
- EndIf
- EndIf
- Else
- MsgBox(1, "", "RBRX似乎没有安装!")
- EndIf
- If FileExists(@ScriptDir & "\keymaker.1.5.exe") Then
- Run(@ScriptDir & "\keymaker.1.5.exe", "", @SW_HIDE)
- $hWnd = WinWait("Horizon DataSys Software [Keymaker v1.5]", "", 60)
- If $hWnd Then
- ;WinSetState($hWnd, "", @SW_HIDE)
- For $i = 1 To 10
- If $jqcode = ControlGetText($hWnd, "", "TMemo2") Then ExitLoop
- Sleep(500)
- ControlClick($hWnd, "", "TCheckBox1")
- ControlSetText($hWnd, "", "TMemo2", $jqcode)
- Next
- ControlClick($hWnd, "", "TButton5")
- For $i = 1 To 10
- $ID = ControlGetText($hWnd, "", "TMemo3")
- If StringRegExp($jqcode, "HDSYS-SM\d{4}-\d{6}-\d{6}") Then ExitLoop
- Sleep(500)
- Next
- For $i = 1 To 10
- $ActC = ControlGetText($hWnd, "", "TMemo1")
- If $ActC <> "" Then ExitLoop
- Sleep(500)
- Next
- ; Exit
- WinClose($hWnd)
- If $ActC = "" Then
- MsgBox(1, "错误", "未能取得激活码!")
- Else
- For $i = 1 To 10
- If $ID = ControlGetText($hWndNetReg, "", "Edit1") Then ExitLoop
- Sleep(500)
- ControlSetText($hWndNetReg, "", "Edit1", $ID)
- Next
- For $i = 1 To 10
- If $ActC = ControlGetText($hWndNetReg, "", "Edit3") Then ExitLoop
- Sleep(500)
- ControlSetText($hWndNetReg, "", "Edit3", $ActC)
- Next
-
- ControlClick($hWndNetReg, "", "Button2")
- EndIf
- EndIf
- Else
- MsgBox(1, "缺少keygen", "请拷贝keymaker.1.5.exe到本程序目录!!!")
- EndIf
复制代码 |
|