因为经常帮助同学装机,GIS专业的软件又相当的多,编程的、专业的,每次如果要全部调试安装优化完成,一个上午都不够,因此学习了一点软件自动安装的知识,使用AutoIt脚本可以很好的方便的完成一系列重复安装的工作。才开始学习AU3脚本,不是很熟悉,方法应用可能比较笨拙,脚本也没有进行很好的测试,在此公布出来,望大家给我提点意见。
ArcGIS 9.1自动安装.au3:
Run("Crack\LMSetup.exe")
WinWaitActive("ArcGIS 9 License Manager Setup","Import License File")
ControlSetText("ArcGIS 9 License Manager Setup","","Edit1","Crack\license.lic")
ControlClick("ArcGIS 9 License Manager Setup","","Button4")
WinWaitActive("ArcGIS 9 License Manager Setup","License File Summary")
ControlClick("ArcGIS 9 License Manager Setup","","Button1")
WinWaitActive("ArcGIS 9 License Manager Setup","Installation Summary")
ControlClick("ArcGIS 9 License Manager Setup","","Button1")
WinWaitActive("ArcGIS 9 License Manager Installation","Installation Complete")
ControlClick("ArcGIS 9 License Manager Installation","","Button3")
WinWaitActive("Notice","")
Send("{ENTER}")
ControlClick("ArcGIS 9 License Manager Installation","","Button1")
FileCopy ("Crack\ARCGIS.EXE","C:\Program Files\ESRI\License\arcgis9x",1)
FileCopy ("Crack\license.lic","C:\Program Files\ESRI\License\arcgis9x",1)
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager\ArcGIS License Manager","Lmgrd","REG_SZ","C:\Program Files\ESRI\License\arcgis9x\lmgrd.exe")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager\ArcGIS License Manager","License","REG_SZ","C:\Program Files\ESRI\License\arcgis9x\license.lic")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\FLEXlm License Manager\ArcGIS License Manager","LMGRD_LOG_FILE","REG_SZ","C:\Program Files\\ESRI\License\arcgis9x\ARCGIS_LM.LOG")
RunWait("setup.exe /qr ADDLOCAL=ALL")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","SOFTWARE_CLASS","REG_SZ","Info")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","LICENSE_SERVER","REG_SZ","@localhost")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","TIMEOUTWARNING","REG_SZ","TRUE")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","SingleUse_Installed","REG_SZ","Info")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","SEAT_PREFERENCE","REG_SZ","Float")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","LMCancel","REG_SZ","TRUE")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\License","LICENSE_PATH","REG_SZ","f:\flexlm")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","TIMEOUTWARNING","REG_SZ","TRUE")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","LICENSE_SERVER","REG_SZ","@localhost")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","SingleUse_Installed","REG_SZ","Info")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","SOFTWARE_CLASS","REG_SZ","Info")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","SEAT_PREFERENCE","REG_SZ","Float")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","LMCancel","REG_SZ","TRUE")
RegWrite ("HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\RepairGIO","LICENSE_PATH","REG_SZ","f:\flexlm")
RunWait("Chinese\setup.exe")
WinWaitActive("ArcGIS9.1汉化环境安装","Welcome to the InstallShield Wizard")
ControlClick("ArcGIS9.1汉化环境安装","","Button1")
WinWaitActive("ArcGIS9.1汉化环境安装","To display your license agreement")
ControlClick("ArcGIS9.1汉化环境安装","","Button2")
WinWaitActive("ArcGIS9.1汉化环境安装","The InstallShield Wizard has successfully installed")
ControlClick("ArcGIS9.1汉化环境安装","","Button4")
ArcView 3.3自动安装.au3:
Run("SETUP.EXE -s")
;花了两个小时研究这个脚本,按网上的方法用RunWait执行“Setup.exe -s”,但是进程还没执行完它就返回值了,
;导致脚本结束,换了无数方法还是没能解决,最后还是用进程的方法判断隐藏的安装进程是否结束,希望这个进
;程名在每台机子上都是相同的,祈祷中………… 2006.12.3晚
Sleep(25000)
ProcessWaitClose("_INS0432._MP")
FileCopy("serno","C:\ESRI\AV_GIS30\ARCVIEW\ETC",1)
Erdas 8.5自动安装.au3
$dir="C:\Program Files\IMAGINE 8.5"
Run("setup.exe")
;开始安装Erdas Imagine 8.5
WinWaitActive("Welcome", "ERDAS IMAGINE 8.5")
ControlClick("Welcome", "", "Button1")
WinWaitActive("License Agreement", "ERDAS SOFTWARE LICENSE")
ControlClick("License Agreement", "", "Button1")
WinWaitActive("System Requirements", "System Requirements")
ControlClick("System Requirements", "", "Button1")
WinWaitActive("Registration Information", "Please enter the name and company")
ControlSetText("Registration Information", "", "Edit1","GIS")
ControlSetText("Registration Information", "", "Edit2","sicnu")
ControlClick("Registration Information", "", "Button1")
WinWaitActive("Setup Type", "type of Setup")
ControlClick("Setup Type", "type of Setup", "Button1")
WinWaitActive("Choose Destination", "following folder")
ControlClick("Choose Destination", "", "Button1")
WinWaitActive("Backup Replaced Files", "")
ControlClick("Backup Replaced Files", "", "Button1")
WinWaitActive("Select Components", "")
Send("+{TAB}")
Send("{DOWN 3}")
Send("{SPACE}")
Send("+{TAB}")
Send("{DOWN 4}")
For $i=1 to 7
Send("{SPACE}")
Send("{DOWN}")
Next
ControlClick("Select Components", "", "Button1")
WinWaitActive("Licensing Information", "Use Demonstration Mode")
ControlClick("Licensing Information", "", "Button5")
WinWaitActive("Demonstration Mode", "")
ControlClick("Demonstration Mode", "", "Button2")
WinWaitActive("Installation Settings", "")
ControlClick("Installation Settings", "", "Button1")
WinWaitActive("Installation Complete", "successfully installed")
ControlClick("Installation Complete", "successfully installed", "Button1")
WinWaitActive("Install", "restart this computer")
ControlClick("Install", "restart this computer", "Button3")
;完成安装
;破解
FileCopy("Crack\eraster.dll", $dir & "\bin\NTx86", 1)
FileCopy("Crack\ERDAS.exe", $dir & "\bin\NTx86", 1)
FileCopy("Crack\license.dat", $dir & "\etc", 1)
MapGIS 6.5自动安装.au3
DirCreate("C:\mapgis65\program")
AdlibEnable("Crack")
RunWait("Setup65.EXE /silent")
WinWaitActive("Readme.txt - 记事本", "欢迎您使用MAPGIS!")
WinClose("Readme.txt - 记事本", "欢迎您使用MAPGIS!")
AdlibDisable()
FileCopy("Crack\bas60.dll", "C:\mapgis65\program", 1)
FileCopy("Crack\basfile.dll", "C:\mapgis65\program", 1)
FileCopy("Crack\Basroot.dll", "C:\mapgis65\program", 1)
FileCopy("Crack\MCONFIG.GIS", "C:\mapgis65\program", 1)
FileCopy("Crack\NETCFG.GIS", "C:\mapgis65\program", 1)
Func Crack()
If FileGetSize("C:\mapgis65\program\bas60.dll")<>847872 then
FileCopy("Crack\bas60.dll", "C:\mapgis65\program", 1)
EndIf
If FileGetSize("C:\mapgis65\program\basfile.dll")<>32768 then
FileCopy("Crack\basfile.dll", "C:\mapgis65\program", 1)
EndIf
If FileGetSize("C:\mapgis65\program\Basroot.dll")<>90112 then
FileCopy("Crack\Basroot.dll", "C:\mapgis65\program", 1)
EndIf
EndFunc
MapInfo 7.0自动安装.au3
RunWait("setup.exe /s /v/qb")
;破解
FileCopy("Crack\MapInfoProLicense700.LIC", "C:\Program Files\MapInfo\Professional", 1)
文章来源:
http://www.jianghanxia.com/Blog/article.asp?id=51
转载于:https://www.cnblogs.com/jianghanxia/archive/2007/04/07/703607.html