Condition blocks may be used to control whether parts of the SIS file are
skipped. A condition-block may take the form:
IF (condition)
package-body
[ ELSEIF (condition)
package-body
]
[ ELSE
package-body
] ENDIF
The square brackets, above, indicate and enclose conditions within the
condition-block statement that are optional.
Note: It is advisable to put brackets around the condition.
A condition can be structured in any of the following
ways:
| Name | Usage |
|
condition-primitive
|
(condition)
|
|
AND
|
(condition) AND (condition)
|
|
OR
|
(condition) OR (condition)
|
|
NOT
|
NOT(condition)
Note: when using the IF statement with the unary
operator NOT, the condition must be contained within braces, e.g.:
IF NOT (MachineUid = 0x101fb3dd)
|
|
where condition-primitive can be:
| Name | Description |
|
attrib=value
|
equal to
|
|
attrib<>value
|
less than or greater than
|
|
attrib>value
|
greater than
|
|
attrib<value
|
less than
|
|
attrib>=value
|
greater than or equal to
|
|
attrib<=value
|
less than or equal to
|
|
exists(filename)
|
tests for the existence of a file
|
|
appprop(uid,propid)
|
retrieves the properties from another registry entry
| |
package(package_uid)
|
tests for the existence of an installed package
|
|
attrib
attrib may be one of the attributes defined in
HALData::TAttribute. These attributes
correspond to properties of the device's hardware. It should be specified in
upper case and without the initial letter E. The following
attributes are supported:
|
PKG variable name
|
HALData attribute (as retrieved by HAL::Get())
| |
MANUFACTURER
|
HALData::EManufacturer
| |
MANUFACTURERHARDWAREREV
|
HALData::EManufacturerHardwareRev
| |
MANUFACTURERSOFTWAREREV
|
HALData::EManufacturerSoftwareRev
| |
MANUFACTURERSOFTWAREBUILD
|
HALData::EManufacturerSoftwareBuild
| |
MODEL
|
HALData::EModel
| |
MACHINEUID
|
HALData::EMachineUid
| |
DEVICEFAMILY
|
HALData::EDeviceFamily
| |
DEVICEFAMILYREV
|
HALData::EDeviceFamilyRev
| |
CPU
|
HALData::ECPU
| |
CPUARCH
|
HALData::ECPUArch
| |
CPUABI
|
HALData::ECPUABI
| |
CPUSPEED
|
HALData::ECPUSpeed
| |
SYSTEMTICKPERIOD
|
HALData::ESystemTickPeriod
| |
MEMORYRAM
|
HALData::EMemoryRAM
| |
MEMORYRAMFREE
|
HALData::EMemoryRAMFree
| |
MEMORYROM
|
HALData::EMemoryROM
| |
MEMORYPAGESIZE
|
HALData::EMemoryPageSize
| |
POWERBACKUP
|
HALData::EPowerBackup
| |
KEYBOARD
|
HALData::EKeyboard
| |
KEYBOARDDEVICEKEYS
|
HALData::EKeyboardDeviceKeys
| |
KEYBOARDAPPKEYS
|
HALData::EKeyboardAppKeys
| |
KEYBOARDCLICK
|
HALData::EKeyboardClick
| |
KEYBOARDCLICKVOLUMEMAX
|
HALData::EKeyboardClickVolumeMax
| |
DISPLAYXPIXELS
|
HALData::EDisplayXPixels
| |
DISPLAYYPIXELS
|
HALData::EDisplayYPixels
| |
DISPLAYXTWIPS
|
HALData::EDisplayXTwips
| |
DISPLAYYTWIPS
|
HALData::EDisplayYTwips
| |
DISPLAYCOLORS
|
HALData::EDisplayColors
| |
DISPLAYCONTRASTMAX
|
HALData::EDisplayContrastMax
| |
BACKLIGHT
|
HALData::EBacklight
| |
PEN
|
HALData::EPen
| |
PENX
|
HALData::EPenX
| |
PENY
|
HALData::EPenY
| |
PENDISPLAYON
|
HALData::EPenDisplayOn
| |
PENCLICK
|
HALData::EPenClick
| |
PENCLICKVOLUMEMAX
|
HALData::EPenClickVolumeMax
| |
MOUSE
|
HALData::EMouse
| |
MOUSEX
|
HALData::EMouseX
| |
MOUSEY
|
HALData::EMouseY
| |
MOUSEBUTTONS
|
HALData::EMouseButtons
| |
CASESWITCH
|
HALData::ECaseSwitch
| |
LEDS
|
HALData::ELEDs
| |
INTEGRATEDPHONE
|
HALData::EIntegratedPhone
| |
DISPLAYBRIGHTNESS
|
HALData::EDisplayBrightness
| |
DISPLAYBRIGHTNESSMAX
|
HALData::EDisplayBrightnessMax
| |
KEYBOARDBACKLIGHTSTATE
|
HALData::EKeyboardBacklightState
| |
ACCESSORYPOWER
|
HALData::EAccessoryPower
| |
SYSTEMDRIVE
|
HALData::ESystemDrive
| |
FPHARDWARE
|
HALData::EHardwareFloatingPoint
| |
NUMHALATTRIBUTES
|
HALData::ENumHalAttributes
|
|
The following attributes, which are not stored in the HAL, can
additionally be specified:
| Attribute |
Description |
|
LANGUAGE
|
An integer that identifies the language selected by the user
at install time. For possible values, see the TLanguage
enumeration defined in e32const.h. Note that the recommended way
to install language-specific files is to use language blocks, as described
here.
|
|
REMOTEINSTALL
|
Deprecated.
|
|
Option<n>
|
0=option not selected, 1=option
selected.
|
|
Condition blocks may be used to control the installer according to these
attributes. For example, two sets of files may be included within the install
package, one set for an ARM processor and one set for an M-CORE processor. An
IF...ELSEIF block may be used with the CPU attribute
to ensure the correct files are installed on the target device, for example:
IF CPU=1 ; ARM
"armv5\myapp.exe"-"!:\sys\bin\Myapp.exe"
ELSEIF CPU=2 ; MCORE
"mcore\myapp.exe"-"!:\sys\bin\Myapp.exe"
ELSE ; unsupported cpu type, display a message & exit!
"nosupport.txt"-"", FILETEXT, TEXTEXIT
ENDIF
The following functions can be used in Software Install PKG files:
package() tests for the existence of a given installed package,
exists() tests for the existence of a given file or a non-root
folder and appprop() retrieves the
properties from another
registry entry.
package(): this returns true if a package with the
specified UID is installed, false otherwise, so the following code installs
foo.txt if a package exists with package UID
0x11223344.
IF package(0x11223344)
"foo.txt"-"c:\foo.txt"
ENDIF
exists(): in the following code, if test.txt
exists, the file exists.txt is installed.
if exists("c:\test.txt")
"text\exists.txt"-"!:\private\01234567\exists.txt"
endif
appprop(): the first parameter to appprop() is
the package UID of the other package file in which the property is defined. The
second parameter is the propid to retrieve. The following
code tests the capabilities of another PKG file that it is dependent upon:
;Dependencies
(0x10000003), 1, 2, 3, {"Depend-EN"}
if (appprop(0x10000003,0) = 1)
"text\appprop1.txt"-"!:\Documents\appprop1.txt"
elseif (appprop(0x10000003,0) = 2)
"text\appprop2.txt"-"!:\Documents\appprop2.txt"
endif
Note that most PKG items are valid within a condition block, however
the following item types may not be used: