16.6.6 AITファイルの完成例
Acrobat Reader 5.05をリモートインストールする場合の、AITファイルの完成例を示します。
PACKAGE_INFO { PackageID = "ADOBEACROBATREADER"; Product = "Adobe Acrobat Reader 5.05"; Version = "505"; InstallerName = "Ar505jpn.exe"; InstallDrive = "C:"; InstallDirectory = "'\Program Files'\Adobe'\Acrobat 5.0"; } DEFINE { integer iLoopCount = 0; integer iLoopMax = 60; integer DM_RTN; integer WINH; bool bRtn; const integer OK_END = 0; const integer NG_END = -1; float SLEEP_TIME = 1.0; float SLEEP_TIME_RESTART = 10.0; float SLEEP_TIME_EVENTS = 0.5; integer InsufficientMemory; integer InvalidPath; integer DirectorySetFlag; } MAIN { AIT_SetDefaultWaitTimeout(1.0); AIT_DMPSTRC(); DM_RTN = NG_END; bRtn= AIT_Exec(InstallerName,SW_SHOWNORMAL); if(bRtn == false) iLoopCount = iLoopMax; Endif; while(iLoopCount < iLoopMax) if(AIT_FocusWindow("Acrobat Readerを解凍中です...", "#32770") > 0) AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("Unpacking Acrobat Reader...", "#32770") > 0) AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("セットアップの中止", "#32770") > 0) if (InvalidPath == 1 || InsufficientMemory == 1) AIT_PlayKey("%(y)"); iLoopCount = iLoopMax; else AIT_PlayKey("%(n)"); iLoopCount = 0; endif; AIT_Sleep(SLEEP_TIME); Endif; if(AIT_FocusWindow("上書き確認", "#32770") > 0) AIT_PlayKey("%(e)"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("セットアップ初期化エラー", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("PackageForTheWeb", "#32770") > 0) if (InsufficientMemory == 1) AIT_PlayKey("%(y)"); iLoopCount = iLoopMax; else AIT_PlayKey("%(n)"); iLoopCount = 0; endif; AIT_Sleep(SLEEP_TIME); Endif; if(AIT_FocusWindow("Error", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("セットアップの完了", "#32770") > 0) AIT_PlayKey("{DOWN}"); AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; DM_RTN = OK_END; Endif; if(AIT_FocusWindow("PackageForTheWeb Stub", "#32770") > 0) AIT_PlayKey("%(C)"); InsufficientMemory = 1; AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("Ar505jpn", "#32770") > 0) AIT_PlayKey("%(C)"); InsufficientMemory = 1; AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("_ins5576", "#32770") > 0) AIT_PlayKey("%(C)"); AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("PackageForTheWeb Error", "#32770") > 0) AIT_PlayKey("{ENTER}"); InsufficientMemory = 1; AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("PackageForTheWeb エラー", "#32770") > 0) AIT_PlayKey("{ENTER}"); InsufficientMemory = 1; AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("+TEMP", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("エラー", "#32770") > 0) if (AIT_VerifyExistence("中止(&A)",BUTTON_CTRL) > 0) AIT_PlayKey("%(a)"); iLoopCount = iLoopMax; else if (AIT_VerifyExistence("OK",BUTTON_CTRL) > 0) AIT_PlayKey("{ENTER}"); InsufficientMemory = 1; iLoopCount = 0; endif; endif; AIT_Sleep(SLEEP_TIME); Endif; if(AIT_FocusWindow("警告", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("質問", "#32770") > 0) AIT_PlayKey("%(n)"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("ComponentMoveData Error Information", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("Acrobat Reader のセットアップ", "#32770") > 0) AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = iLoopMax; Endif; if(AIT_FocusWindow("ディスク空き容量不足", "#32770") > 0) AIT_PlayKey("{ESC}"); InsufficientMemory = 1; AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("読み取り専用ファイルの検出", "#32770") > 0) AIT_PlayKey("%(y)"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; Endif; if(AIT_FocusWindow("Acrobat Reader", "#32770") > 0) InsufficientMemory = 1; if (AIT_VerifyExistence("再試行(&R)",BUTTON_CTRL) > 0) AIT_PlayKey("{ESC}"); iLoopCount = iLoopMax; else if (AIT_VerifyExistence("OK",BUTTON_CTRL) > 0) AIT_PlayKey("{ENTER}"); iLoopCount = iLoopMax; endif; endif; AIT_Sleep(SLEEP_TIME); Endif; if(AIT_FocusWindow("セットアップ", "#32770") > 0) if(AIT_VerifyExistence("~ディレクトリ",STATIC_CTRL) > 0) AIT_PlayKey("%(y)"); AIT_Sleep(SLEEP_TIME); else if(AIT_VerifyExistence("~指定されたディレクトリ",STATIC_CTRL) > 0) InvalidPath = 1; AIT_PlayKey("{ENTER}"); AIT_Sleep(SLEEP_TIME); iLoopCount = 0; endif; endif; iLoopCount = 0; Endif; if(AIT_FocusWindow("Acrobat Reader 5.0.5 のセットアップ", "#32770") > 0) AIT_PlayKey("%(n)"); AIT_Sleep(SLEEP_TIME_EVENTS); iLoopCount = 0; Endif; if(AIT_FocusWindow("インストール先の選択", "#32770") > 0) if ( (AIT_FindSubStr(InstallPoint,"%",0) != -1) || (AIT_FindSubStr(InstallPoint,"~",0) != -1) ) InvalidPath = 1; DirectorySetFlag = 1; endif; if (DirectorySetFlag == 0) AIT_PlayKey("%(r)"); else if (InvalidPath == 1 || InsufficientMemory == 1) AIT_PlayKey("{ESC}"); else AIT_PlayKey("%(n)"); endif; endif; AIT_Sleep(SLEEP_TIME_EVENTS); iLoopCount = 0; Endif; if(AIT_FocusWindow("ディレクトリの選択", "#32770") > 0) if (InvalidPath == 1) AIT_PlayKey("{ESC}"); else if (DirectorySetFlag == 1) AIT_PlayKey("{ENTER}"); else AIT_PlayKey("%(p)"); AIT_PlayKey(InstallPoint); AIT_PlayKey("{ENTER}"); DirectorySetFlag = 1; endif; endif; AIT_Sleep(SLEEP_TIME_EVENTS); iLoopCount = 0; Endif; if(AIT_FocusWindow("情報", "#32770") > 0) if (AIT_VerifyExistence("Acrobat Reader をご選択いただきありがとうございました。",STATIC_CTRL) == 1) AIT_PlayKey("{ENTER}"); if(InsufficientMemory == 0) DM_RTN = OK_END; endif; else if(AIT_VerifyExistence("セットアップを終了します。",STATIC_CTRL) == 1) AIT_PlayKey("{ENTER}"); endif; endif; iLoopCount = iLoopMax; Endif; if (AIT_FocusWindow("", "#32770") > 0) if(AIT_VerifyExistence("はい(&Y)",BUTTON_CTRL) > 0) AIT_PlayKey("%(y)"); iLoopCount = iLoopMax; endif; AIT_Sleep(SLEEP_TIME); endif; if (AIT_FocusWindow("", "#32770") > 0) if(AIT_VerifyExistence("OK",BUTTON_CTRL) > 0) AIT_PlayKey("{ENTER}"); iLoopCount = iLoopMax; endif; AIT_Sleep(SLEEP_TIME); endif; if(AIT_FocusWindow("Acrobat Reader のセットアップ", "InstallShield_Win") > 0) AIT_Sleep(SLEEP_TIME_EVENTS); iLoopCount=0; Endif; iLoopCount = iLoopCount + 1; AIT_Sleep(SLEEP_TIME); loop; WINH = AIT_RegisterWindowMessage("ITM_REC_QUIT"); if(WINH != 0) AIT_PostMessage(HWND_BROADCAST,WINH,DM_RTN,0); Endif; } ERROR { DM_RTN = NG_END; WINH = AIT_RegisterWindowMessage("ITM_REC_QUIT"); if(WINH != 0) AIT_PostMessage(HWND_BROADCAST,WINH,DM_RTN,0); Endif; }