Technology area | Installer |
Availability | Available in Mac OS X v10.4 and later. |
The System object provides access to information about the target host. This object is accessed using the system
global variable.
Provides methods to obtain information about running applications. See Applications
.
Dictionary representing the defaults system.
Provides file-access methods. See Files
.
Provides access to the IOKit registry. See IORegistry
.
Number of logged-in users. (Includes only those users with a Window Server connection, that is, those that appear in the Fast User Switching list.)
Dictionary (associative array) with the contents of /Sytstem/Library/CoreServices/SystemVersion.plist
. See sw_vers(1)
.
Provides the result of comparing two given version strings (for example, '10.3.1'
and '10.4'
).
compareVersions( versionA, versionB)
String with the first operand version.
String with the second operand version.
-1
when versionA is lower than versionB, 0
when versionA is equal to versionB, and 1
when versionA is higher than versionB.
Provides gestalt information that corresponds to the given selector.
gestalt( selector)
String specifying the selector for the data to retrieve.
Data for the given selector.
For example, this expression returns '1040'
on Mac OS X v10.4.0:
system.gestalt('sysv').toString(16) |
See Gestalt Manager Reference for detailed information.
Provides the localized standard string in the installation package for the current locale for a given key.
localizedStandardString( stringKey)
String that identifies the desired localized string.
Localized string, if found in the installation package; null
otherwise.
Provides the formatted localized string in the installation package for the current locale for a given key and a given set of additional arguments.
localizedStandardStringWithFormat( stringKey, args...)
String that identifies the desired localized string.
Arguments that replace placeholders (%@
) in the formatted localized string.
Localized string, if found in the installation package; null
otherwise.
Provides the localized string in the installation package for the current locale for a given key.
localizedString( stringKey)
String that identifies the desired localized string.
Localized string, if found in the installation package; null
otherwise.
Provides the formatted localized string in the installation package for the current locale for a given key and a given set of additional arguments.
localizedStringWithFormat( stringKey, args...)
String that identifies the desired localized string.
Arguments that replace placeholders (%@
) in the formatted localized string.
Localized string, if found in the installation package; null
otherwise.
Generates an Installer log entry with the JS:
prefix.
log( logString)
Log-entry text.
For some objects, this function may print data that is unavailable or formatted differently when accessed in JavaScript code. To ensure that only data accessible in JavaScript code is shown in the log entry, invoke this function this way:
system.log(foo + ' ') |
Such invocation forces the JavaScript interpreter to evaluate the expression and pass a String object to the function.
Provides an array with the properties of a given object.
propertiesOf( object)
An object.
Array with the properties of object.
Launches a given program in the Resources
directory of the installation package.
run( programName, args...)
Name of the program to execute.
Arguments passed to the program.
After the program is executed, its exit code. If the program is not executed (see discussion), undefined
.
The allow-external-scripts
attribute of the options
element in the distribution definition must be 'yes'
for the program to be launched. And, the Installer application asks the user’s permission before launching the program. See Distribution Definition Reference for more information.
Launches a given program in the Resources
directory of the installation package. On subsequent invocations with the same arguments, the program is not launched and the exit code of the first execution is returned.
run( programName, args...)
Name of the program to execute.
Arguments passed to the program.
After the program is executed, its exit code. If the program is not executed (see discussion), undefined
.
The allow-external-scripts
attribute of the options
element in the distribution definition must be 'yes'
for the program to be launched. And, the Installer application asks the user’s permission before launching the program. See Distribution Definition Reference for more information.
Use this method instead of run
when a program’s exit code using the same arguments is not expected to change.
Provides the result of a sysctlbyname()
call using the given selector.
sysctl( selector)
String with the hardware selector for the desired data.
Hardware data corresponding to selector.
See /usr/include/sys/sysctl.h
for the list of hardware selectors.
Last updated: 2008-12-16