Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Package file format .pkg


Overview

A pkg file is a text file which contains installation information for applications or files. It consists of the following parts, some of which may be omitted:

The first item in the pkg file should detail the languages provided within the sis file followed by the package header which details the name of the component to be installed in all supported languages, the UID of the component, and version information. An optional digital signature line may be specified which gives the name of the private key file and associated certificates to be used to digitally sign the sis file. The remainder of the file lists the files and components to be included in the sis file or dependencies upon other installed components.


Notes:

"MyApp<153>"

"MyApp<0x99>"

[Top]


Languages

The language line specifies which languages are supported by the component. Languages are identified by a two character code. The line may be omitted; if so, UK English is assumed by default. The language line must be specified before any other section. Its format is as follows:

&Language_1,..., Language_n

For example:

&EN,FR,IT

The following languages are supported:

EN

UK English

SG

Swiss German

FR

French

PO

Portuguese

GE

German

TU

Turkish

SP

Spanish

IC

Icelandic

IT

Italian

RU

Russian

SW

Swedish

HU

Hungarian

DA

Danish

DU

Dutch

NO

Norwegian

BL

Belgian Flemish

FI

Finnish

AU

Australian English

AM

US English

BF

Belgian French

SF

Swiss French

AS

Austrian German

IF

International French

NZ

New Zealand

CS

Czech

SK

Slovak

PL

Polish

SL

Slovenian

TC

Taiwan Chinese

HK

Hong Kong Chinese

ZH

Prc Chinese

JA

Japanese

TH

Thai


Note:

The number of text strings in the following line types should match the number of languages specified in the languages line and be in the same order:

[Top]


Package header

The package header must be included before all other items, except the language line, if one is specified. Its format is:

#{"Component Name for language1", "Component Name for language n"},(ComponentUID),Major,Minor,Build-Number[,Package Options] [,TYPE=Package Type]

The package header contains the component name in each of the supported languages, the UID of the component, the major and minor version number and build number, and package options.

For example:

#{"MyApp"},(0x10000001),1,0,0,TYPE=SISAPP


Notes:

One or both of the following package options can be specified:

Abbrev. option

Full option name

SH

SHUTDOWNAPPS

NC

NOCOMPRESS

The package type allows the user to easily identify the main installed applications, distinct from any system components. They also let the add/remove control panel item distinguish the packages which the user may not remove. For example, installing an application is installed using the SYSAPP type: #{"MyApp"},(0X100000001),1,0,0,SH,NC,TYPE=SYSAPP

The package type may be followed with only one of the package type arguments;

Abbrev. option

Full option name

Description

SA

SISAPP

Contains an application (the default type).

SY

SISSYSTEM

Contains a shared/system component such as a DLL or OPX which may be used by a number of applications. The component will be removed when the last application is removed which uses it.

SO

SISOPTION

Contains an add-on or optional component, (dynamically loaded code, data files,…). The user may choose whether to install the component and may later remove the component independent of the main application it works with.

SC

SISCONFIG

Configures an existing application or service. The package should not contain any new files, only files which are either run or displayed during installation, or added to an existing component, e.g. settings. The package will not appear as a removable component after installation.

SP

SISPATCH

Patches an existing component. It may be removed by the user.

SU

SISUPGRADE

Upgrades an existing component. The package is not listed as a removable component after installation, the user will need to remove or reinstall the associated application to remove the changes.


Notes:

[Top]


Package signature

The package signature line is used when creating a digitally signed installation file. The signature will be checked when the package is installed and details of the certificate will be available to the user at install time and when listing installed components. The signature line format is:

*private-key-file,public-key-cert[,KEY=privatekey-password]


Notes:

The optional KEY parameter specifies the password used to access the private key file if it has been encrypted. If the key is encrypted, but the KEY parameter has not been specified then the Installation File Generator will prompt the user for the access password


See also

Certification Generator syntax makekeys.exe

[Top]


Condition Blocks

Condition blocks may be used to control the installer according to various attributes. The syntax is as follows:

IF condition package-lines [ ELSEIF condition package-lines ] [ ELSE package-lines ] ENDIF

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-type attribute to ensure the correct files are installed on the target device.

For example:

IF cpu=0 ; ARM
 "marm\myapp.app"-"!:\System\Apps\MyApp\Myapp.app"
ELSEIF cpu=1 ; MCORE
"mcore\myapp.app"-"!:\System\Apps\MyApp\Myapp.app"
ELSE
 ; unsupported cpu type, display a message & exit!
 "nosupport.txt"-"", FILETEXT, TEXTEXIT
ENDIF


Notes:


Condition

condition-primitive

(condition) AND (condition)

(condition) OR (condition)

NOT(condition)


Condition-primitive

attrib=value

attrib<>value

attrib>value

attrib<value

attrib>=value

attrib<=value

exists(filename)

appcap(uid,capid)

devcap(capid)


Attributes

Attributes

Value

Manufacturer

0=Ericsson, 1=Motorola, 2=Nokia, 3=Panasonic, 4=Psion 5=Intel 6=Cogent 7=Cirrus 8=…

