|
具体问题发在了二楼,难到很简单吗?
万象客户端下载地址:http://www.sicent.com/DisplayArchive.aspx?ColID=0101&ID=623
首先说下我的代码:
配置文件 WXSetup.ini
[IPX]
本地端口=11011
远程端口=11011
[UDP]
收费机IP=
[TCP]
收费机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 编辑 ] |
|