Local $language_selection = "Chinese (Taiwan)" If (WinWaitActive("八字規劃書(試用版) 安裝程式", "安裝程式無法安裝正在使用的系統檔案,或更新正在使用的共", 7)) Then Send("!x") WinWaitActive("DNE", "", 1) Send("!x") WinWaitActive("DNE", "", 1) Send("{ENTER}") Else MsgBox(43, "Timeout", "Uh-oh") EndIf _Languages() If not (ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "GetCurrentSelection") == $language_selection) Then _prereboot() Else _postreboot() EndIf func _prereboot() ;WinClose("八字規劃書(試用版) 安裝程式", "安裝程式無法安裝正在使用的系統檔案,或更新正在使用的共") ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "SelectString", $language_selection) ControlClick("Regional and Language Options", "Advanced", "Button7") WinWait("Advanced", "skip file copying and use the existing files") ControlClick("Advanced", "skip file copying and use the existing files", "Button1") WinWait("Change Regional Options", "Do you want to restart your computer now?", 3) ControlClick("Change Regional Options", "Do you want to restart your computer now?", "Button2") ControlClick("Regional and Language Options", "Advanced", "Button5") _RunOnce() Send("!x!x{ENTER}") Shutdown(2) EndFunc Func _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, '_AMPOET', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc Func _postreboot() WinClose("Regional and Language Options") FileChangeDir("D:\") Run("D:\setup.exe") WinWaitActive("八字規劃書(試用版) 安裝程式", "安裝程式無法安裝正在使用的系統檔案,或更新正在使用的共") Send("{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式", "名稱和公司資訊") Send("John Smith{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式", "確認名稱和公司資訊") Send("{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式", "八字規劃書(試用版) 安裝程式") Send("{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式", "若要開始安裝,請按大型按鈕") Send("{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式", "八字規劃書(試用版) - 選擇程式群組") Send("{ENTER}") WinWaitActive("八字論命系統") Send("{ENTER}") WinWaitActive("八字規劃書(試用版) 安裝程式") Send("{ENTER}") FileChangeDir("C:\LIFE_PT\") Run("C:\LIFE_PT\LIFE_PT.EXE") EndFunc Func _Languages() ShellExecute("Control.exe", "C:\WINDOWS\system32\intl.cpl") WinWait("Regional and Language Options", "Regional Options") ControlCommand("Regional and Language Options", "Regional Options", "SysTabControl321", "TabRight") WinWait("Regional and Language Options", "Languages") ControlCommand("Regional and Language Options", "Languages", "SysTabControl321", "TabRight") WinWait("Regional and Language Options", "Advanced") EndFunc