AutoIT如何制作自动化安装脚本-SketchUp 2017
生活随笔
收集整理的這篇文章主要介紹了
AutoIT如何制作自动化安装脚本-SketchUp 2017
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Global $soft_name = "SketchUp 2017"
Global $soft_path = "安裝文件所在路徑"
Global $domain = "域"
Global $admin = "用戶名"
Global $passwd = "密碼";檢查是否安裝
If RegRead("hklm64\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{36CD1188-EAD6-4AA9-B9C8-94BE4852D67B}", "UninstallString") = 'MsiExec.exe /X{36CD1188-EAD6-4AA9-B9C8-94BE4852D67B}' ThenIf MsgBox(4,"提示",$soft_name & " 已安裝,是否卸載") = 6 Thenuninstall_su2017()Else ExitEndIf
Else setup_su2017()
EndIfFunc uninstall_su2017();檢查進(jìn)程是否存在If ProcessExists("SketchUp.exe") Then ProcessClose("SketchUp.exe")If ProcessExists("Style Builder.exe") Then ProcessClose("Style Builder.exe")If ProcessExists("LayOut.exe") Then ProcessClose("LayOut.exe");卸載MsgBox(0,'提示','開始卸載 ' & $soft_name,3)Run("msiexec /x {36CD1188-EAD6-4AA9-B9C8-94BE4852D67B}")WinWait("Windows Installer")WinActivate("Windows Installer")Send("!y")WinWait("SketchUp Pro 2017 (64-bit)")WinWaitClose("SketchUp Pro 2017 (64-bit)")If MsgBox(4,"提示",$soft_name & " 已卸載,是否重新安裝") =6 Thensetup_su2017()Else ExitEndIf
EndFuncFunc setup_su2017();安裝MsgBox(0,"提示","開始自動(dòng)安裝,請(qǐng)不要操作電腦",3)RunAs($admin, $domain, $passwd, 2, $soft_path & "\SketchUpPro2017-zh-CN-x64.exe", $soft_path)Opt("WinTitleMatchMode", 2)WinWait("Extracting Installer")WinWaitClose("Extracting Installer")If WinWait("SketchUp Pro 2017-64-bit (中文-簡體中文) 安裝程序","","3") Then WinActivate("SketchUp Pro 2017-64-bit (中文-簡體中文) 安裝程序")Send("!i")EndIfWinWait("SketchUp Pro 2017 (64-bit) 安裝","歡迎使用")WinActivate("SketchUp Pro 2017 (64-bit) 安裝","歡迎使用")Send("!n")WinWait("SketchUp Pro 2017 (64-bit) 安裝","目標(biāo)文件夾")WinActivate("SketchUp Pro 2017 (64-bit) 安裝","目標(biāo)文件夾")Send("!n")WinWait("SketchUp Pro 2017 (64-bit) 安裝","準(zhǔn)備安裝")WinActivate("SketchUp Pro 2017 (64-bit) 安裝","準(zhǔn)備安裝")Send("!i")WinWait("SketchUp Pro 2017 (64-bit) 安裝","已完成")WinActivate("SketchUp Pro 2017 (64-bit) 安裝","已完成")Send("!f");激活FileCopy($soft_path & "\替換文件\SketchUp.exe","C:\Program Files\SketchUp\SketchUp 2017",1)FileCopy($soft_path & "\替換文件\LayOut\LayOut.exe", "C:\Program Files\SketchUp\SketchUp 2017\LayOut",1)FileCopy($soft_path & "\替換文件\Style Builder\Style Builder.exe", "C:\Program Files\SketchUp\SketchUp 2017\Style Builder",1)MsgBox(0,"提示",$soft_name & " 安裝完成",3) EndFunc
總結(jié)
以上是生活随笔為你收集整理的AutoIT如何制作自动化安装脚本-SketchUp 2017的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机毕设(附源码)JAVA-SSM基于
- 下一篇: android自定义日历代码,Andro