ManufacturerHardwareRev

Manufacturer-specific: 0x100=1.00 etc

ManufacturerSoftwareRev

Manufacturer-specific: 0x100=1.00 etc

ManufacturerSoftwareBuild

Manufacturer-specific: 257 etc

MachineUID

Device specific values for products (see epoc32\include\hal_data.h):

EMachineUid_Series5mx=0x1000118a, EMachineUid_Brutus=0x10005f60, EMachineUid_Cogent=0x10005f61, EMachineUid_Win32Emulator=0x10005f62, EMachineUid_WinC=0x10005f63, EMachineUid_CL7211_Eval=0x1000604f

DeviceFamily

0=Crystal, 1=Pearl, 2=Quartz

DeviceFamilyRev

0x600=6.0, 0x610=6.1 etc

CPU

0=ARM, 1=MCORE, 2=x86

CPUArch

0x400=ARM4, 0x410=ARM4T, 0x500=ARM5, 0x300=M340, ???=x86

CPUABI

0=ARM4, 1=ARMI, 2=THUMB, 3=MCORE, 4=MSVC

CPUSpeed

CPU clock speed/1024: eg 36864=36MHz

SystemTickPeriod

Tick period in microseconds

SystemSpeed

Approximate speed relative to Series5=100

MemoryRAM

eg 0x800000

MemoryROM

eg 0xC00000

MemoryPageSize

eg 0x1000

PowerBackup

0=none, 1=supported

Keyboard

0=none, or bitmask of: 1=EKeyboard_Keypad, 2=EKeyboard_Full

KeyboardDeviceKeys

Number of device-specific keys: e.g. 5

KeyboardAppKeys

Number of application keys: e.g. 8

KeyboardClick

0=none, 1=supported

KeyboardClickVolumeMax

eg 1

DisplayXPixels

eg 640

DisplayYPixels

eg 200

DisplayXTwips

eg 3200

DisplayYTwips

eg 1440

DisplayColors

2, 4, 16, 256, 65535 etc.

DisplayContrastMax

e.g. 37

Backlight

0=none, 1=supported

Pen

0=none, 1=supported

PenX

e.g. 695

PenY

e.g. 280

PenDisplayOn

0=no, 1=yes

PenClick

0=none, 1=supported

PenClickVolumeMax

e.g. 1

Mouse

0=none, 1=supported

MouseX

e.g. 640

MouseY

e.g. 200

MouseButtons

e.g. 2

CaseSwitch

0=none, 1=supported

LEDs

e.g. 2

IntegratedPhone

0=none, 1=supported

NumHalAttributes

Number of supported HAL attributes

Language

Machine language

RemoteInstall

0=Symbian OS based install, 1=installation via a PC

Option<n>

0=option not selected, 1=option selected


Note:

Option<n> attributes behave as global variables, which is significant if there is an options line both in a main sis file and an embedded sis file.

[Top]


Options Line

Option lines are used to display a list of options to the user. The option required is selected and will usually control the installation of optional components later on in the .sis file. The syntax of the options line is as follows:

!({Option1 string language 1”,…, “Option1 string language n }, …,{Option m string language1,…,Option m string language n})

For example:

!({"Add-on 1 (20KB)"},{"Add-on 2 (75KB)"}, {"Add-on 3 (80KB)"},{"Add-on 4 (20KB)"})

Selection affects the values of special built-in attributes (option1, option2, option3,…). If option 1 is selected then the value of the option1 attribute will be 1, otherwise it would be 0. Condition-block statements that follow the option-line may test and act upon these selections. For example:

IF option1
 "addon1.opo"-"!:\System\Apps\MyApp\addon1.opo"
ENDIF

Ideally these lines should appear towards the start of the pkg file so that the user is prompted at the start of installation, however this is not required and the options may be displayed at any point in the installation

[Top]


Language independent files

Files which will be installed regardless of the language variant selected by the end user, are specified as follows;

"Source"-"Destination"[,Arguments]

For example:

"epoc32ex\ToolsAndUtilities\HelloWorld.app"-"!:\system\apps\HelloWorld\HelloWorld.app"

The source is the path and filename for the source file on the PC. The destination is the target path and filename on the Symbian OS phone. A destination must be specified unless the file is a text file displayed at install time — text files are not installed. Consequently their destination is irrelevant, and may consist of empty quotes.

A “!” character may be used in place of the drive letter if the user is to be given the choice of the drive to install the file to.

Applications must be installed to \system\apps\appname\appname.app. Other component files which form part of the application, for example resource files and application information files, should reside in the same directory as the application. If the \appname\ directory does not exist, it will be created.

Files are installed in the order in which they are specified in the pkg file.

If the file is used by other components, e.g. if it is a shared DLL for instance, you may want to avoid the possibility of it being overwritten by an earlier version. In this case, do not specify the file in this section. Instead, create a separate sis file for the shared file, including appropriate major, minor build numbers in the package header, and include the new sis file in the sis Component Files section.

An optional comma-separated list of arguments following the destination file may be specified, to describe the type of file and how it will affect the installation or removal process.

Use one of the following arguments to describe the type of file to install:

