Condition-Block Syntax

Condition-Blocks are control blocks that decide which part of the SIS files are skipped during installation.

Condition-Blocks can include the following:

Conditional-Blocks (including language dependent file blocks) are evaluated at the end of the installation.

Syntax

IF (condition)
    package-body 
[ ELSEIF (condition) 
    package-body 
] 
[ ELSE 
    package-body 
] ENDIF

The square brackets enclose conditions within the Condition-Block statement that are optional.

Note: It is advisable to put conditions within the square brackets.

The Condition-Blocks can be used to ensure that the SIS file installs appropriate binaries for the target platform. For example:

IF FPHARDWARE=0
"\epoc32\release\gcce\urel\myapp.exe"-"!:\sys\bin\myapp.exe.exe";
ELSE
"\epoc32\release\gcce\urel\myappVFP.exe"-"!:\sys\bin\myappVFP.exe";
ENDIF

Example

The following example illustrates the usage of Conditional-Blocks within a PKG file:

; PKG file to illustrate conditional blocks

&EN

%{"Nokia Corporation"}

:"Nokia Corporation"

#{"ConditionalInstall"}, (0x10000041), 1, 2, 3

!({"Option1"},{"Option2"},{"Option3"})

if exists("c:\private\10000041\import\InstTest\romeo.txt")
    "text\romeo.txt"-"!:\private\10000042\import\InstTest\romeo1.txt"
else
    "text\romeo.txt"-"!:\private\10000042\import\InstTest\romeo.txt"
endif

if (option1 = 1) AND (option2 = 1)
    "files\tbit.gif"-"!:\private\10000042\import\InstTest\tbit.gif"
endif

if version(0x10000042, <, 2, 0, 0)
  "text\prev2.txt"-"!:\private\10000042\import\InstTest\prev2.txt"
elseif version(0x10000042,>=,2,0,0) AND version(0x10000042, <, 3, 0, 0)
  "text\v2.txt"-"!:\private\10000042\import\InstTest\v2.txt"
elseif version(0x10000042,>=,3,0,0) AND version(0x10000042, <, 4, 0, 0)
  "text\v3.txt"-"!:\private\10000042\import\InstTest\v3.txt"
else
  "text\postv3.txt"-"!:\private\10000042\import\InstTest\postv3.txt"
endif