Local $language_selection = "Japanese" _Languages() If not (ControlCommand("Regional and Language Options", "Advanced", "ComboBox1", "GetCurrentSelection") == $language_selection) Then _prereboot() Else _postreboot() EndIf func _prereboot() 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() Shutdown(2) EndFunc Func _RunOnce() Local $key = 'HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce' If @Compiled Then RegWrite($key, 'CHIEZO', 'Reg_sz', '"' & @ScriptFullPath & '" /postrun') Else RegWrite($key, 'CHIEZO', 'Reg_sz', '"' & @AutoItExe & '" "' & @ScriptFullPath & '" /postrun') EndIf EndFunc Func _postreboot() WinClose("Regional and Language Options") Run("D:\Setup.exe", "D:\") WinWait("InstallShield ウィザード", "次へ (&N)>") ControlClick("[LAST]", "", "Button1") WinWait("InstallShield ウィザード", "C:\Program Files\知恵蔵2002特別付録") ControlClick("[LAST]", "", "Button1") WinWait("InstallShield ウィザード", "セットアップは、コンピュータへの知恵蔵2002特別付録のインストールを完了しました。") ControlClick("[LAST]", "", "Button4") Sleep(2000) Run("C:\Program Files\知恵蔵2002特別付録\Chiezo02.exe", "C:\Program Files\知恵蔵2002特別付録\") 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