|
发表于 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 安装","","[CLASSNN:Button4]","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 安装","","[CLASSNN:Edit1]","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","[CLASSNN:Edit2]","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","[CLASSNN:Edit3]","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","[CLASSNN:Edit4]","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","[CLASSNN:Edit5]","XXXXX")
While ControlCommand("Microsoft Office 2003 安装","","[CLASSNN:Button1]","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 安装","","[CLASSNN:Button5]","Check","")
ControlSetText("Microsoft Office 2003 安装","","[CLASSNN:RichEdit20W1]",@ProgramFilesDir & "\Microsoft Office\")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","请选择要安装的 Microsoft Office 2003 应用程序")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button1]","Check","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button2]","Check","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button3]","Check","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button4]","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button5]","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button6]","Check","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button7]","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","[CLASSNN:Button8]","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 |
|