If FileExists("C:\Program Files\ESRI\ArcExplorer2.0\ArcExplorer.exe") Then PostReboot() Else PreReboot() EndIf Func PostReboot() Sleep(5000) Run("D:\autorun.exe", "D:\") EndFunc Func PreReboot() RunOnce() InstallArcEx() EndFunc Func RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_UTAH', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_UTAH', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc Func InstallArcEx() Run("D:\software\ae2setup.exe", "D:\software") WinWait("ArcExplorer 2.0 Installation", "Welcome!") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "IMPORTANT") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Select the directory") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Select Components") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Select the Program Folder") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Create Shortcut") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Ready") ControlClick("[LAST]", "", "Button1") WinWait("ArcExplorer 2.0 Installation", "Installation Completed!") ControlClick("[LAST]", "", "Button1") EndFunc