关于在做万象客户端遇到的一个问题,高手看看!困扰我很久的问题!
具体问题发在了二楼,难到很简单吗?万象客户端下载地址:http://www.sicent.com/DisplayArchive.aspx?ColID=0101&ID=623
首先说下我的代码:
配置文件 WXSetup.ini
本地端口=11011
远程端口=11011
收费机IP=
收费机IP=
vbs代码
Set tx=CreateObject("Wscript.Shell")
Wscript.Sleep 3000
tx.SendKeys "%n"
--------------------------------
AU3代码:
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\autoit3\Aut2Exe\Icons\NSIS.ico
#AutoIt3Wrapper_outfile=wxsetup.exe
#AutoIt3Wrapper_Res_Comment=bianzk 61577962
#AutoIt3Wrapper_Res_Description=bianzk 61577962
#AutoIt3Wrapper_Res_Fileversion=1.0.0.2
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=bianzk 61577962
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
dim $Dir
dim $search
dim $ipxprot_l
dim $ipxprot_r
dim $udpserver_ip
dim $tcpserver_ip
dim $wxset
dim $regfile
FileInstall("wscript.exe", @SystemDir & "\wscript.exe")
FileInstall("wxset.vbs", @TempDir & "\wxset.vbs")
TrayTip ( "感谢您的使用", "" & "如需帮助请按 F1." & @CRLF & @CRLF & "有问题联系我,QQ:61577962.",30,1)
$Dir = @ScriptDir & "\WXSetup.ini"
If FileExists($Dir) = 0 Then
IniWrite($Dir, "IPX", "本地端口","")
IniWrite($Dir, "IPX", "远程端口","" )
IniWrite($Dir, "UDP", "收费机IP","" )
IniWrite($Dir, "TCP", "收费机IP", "")
EndIf
$ipxprot_l=IniRead($Dir, "IPX", "本地端口","")
$ipxprot_r=IniRead($Dir, "IPX", "远程端口","" )
$udpserver_ip=IniRead($Dir, "UDP", "收费机IP","" )
$tcpserver_ip=IniRead($Dir, "TCP", "收费机IP", "")
if $ipxprot_l <> "" and $ipxprot_r <> "" then $wxset= "IPX协议"
if $udpserver_ip <> "" then $wxset= "UDP协议"
if $tcpserver_ip <> "" then $wxset= "TCP/IP协议"
$search = "安装 - 万象网管客户端"
run("wxClient.exe")
Sleep(2000)
WinActivate ( $search , "欢迎使用 万象网管客户端 安装向导" )
ControlClick ($search , "欢迎使用 万象网管客户端 安装向导", "TNewButton1" , "left")
WinActivate ( $search , "许可协议" )
ControlClick ($search , "许可协议", "TNewRadioButton1" , "left")
ControlClick ($search , "许可协议", "TNewButton2" , "left")
WinActivate ( $search , "选择开始菜单文件夹" )
ControlClick ($search , "选择开始菜单文件夹", "TNewButton3" , "left")
WinActivate ( $search , "选择协议类型" )
Run("wscript.exe //b " & @TempDir & "\wxset.vbs")
ControlCommand ( $search , "选择协议类型", "TComboBox1", "SelectString", $wxset )
if $wxset = "IPX协议" then
ControlSetText ( $search , "选择协议类型", "TEdit3", $ipxprot_r )
ControlSetText ( $search , "选择协议类型", "TEdit2", $ipxprot_l )
EndIf
if $wxset = "UDP协议" then
ControlSetText ( $search , "选择协议类型", "TEdit1", $udpserver_ip )
EndIf
if $wxset = "TCP/IP协议" then
ControlSetText ( $search , "选择协议类型", "TEdit1", $tcpserver_ip )
EndIf
ControlClick ($search , "选择协议类型" , "TNewButton3" , "left")
WinActivate ( $search , "准备安装" )
ControlClick ($search , "准备安装" , "TNewButton3" , "left")
WinWait ( $search , "万象网管客户端 安装向导完成")
WinActivate ( $search , "万象网管客户端 安装向导完成" )
ControlClick ($search , "万象网管客户端 安装向导完成", "TNewRadioButton2" , "left")
ControlClick ($search , "万象网管客户端 安装向导完成" , "TNewButton3" , "left")
$search = ""
$search = FileFindFirstFile("*.reg")
While 1
$regfile = FileFindNextFile($search)
If $regfile = "" Then ExitLoop
RunWait(@ComSpec & " /c " & "regedit /s "&$regfile)
If @error Then ExitLoop
WEnd
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "InnoSetupRegFile.0000000001")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "InnoSetupRegFile.0000000002")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "InnoSetupRegFile.0000000003")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "InnoSetupRegFile.0000000004")
[ 本帖最后由 bill-0970 于 2009-4-17 17:19 编辑 ] 现在的问题是当安装到“选择协议类型”,选择IPX或UDP协议时(上边的红色代码部分)
弹出的窗口无法进行扑获,进行一下步操作!
1.WinActivate ()弹出的窗口,执行Send ( ),不可以
2.WinActivate ()弹出的窗口,执行ControlClick (),不可以
3.现在感觉弹出的窗口,根本就不能扑获!
请高手看下,并亲自试下,告诉我可行的方法!
上边的AU3调用VBS能正常运行(符合要求),但纯AU3该怎么写!
[ 本帖最后由 bill-0970 于 2009-4-13 13:56 编辑 ]
昨晚仔细的研究了下发现问题就在于
在执行此函数时
ControlCommand ( $search , "选择协议类型", "TComboBox1", "SelectString", $wxset )
弹出了提示窗口,此时脚本已经暂停了,所以后边的函数暂时不能执行,当我们在弹出的窗口选择是或否,脚本此时继续执行!
在ControlCommand ( $search , "选择协议类型", "TComboBox1", "SelectString", $wxset )
后边加上MsgBox()
就知道发现是怎么会事了
[ 本帖最后由 bill-0970 于 2009-4-13 13:57 编辑 ] 顶下,让老大们都看下! 弹出窗口的标题是“安装”? 是的!
大家试下,怎么能解决! 我倒啊,谁让你用WinActive的…… 上边使用WinActive ( ),确实有问题(但只要只有一个进程的话,不做别的操作是可以的)
使用WinActivate ( )照样不可以,我试过!
顶楼的代码红色部分
VBS,只有放在
ControlCommand ( $search , "选择协议类型", "TComboBox1", "SelectString", $wxset )
之前就可以
之后就不可以了
说明脚本在执行了
ControlCommand ( $search , "选择协议类型", "TComboBox1", "SelectString", $wxset )
弹出窗口后,就暂停了
[ 本帖最后由 bill-0970 于 2009-4-14 20:41 编辑 ] 期待中,我也研究了很久,未果。。。。 顶起,谁给个圆满的答案 怎么没有高手解决:face (36): :face (36): 顶起!
版主给个答复!到底问题出在那! 顶起!顶起!顶起!顶起! 再顶起!再顶起!再顶起! 期待高手解决
页:
[1]
2