Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 配布機能 運用ガイド


18.2.3 MAIN

ソフトウェアの自動インストールに必要な処理を記述します。このセクションでは、データ型宣言以外のすべての構文を使用できます。

また、インストール結果のリターンコードをエージェントに通知する指定もできます。

〈この項の構成〉

(1) 記述例

MAIN
{
    AIT_SetDefaultWaitTimeout(1.0);
    AIT_DMPSTRC();
    DM_RTN = NG_END;
    AIT_InitLog(InstallerName);
    bRtn= AIT_Exec(InstallerName,SW_SHOWNORMAL);
    if(bRtn == false)
        iErrorNo = AIT_GetLastError();
        strErrorTxt = AIT_GetErrorText(iErrorNo);
        AIT_LogMessage(strErrorTxt);
        iLoopCount = iLoopMax;
    else
        AIT_LogMessage("Recorder File started");
    Endif;
    while(iLoopCount < iLoopMax)
        if(AIT_FocusWindow("check", "#32770") > 0)
            AIT_LogMessage("Window - Caption: check, Class Name: #32770");
            AIT_CtrlSetFocus("チェックボックス(&C)",CHECKBOX_CTRL);
            AIT_Sleep(SLEEP_TIME_EVENTS);
            AIT_LogMessage("AIT_CtrlSetFocus('"チェックボックス(&C)'",CHECKBOX_CTRL);");
            AIT_PlayKey("{ENTER}");
            AIT_Sleep(SLEEP_TIME_EVENTS);
            AIT_LogMessage("AIT_PlayKey('"{ENTER}'");");
            iLoopCount = iLoopMax;
            DM_RTN = OK_END;
            continue;
        Endif;
        iLoopCount = iLoopCount + 1;
        AIT_Sleep(SLEEP_TIME);
    loop;
    if(DM_RTN == OK_END)
        AIT_LogMessage("Recorder File ended normally");
    else
        AIT_LogMessage("Recorder File ended Abnormally");
    Endif;
    WINH = AIT_RegisterWindowMessage("ITM_REC_QUIT");
    if(WINH != 0)
        AIT_PostMessage(HWND_BROADCAST,WINH,DM_RTN,0);
    Endif;
}