Job Management Partner 1/Software Distribution Administrator's Guide Volume 1
The following explains the functions that can be used in the JP1/Software Distribution installation and collection scripts. Using these functions, you can acquire the program version information or add new icons to Program Manager.
The following table lists the script functions.
Table D-2 Script functions
Script function | Use category | Explanation |
---|---|---|
Backup | I | Creates a backup of the software of the current version. |
Collection | C | Remotely collects a directory or file. |
CreateIcon | I | Adds a specified program icon to a specified program group. |
CreateProgramGroup | I | Creates a program group with a specified name in Program Manager. |
CreateShortCut | I | Creates a shortcut at the remote installation destination. |
DelBackup | I | Deletes a backup at the remote installation destination. |
DmSetStatus | I, C | Sets an error status code. |
GetBackupStatus | I | Returns a signal to indicate whether a backup is acquired. |
GetErrorStatus | I, C | Locates an error in a script process. |
GetResourceName | I | Determines the package ID of the software to be installed. |
GetResourceVersion | I | Determines the version and generation numbers of the software to be installed. |
GetSoftwareName | I | Acquires the package name of the software to be installed. |
GetStatus | I, C | Acquires the current value of the status set by SetStatus(). |
Install | I | Restores files to a specified directory. |
LogFile | I, C | Outputs an arbitrary message to a log file. |
MsgBox | I | Displays a message within a dialog box. |
Restore | I | Restores the software whose backup was acquired. |
SetStatus | I, C | Sets an arbitrary processing state as the status. |
Setup | I | Starts a setup program using files restored by the Install function. |
Shell | I, C | Starts an external program. |
SysInfoCoProcessor | I | Checks whether a coprocessor is present. |
SysInfoCpuType | I | Checks the CPU type. |
SysInfoHDEmpty | I | Checks the free space of the hard disk. |
SysInfoMemory | I | Acquires information about memory capacities. |
SysInfoOSVersion | I | Determines the version of the operating system being used. |
VerInfo | I | Determines the version of specified software. |
VerInfoEx | I | Determines the version of the installed software from a package name or package ID. |
Legend:
I: Usable in installation scripts.
C: Usable in collection scripts.
The script functions must be written as described below. Use zero or one or more spaces, tabs, or line feed characters.
function-name (function-argument1 [, function-argument2 ])
Note that the alphabetical characters used in a function name are case sensitive. The number of arguments for individual functions is fixed, but varies from one function to another. You can specify the arguments by entering either a direct value or a variable. However, the system variable should be specified by entering a direct value.
The Backup function obtains a backup of the software that has already been installed and has a version different from the software you want to remotely install.
Backup()
None
None
The Collection function remotely collects the specified directory or file.
At least three collection functions must be called with a collect file. First, call a Collection function specifying COLLECTION_START as the argument to initialize the setting for remote collection. Then, call a Collection function specifying a file or directory in the argument to set the file or directory to be remotely collected. This Collection function can be repeated up to 100 times to set more than one file or directory. Last, call a Collection function specifying COLLECTION_END as the argument to execute the collection.
Collection(COLLECTION_START) Collection(String name-of-directory-or-file-to-be-remote-collected) Collection(COLLECTION_END)
None
The CreateIcon function adds an icon to Program Manager. Specify the program group to which you want to add an icon, the executable file to be added, and the title of the icon.
This function cannot be used in the background installation mode.
CreateIcon(String program-group-name, String pathname-of-executable-file, String icon-title)
None
This function cannot be used to install other companies' software or Hitachi program products.
The CreateProgramGroup function creates a program group in Program Manager, with the name you specified.
This function cannot be used in the background installation mode.
CreateProgramGroup(String program-group-name)
None
This function cannot be used to install other companies' software or Hitachi program products.
The CreateShortCut function creates a shortcut at the destination of remote installation. This function can be used only when the destination of remote installation uses Windows Me, Windows 98, or Windows 95.
This function cannot be used in the background installation mode.
CreateShortCut(String pathname-of-shortcut-creating-folder, String pathname-of-shortcut-original-file, String shortcut-title)
None
The DelBackup function deletes the backup obtained by the Backup function. If this function is called when the backup is not obtained, the call does not result in an error and is ignored.
DelBackup()
None
None
The DmSetStatus function sets the specified character string as the error status code (the end status for the distribution management system of UNIX). Set an error status code when you want to make the script terminate if the condition is not satisfied. The error status code you set is reported to the distribution management system as the termination code of the installation or collection.
DmSetStatus(System error-status-code)
Table D-3 System variables
System variable | Description |
---|---|
INSTALL_CAPAERROR | A condition is not satisfied when the hard disk capacity is checked: (End status 1 = 0x92) (End status 2 = 0x03) |
INSTALL_HENVERROR | A condition is not satisfied when the hardware environment is checked: (End status 1 = 0x9d) (End status 2 = 0x02) |
INSTALL_SENVERROR | A condition is not satisfied when the version of MS-DOS or Windows is checked: (End status 1 = 0x9d) (End status 2 = 0x03) |
INSTALL_PSVRERROR | A condition is not satisfied when the versions of the prerequisite programs are checked: (End status 1 = 0x9d) (End status 2 = 0x04) |
None
The GetBackupStatus function returns whether or not the backup is obtained by the remote installation.
System GetBackupStatus()
None
The GetErrorStatus function checks where an error occurred in the script. This function can be used only in On InstallError statements and On CollectionError statements.
System GetErrorStatus()
None
Table D-4 List of error locations
System variable | Description |
---|---|
BACKUP_PROCESS | An error occurred during execution of a Backup function. |
COLLECTION_PROCESS | An error occurred during execution of a Collection function. |
CREATEICON_PROCESS | An error occurred during execution of a CreateIcon function. |
CREATEPROGRAMGROUP_PROCESS | An error occurred during execution of a CreateProgramGroup function. |
CREATESHORTCUT_PROCESS | An error occurred during execution of a CreateShortCut function. |
GETBACKUPSTATUS_PROCESS | An error occurred during execution of a GetBackupStatus function. |
INSTALL_PROCESS | An error occurred during execution of an Install function. |
MISC_PROCESS | An error occurred somewhere else in the script. |
MSGBOX_PROCESS | An error occurred during execution of an MsgBox function. |
NO_ERROR | No error has occurred. |
RESTORE_PROCESS | An error occurred during execution of a Restore function. |
SETSTATUS_PROCESS | An error occurred during execution of a SetStatus function. |
SETUP_PROCESS | An error occurred during execution of a Setup function. |
SHELL_PROCESS | An error occurred in the user program activated by a Shell function, or an error occurred during execution of a Shell function. |
SYSINFOCOPROCESSOR_PROCESS | An error occurred during execution of a SysInfoCoProcessor function. |
SYSINFOCPUTYPE_PROCESS | An error occurred during execution of a SysInfoCpuType function. |
SYSINFOHDEMPTY_PROCESS | An error occurred during execution of a SysInfoHDEmpty function. |
SYSINFOMEMORY_GDIMEMORY_PROCESS | An error occurred during execution of GDI_MEMORY (system information type) of a SysInfoMemory function. |
SYSINFOMEMORY_REALMEMORY_PROCESS | An error occurred during execution of REAL_MEMORY (system information type) of a SysInfoMemory function. |
SYSINFOMEMORY_USERMEMORY_PROCESS | An error occurred during execution of USER_MEMORY (system information type) of a SysInfoMemory function. |
SYSINFOOSVERSION_MSDOS_PROCESS | An error occurred during execution of MSDOS (system information type) of a SysInfoOSVersion function. |
SYSINFOOSVERSION_WINDOWS_PROCESS | An error occurred during execution of WINDOWS (system information type) of a SysInfoOSVersion function. |
VERINFO_PROCESS | An error occurred during execution of a VerInfo function. |
VERINFOEX_PROCESS | An error occurred during execution of a VerInfoEx function. |
The GetResourceName function obtains the package ID of the software to be installed.
String GetResourceName()
None
The GetResourceVersion function obtains the version and the generation number of the software to be installed.
String GetResourceVersion()
None
The GetSoftwareName function obtains the package name of the software to be installed.
String GetSoftwareName()
None
The GetStatus function obtains the current value of the status set by the SetStatus function.
Integer GetStatus()
None
When the status has not set by the SetStatus function, 0 is returned.
The Install function installs (restores) the distributed software.
Install(String destination-directory-character-string)
None
: Install("1:\users\home\instdir") :
: Install(SETUP_DIRECTORY) : Setup() :
You cannot write multiple Install functions in the same script.
The LogFile function outputs a specified message to the log files. The output destinations are LOG\MAIN.LOG and LOG\USER.LOG under the directory in which the client is installed. Use MAIN.LOG to check the messages in connection with the message log for the client. Use USER.LOG to check only the messages output by the script writer. This log is also collected in the event log of Windows NT (assigned an event ID of 60000 or more).
LogFile(String message)
None
Use the LogFile function sparingly. Excessive use of the LogFile function increases disk I/O, and performance may suffer.
The MsgBox function displays a specified message in a dialog box. The button displayed on the dialog box is OK only.
This function cannot be used in the background installation mode.
MsgBox(String message, Integer display-time)
None
The Restore function restores the previous version of the software from its backup created before the software was remotely installed. If this function is called when the backup has not been created, the call does not result in an error and is ignored. When this function is coded in an On InstallError Do statement, the restoration from the backup is performed only if an error occurs during remote installation.
Restore()
None
None
The SetStatus function allows you to store the script processing status as a status code. The status code you store can be obtained by the GetStatus function.
When the script terminates, the status code set last is reported to the distribution management system as the termination code of the installation or collection.
SetStatus(Integer status-code)
None
A status code of 0 is assumed until the first SetStatus function is executed in the script.
The Setup function activates a setup program using the files restored by the Install function.
Most of the setup programs for Windows applications are GUI based. To use a GUI-based setup program with JP1/Software Distribution, create either an AIT file or a recorder file (a Visual Test script). This file is necessary for the system to respond to the screens at the client automatically. The Automatic Installation Tool executable program library automatically responds to the GUI setup program, using the AIT file, or the Visual Test executable program library automatically responds using the recorder file.
For details about how to create an AIT file or recorder file, see the manual Automatic Installation Tool Description and Reference.
This function cannot be used in the background installation mode.
Setup()
None
None
The Shell function activates an external program.
Shell(String full-pathname-of-program)
None
Shell("c:\winnt\system32\notepad.exe")
Dim S As String S = "1:\users\home\prog01.exe file01.txt" Shell(S)
Shell("""c:\Program Files\prog2.exe""")
Shell("""c:\Program Files\Test\aaa.exe"" /f C:\temp\bbb.exe /I: /S ""ccc.txt""")
The SysInfoCoProcessor function returns whether or not the coprocessor exists.
System SysInfoCoProcessor()
None
If you attempt to perform remote installation to Windows without including the presence of the coprocessor in the system conditions, the script results in an error because the system conditions are not satisfied.
The SysInfoCpuType function obtains the CPU type.
System SysInfoCpuType()
None
For an Intel-compatible CPU, such as Crusoe, I_PENTIUM is returned.
Obtains the amount of free space in a specified hard disk.
Integer SysInfoHDEmpty(System drive-name)
The SysInfoMemory function obtains the size of a specified type of memory. Specify the type of memory in the argument.
Integer SysInfoMemory (memory-type)
Table D-5 Memory types
Memory type | Description |
---|---|
REAL_MEMORY | Obtain the real memory size. |
USER_MEMORY | Obtain the size of memory available for the user. This value differs depending on the number of applications running. |
GDI_MEMORY | Obtain the size of the GDI system resource that can be used. This value is 64 kilobytes at the maximum. |
The SysInfoOSVersion function obtains the version of the operating system in use. Specify the type of operating system.
String SysInfoOSVersion(operating-system-type)
The VerInfo function returns the version of the software specified by package-ID. Specify ACTIVE_VERSION (currently operating new version) as the version type.
String VerInfo(version-type, String package-ID)
This function obtains the version of the software installed using JP1/Software Distribution. For the software directly installed from media such as floppy disks, the version cannot be obtained by this function.
The VerInfoEx function obtains the version of an already installed package from the package name or package ID.
String VerInfoEx(PACKAGE_NAME, String package-name) String VerInfoEx(PACKAGE_ID, String package-ID)
This function obtains the version of the software installed using JP1/Software Distribution. For the software directly installed from media such as floppy disks, this function can obtain only the versions of the software that can be found by using the software search functions of JP1/Software Distribution.
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.