Job Management Partner 1/Software Distribution Administrator's Guide Volume 1
This section explains the statements used for coding JP1/Software Distribution installation script and collection script. With these statements, you can declare variables or change the program flow.
The following table lists the statements.
Table D-1 List of statements
Statement | Function |
---|---|
Dim | Declares a variable. |
ErrorExit | Terminates a script execution abnormally. |
Exit | Terminates a script execution normally. |
Function | Declares the beginning of a script. |
End Function | Declares the end of a script. |
Goto | Jumps to a label. |
If-Then-Else-End If | Tests a given condition. |
On InstallError-Do-End | Declares postprocessing if an error occurs during the execution of a collection script. |
On CollectionError-Do-End | Declares postprocessing if an error occurs during the execution of an installation script. |
Rem | Writes a comment. |
Note that the alphabetical letters used in a statement are case sensitive.
To separate statement descriptors, you can use a space, tab, or line feed character. In a Rem statement, use one or more spaces or a tab character as a delimiter. Two or more spaces or a line feed code causes an error.
Dim variable-name As variable-type
The Dim statement declares a variable. Code this statement just after a Function statement.
System variable names not allowed | ||
---|---|---|
%HITACHI_REG | %NETMDMP% | %SYSTEM% |
%WINDOWS% | ACTIVE | ACTIVE_VERSION |
ALL_DRIVE | BACKUP_PROCESS | COLLECT_NORMAL |
COLLECTION_AFTER | COLLECTION_BEFORE | COLLECTION_END |
COLLECTION_NORMAL | COLLECTION_PROCESS | COLLECTION_START |
CREATEICON_PROCESS | CREATEPROGRAMGROUP_PROCESS | CREATESHORTCUT_PROCESS |
D_ALPHA | DELBACKUP_PROCESS | DmInfo |
EXIST | FALSE | FindFile |
FINDFILE_PROCESS | FORCE | FORCE_DELIVERY |
GDI_MEMORY | GetFileDate | GetFileSize |
I_286 | I_386 | I_486 |
I_860 | I_PENTIUM | INACTIVE |
INSTALL_CAPAERROR | INSTALL_DRIVE | INSTALL_HENVERROR |
INSTALL_NORMAL | INSTALL_PROCESS | INSTALL_PSVRERROR |
INSTALL_SENVERROR | IntegerToString | IsActive |
ISACTIVE_PROCESS | KIND_WINDOWS | KIND_WINDOWS95 |
KIND_WINDOWSNT | M_MIPS | MISC_PROCESS |
MSDOS | MSGBOX_PROCESS | NO_ERROR |
NOEXIST | NOFORCE | OLD_VERSION |
P_POWERPC | PACKAGE_ID | PACKAGE_NAME |
REAL_MEMORY | RESTORE_PROCESS | SETSTATUS_PROCESS |
SETUP_DIRECTORY | SETUP_PROCESS | SHELL_PROCESS |
SYSINFOCOPROCESSOR_PROCESS | SYSINFOCPUTYPE_PROCESS | SYSINFOHDEMPTY_PROCESS |
SYSINFOMEMORY_GDIMEMORY_PROCESS | SYSINFOMEMORY_REALMEMORY_PROCESS | SYSINFOMEMORY_USERMEMORY_PROCESS |
SysInfoOSKind | SYSINFOOSVERSION_MSDOS_PROCESS | SYSINFOOSVERSION_WINDOWS_PROCESS |
TRUE | USER_MEMORY | VERINFO_PROCESS |
VERINFOEX_PROCESS | WINDOWS | -- |
Legend: --: Not applicable
ErrorExit
The ErrorExit statement terminates the execution of a script abnormally. Installation or collection can be terminated at any time. If you want to make the script report a specified status code, set the status code using the SetStatus function before the ErrorExit statement.
Function main()
The Function statement declares the beginning of a script. This statement must be used in pairs with an End Function. The statements between Function and End Function are processed as a script.
Function can be followed by only main().
The script between Function and End Function cannot contain the following statements:
End Function
The End Function statement declares the end of a script that begins with the Function statement.
Goto label-name
Makes the script processing jump to the label denoted by label-name. A jump cannot be made into any of the following statements:
A jump must always be a jump to a statement after the current statement. Note that a loop involving a jump to a prior statement cannot be coded.
Goto Label01 : Label01: ' (The label must be followed by a colon (:).) statements
If condition Then statements-to-be-executed-when-the-condition-is-true Else statements-to-be-executed-when-the-condition-is-false End If
This statement evaluates the condition and makes the script processing branch depending on the result of the evaluation.
The statements following Then or Else cannot contain the following statements:
On InstallError Do any-postprocessing End
In this statement, code the statements for the postprocessing if an error occurs during execution of an installation script.
The functions for JP1/Software Distribution such as Install() and Shell() immediately terminate the script if an error occurs. Therefore, the return value of the functions cannot be checked by the installation script. In this case, if postprocessing is necessary, describe the necessary processing in an On InstallError statement. The On InstallError statement can be applied to displaying a specific message on the console or outputting it to a log file at the occurrence of an installation error.
If an error occurs during the postprocessing described in the On InstallError statement, the subsequent statements are not processed and the script is terminated.
The On InstallError statement can be coded anywhere in an installation script after the Dim statement. However, for readability, code it just after the Dim statement if possible.
Function main() : On InstallError Do LogFile("Error occurred during installation.") End : : Install("c:\") : End Function
The postprocessing cannot contain the following:
On CollectionError Do any-postprocessing End
In this statement, code the statements for the postprocessing if an error occurs during the execution of a collection script.
The functions for JP1/Software Distribution such as Collection() and Shell() immediately terminate the script if an error occurs. Therefore, the return value of the functions cannot be checked by the collection script. In this case, if postprocessing is necessary, code the necessary processing in an On CollectionError statement. The On CollectionError statement can be applied to outputting a specific message to a log file at the occurrence of a collection error.
If an error occurs during the postprocessing described in the On CollectionError statement, the subsequent statements are not processed and the script is terminated.
The On CollectionError statement can be coded anywhere in an installation script after the Dim statement. However, for readability, code it just after the Dim statement if possible.
Function main() : On CollectionError Do LogFile("Error occurred during collection.") End : : Collection("c:\users\default\user.data") : End Function
The postprocessing cannot contain the following:
Rem comment ' comment
You can code your comment in a script using the Rem statement. The portion from the single quotation mark (') or Rem up to the next return code is assumed to be a comment. You can code a comment anywhere in the script file.
All Rights Reserved. Copyright (C) 2009, 2013, Hitachi, Ltd.
Copyright, patent, trademark, and other intellectual property rights related to the "TMEng.dll" file are owned exclusively by Trend Micro Incorporated.