|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE reference |
|
11 PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
|
12 <reference id="GUID-D201143F-2B35-5633-8572-C5CAE556FC75" xml:lang="en"><title>Condition-Block |
|
13 Syntax</title><abstract><p>Condition-Blocks are control blocks that decide which part of |
|
14 the SIS files are skipped during installation. </p> <p>Condition-Blocks can |
|
15 include the following: </p> <ul> |
|
16 <li id="GUID-E5C9589C-39E4-58C3-9C66-390ABC903E94"><p><xref href="GUID-71909C6D-297C-50A9-99BB-FEBC67389954.dita">Conditions</xref> </p> </li> |
|
17 <li id="GUID-52B5CD8A-ABA7-527D-8A46-CE58ED9B5B15"><p><xref href="GUID-C5F9AAD3-5183-57E5-A33B-032DE3C063AE.dita">Functions</xref> </p> </li> |
|
18 </ul> <p>Conditional-Blocks (including language dependent file blocks) are |
|
19 evaluated at the end of the installation. </p></abstract><prolog><metadata><keywords/></metadata></prolog><refbody> |
|
20 <refsyn><title>Syntax</title><codeblock id="GUID-0AB8A0B0-C43A-5882-8A45-B859434931D4" xml:space="preserve">IF (condition) |
|
21 package-body |
|
22 [ ELSEIF (condition) |
|
23 package-body |
|
24 ] |
|
25 [ ELSE |
|
26 package-body |
|
27 ] ENDIF |
|
28 </codeblock> <p>The square brackets enclose conditions within the Condition-Block |
|
29 statement that are optional. </p> <p> <b>Note:</b> It is advisable to put |
|
30 conditions within the square brackets. </p> <p>The Condition-Blocks can be |
|
31 used to ensure that the SIS file installs appropriate binaries for the target |
|
32 platform. For example: </p> <codeblock id="GUID-62C6E29A-E17A-5C66-ACB2-ECBAB31F504B" xml:space="preserve">IF FPHARDWARE=0 |
|
33 "\epoc32\release\gcce\urel\myapp.exe"-"!:\sys\bin\myapp.exe.exe"; |
|
34 ELSE |
|
35 "\epoc32\release\gcce\urel\myappVFP.exe"-"!:\sys\bin\myappVFP.exe"; |
|
36 ENDIF |
|
37 </codeblock></refsyn> |
|
38 <section id="GUID-C9DADEE3-AB97-59DF-9138-EC4F8153A937"><title>Example</title> <p>The |
|
39 following example illustrates the usage of Conditional-Blocks within a PKG |
|
40 file: </p> <codeblock id="GUID-9027EC5D-7975-57A3-84B8-89504FD6AF0D" xml:space="preserve">; PKG file to illustrate conditional blocks |
|
41 |
|
42 &EN |
|
43 |
|
44 %{"Nokia Corporation"} |
|
45 |
|
46 :"Nokia Corporation" |
|
47 |
|
48 #{"ConditionalInstall"}, (0x10000041), 1, 2, 3 |
|
49 |
|
50 !({"Option1"},{"Option2"},{"Option3"}) |
|
51 |
|
52 if exists("c:\private\10000041\import\InstTest\romeo.txt") |
|
53 "text\romeo.txt"-"!:\private\10000042\import\InstTest\romeo1.txt" |
|
54 else |
|
55 "text\romeo.txt"-"!:\private\10000042\import\InstTest\romeo.txt" |
|
56 endif |
|
57 |
|
58 if (option1 = 1) AND (option2 = 1) |
|
59 "files\tbit.gif"-"!:\private\10000042\import\InstTest\tbit.gif" |
|
60 endif |
|
61 |
|
62 if version(0x10000042, <, 2, 0, 0) |
|
63 "text\prev2.txt"-"!:\private\10000042\import\InstTest\prev2.txt" |
|
64 elseif version(0x10000042,>=,2,0,0) AND version(0x10000042, <, 3, 0, 0) |
|
65 "text\v2.txt"-"!:\private\10000042\import\InstTest\v2.txt" |
|
66 elseif version(0x10000042,>=,3,0,0) AND version(0x10000042, <, 4, 0, 0) |
|
67 "text\v3.txt"-"!:\private\10000042\import\InstTest\v3.txt" |
|
68 else |
|
69 "text\postv3.txt"-"!:\private\10000042\import\InstTest\postv3.txt" |
|
70 endif</codeblock> </section> |
|
71 </refbody></reference> |