chenjt819 发表于 2009-7-16 12:58:36

自动安装出问题了。谁帮我看看代码哪里有错。

本帖最后由 chenjt819 于 2009-7-19 11:48 编辑

office2003哪里出错了?
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('C:\Documents and Settings\Administrator\桌面\tools\Office2003.exe')
WinWait("Microsoft Office 2003 安装","Microsoft Office Pro")
If Not WinActive("Microsoft Office 2003 安装","Microsoft Office Pro") Then WinActivate("Microsoft Office 2003 安装","Microsoft Office Pro")
WinWaitActive("Microsoft Office 2003 安装","Microsoft Office Pro")
Send("{TAB}{TAB}{TAB}{ALTDOWN}n{ALTUP}{ALTDOWN}o{ALTUP}{TAB}{TAB}{TAB}{ALTDOWN}n{ALTUP}{ALTDOWN}i{ALTUP}")
WinWait("Microsoft Office 2003 安装","Microsoft Office 200")
If Not WinActive("Microsoft Office 2003 安装","Microsoft Office 200") Then WinActivate("Microsoft Office 2003 安装","Microsoft Office 200")
WinWaitActive("Microsoft Office 2003 安装","Microsoft Office 200")
Send("{ALTDOWN}f{ALTUP}")

lc_lichuan 发表于 2009-7-16 13:26:50

把代码复制出来

lc_lichuan 发表于 2009-7-16 13:34:36

还有发个错误的截图最好

shardineblog 发表于 2009-7-17 11:31:11

晕。原来下载这里的附件也要收费啊~。。。恼火。。。

registered 发表于 2009-7-17 12:34:35

Func setup_office2003()
;BlockInput(1)
Run("office11/setup.exe")
If @error Then Return
WinWaitActive("Microsoft Office 2003 安装","")
If WinExists("Microsoft Office 2003 安装","维护模式选项") Then
   ControlCommand ("Microsoft Office 2003 安装","","","Check","")
   Send("!n")
   WinWaitActive("Microsoft Office 2003 安装","是否确认要从本机上删除")
   Send("!y")
   WinWaitActive("Microsoft Office 2003 安装","已从本机上删除")
   Send("{ENTER}")
   Run("office11/setup.exe")
EndIf
WinWaitActive("Microsoft Office 2003 安装","产品密钥")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
While ControlCommand("Microsoft Office 2003 安装","","","IsEnabled","")
   Send("!n")
WEnd
WinWaitActive("Microsoft Office 2003 安装","用户信息")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","最终用户许可协议")
Send("!a")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","安装类型")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlSetText("Microsoft Office 2003 安装","","",@ProgramFilesDir & "\Microsoft Office\")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","请选择要安装的 Microsoft Office 2003 应用程序")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
Sleep("500")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","请选择应用程序和工具的安装选项")
Send("{SPACE}{DOWN 2}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN}{RIGHT}")
Send("{DOWN}{RIGHT}")
Send("{DOWN}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 10}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 7}{RIGHT}")
Send("{DOWN 9}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 4}{SPACE}{DOWN 4}{ENTER}")

Send("!n")
WinWaitActive("Microsoft Office 2003 安装","摘要")
Send("!i")
WinWaitActive("Microsoft Office 2003 安装","安装已完成")
Send("!f")
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office Word 2003.lnk",@DesktopDir & "\",9)
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office Excel 2003.lnk",@DesktopDir & "\",9)
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office PowerPoint 2003.lnk",@DesktopDir & "\",9)
RunWait("Office2003SP3-KB923618-FullFile-CHS.exe /q")
BlockInput(0)
EndFunc

tnt844 发表于 2009-7-30 00:47:02

用的是2007,2003也是精简的,难于一起研究了。

lc_lichuan 发表于 2009-7-30 07:58:01

截图截图呀,形象点

hcy168 发表于 2009-7-30 12:16:33

不错啊,支持下楼主吧!
页: [1]
查看完整版本: 自动安装出问题了。谁帮我看看代码哪里有错。