FF

FILE

Standard file. This is the default.

FT

FILETEXT

A text file whose contents will be displayed in a dialog box during installation. The dialog will display either the default Continue button, or Yes and No buttons, depending on other arguments specified. Text files are not installed on the target machine.

FN

FILENULL

A file which does not yet exist, so is not included in the sis file. It is created by the running application and will be deleted when the application is removed. The name assigned to the source file is unimportant and should be empty, i.e. “”. Note that such files will not be deleted when upgrading to a later version. This ensures that such files as .ini files, which store application preferences, are not lost in an upgrade.

FM

FILEMIME

A file which instructs the installer to pass the given file to the default application associated with the given mime type, e.g. a vcf for contact details.

FR

FILERUN

A file which will be installed on the Symbian OS phone, and run during installation and/or removal — depending on arguments RI, RR, RB described later. The file could be an executable, a document or an application.


Notes:

Use one of the following arguments for a text file, i.e. after FT has been specified, to determine how the text file dialog should be cancelled, and how cancellation should affect the installation:

TC

TEXTCONTINUE

Use a Continue button in the text file dialog. When the user presses this button the dialog is cancelled and the installation continues. This is the default.

TS

TEXTSKIP

Use Yes and No buttons in the text file dialog. If Yes is pressed, the dialog is cancelled and the installation continues. If No is pressed, the dialog is cancelled, and the installation will continue, but the next file or component specified in the pkg file will not be installed.

TE

TEXTEXIT

Use Yes and No buttons in the text file dialog. If Yes is pressed, the dialog is cancelled and the installation continues. If No is pressed, the installation is aborted and any installed files are removed.

TA

TEXTABORT

Use Yes and No buttons in the text file dialog. If Yes is pressed, the dialog is cancelled and the installation continues. If No is pressed, the installation is aborted — normally resulting in a partial installation.

One of the following arguments may be specified for a file which will be run during the installation or removal process, i.e. after FR has been specified. If the file is a document, the appropriate application will be launched. For example, on installation, you may want to open a Word document providing information about the new application.

RI

RUNINSTALL

Run the file during installation only. This is the default.

RR

RUNREMOVE

Run the file during removal only.

RB

RUNBOTH

Run the file during both installation and removal.

Use the following argument after RI, RR or RB has been specified.

RE

RUNSENDEND

Indicates that the installer should send a shutdown message to the started program in order to shut it down when the installation is complete.


Note

[Top]


Language dependent files

This format is used to specify a list of files, of which only one will be installed, depending on the language selected by the user during installation:

{ "Source FileName"..."Source FileName"}-"Destination"[,Arguments]

This format will commonly be used to specify lists of resource files. Like applications, resource files must be installed to \system\apps\appname\appname.rsc. If the appname directory does not exist, it will be created.

For example;

{
"\epoc32ex\ToolsAndUtilities\HelloWorld.ruk"
"\epoc32ex\ToolsAndUtilities\HelloWorld.rfr"
"\epoc32ex\ToolsAndUtilities\HelloWorld.rit"
}-"!:\system\apps\HelloWorld\HelloWorld.rsc"

Here, three compiled resource files are specified, but only one will be installed on the target machine. Whichever language is chosen, the resource file will be installed as ikhello.rsc.


Notes

[Top]


Requisites

A requisite component is one that is required by the component which is being installed. It must be present on the target machine and its major and minor build numbers must be the same as, or greater than, those specified — otherwise installation will fail. Its name does not need to match the name specified, as it is identified by UID. However the name will be displayed to the user if there is a problem, e.g. the component is missing.

A requisite component is specified in the following way;

(UID),Major,Minor,Build-Number,{"Requisite Name1", " Requisite Name2"}

For example;

; Depends on STDLIB being installed
(0x100002c3), 1, 0, 14, {"Standard C Library"}


Notes:

[Top]


Embedded sis files

One or more embedded sis files may be specified, to be installed as part of the installation of the main component. Embedded sis files are removed when the component within which they were embedded is removed, provided no other component has a dependency upon them.

They are specified in the following way;

@ source-filename,(component-uid)

For example;

@"CsHelpExample.sis",(0x100002c3)

[Top]


Capabilities

A capabilities line is used in conjunction with the Symbian OS Connect capabilities manager, or with the pkg appcap() function in a condition block. The capabilities manager may be used to determine the capabilities of a device or installed applications. The capabilities line is specified in the following way;

+(capid=value,…)

Device and application capabilities may be used to control specific behaviour when software is installed via a sis file or PC based software.

Device capabilities (hardware related) may also be set when the Symbian OS phone's ROM is built. The pkg file devcap() function may be used to query device capability values within a condition block.

Application capabilities are defined when a sis file is created and stored on the device in the sis stub files. Application capabilities are key/value pairs whose meaning is application specific. The capid value is a unique application specific value and the associated value is an integer which may be queried via the capabilities manager PC based interface or using the appcap() pkg file syntax in an IF…ENDIF construct.

[Top]


Comments

Lines of comment are preceded by a semicolon. They are ignored by the Installation File Generator