Format of pkg Files
There is another version of the HelloWorld example project, called HelloWorldLoc, which is a localized alternative to show how you can supply an application installation package suitable for several different locales. During installation, appropriate language versions of the resource file, caption file and even the application information file will be used. Hence all the text of the application, the name of the application and even the icons can be tailored to the needs of each supported locale. This subsection looks at the syntax of the nonlocalized .pkg file and then points out the essential differences in the localized version.
[View full widthl
; Languages - Only English so the next line is optional
&EN
; Name/caption needed for each language, caption file used if supplied ; Name, the app UID, version, minor version, build & package type #{"HelloWorld"},(0x101 F6148),1,0,0,TYPE=SISAPP
; Platform UID code required for recognition by a compatible
; device at installation time
(0x101F6F88),0,0,0, {"Series60ProductlD"}
; Four files to install
"\Epoc32\release\armi\urel\HelloWorld.aif -"l:\system\apps\HelloWorld\HelloWorld.aif
"\Epoc32\release\armi\urel\HelloWorld.r01" -"l:\system\apps\HelloWorld\HelloWorld.rsc"
"\Epoc32\release\armi\urel\HelloWorld_caption.r01" -"l:\system\apps\HelloWorld * \HelloWorld_caption.rsc"
"\Epoc32\release\armi\urel\HelloWorld.app" -"l:\system\apps\HelloWorld\HelloWorld.app" ; End of File
The HelloWorld example Is In English only. If you wish to support other languages, you must specify each one at the top of the file, and then the syntax of the rest of the file must provide options for each language/locale—this is illustrated later using the HelloWorldLoc example.
; Languages - Only English so the next line is optional
&EN
The package header contains the component name (application name in this case), the UID of the application or component, the major and minor version numbers, the build number and the package options (SISAPP)—whether this is an application installation, upgrade, patch, system option and so on.
#{"HelloWorld"},(0x101 F6148),1,0,0,TYPE=SISAPP
, Note that .exe applications do not require a value for the application UID
TIP (UID3) in their.mmp and.pkg files—for a test or experimentalexe, the application UID is typically set to zero. However, if you are going to release an .exe (say as a server) then you will need to give it a UID so that it is truly unique. If the same application UID (0) is specified in two different pkg files, then a previously installed .exe will be removed when installing a new one.
Note that within the package file, it is a requirement that a Series 60 Platform identification code be included as follows.
(0x101F6F88),0,0,0, {"Series60ProductlD"}
The platform identification code (Platform UID) enables a built-in system mechanism to issue a warning if a user attempts to install incompatible software onto a Series 60 device. The Platform UID is a 32-bit number assigned to identify a specific version of Series 60 or a particular device—it has no relationship to the three UIDs associated with executables or application documents.
All installation packages of Series 60 applications should carry the sequence in order to facilitate smooth installation of software. If the Platform UID sequence is not found, or if the UID refers to a platform release newer than in the terminal, the user will get a notification about the potential conflict. Depending upon the product, the installation process may be automatically aborted. If it is allowed to continue, there is obviously a risk of application functionality failure.
The identifier for applications that are based on Series 60 Platform first release (0.9) is0x101 F6F88 (for example, early Nokia 7650 devices were based upon this first release of Series 60). Application installation packages specifying this value are compatible with Series 60 Platform 0.9 and potentially with later releases of Series 60 Platform.
A new Series 60 Platform UID was introduced for Series 60 2.0, namely 0x101 f7960. You should use this Platform UID in applications that rely on Series 60 2.0 features and APIs. Earlier version Platform UIDs are still supported and they must be used in applications intended to run on Series 60 Platform version 0.9, 1.x, 2.x and so on.
Multiple Series 60 Platform UIDs can be defined in a .pkg file to signify all platforms and devices that an application is able to run on.
See the Advanced Application Deployment and Build Guidesection ALSO |gfer jn chapter for a more complete list of Platform UIDs.
Finally, each of the application components to be installed is listed—in this case: HelloWorld.aif, HelloWorld.rOI, HelloWorld_caption.rsc and HelloWorld.app. Note that the format of each line is the source filename followed by the location and name of the destination file.
Also note that the file locations of the application components (resulting from the build process) on the development PC will vary depending on the version of Series 60 Platform you are working with.
Version 1 .x of the SDK places the .app and all of the other files in the relative location: \Epoc32\release\armi\urel.
A version 2.x SDK build (and all CodeWarrior builds) will only put the .app file in that location; any other files (.r01, .aif, .mbm) are placed in the relative location: \Epoc32\data\z\system\apps\appname\.
Using the AnsPhone example project as an illustration, the version 1.x .pkg file would be: "\epoc32\release\armi\urel\AnsPhone.aif - "l:\system\apps\AnsPhone\AnsPhone.aif
"\epoc32\release\armi\urel\AnsPhone.app" - "l:\system\apps\AnsPhone\AnsPhone.app"
"\epoc32\release\armi\urel\AnsPhone.r01" - "l:\system\apps\AnsPhone\AnsPhone.rsc"
"\epoc32\release\armi\urel\AnsPhone.mbm" - "l:\system\apps\AnsPhone\AnsPhone.mbrm"
An equivalent version 2.x (or CodeWarrior) .pkg file would contain:
"\epoc32\data\z\system\apps\AnsPhone\AnsPhone.aif" - "l:\system\apps\AnsPhone\AnsPhone.aif "\epoc32\release\armi\urel\AnsPhone.app" - "l:\system\apps\AnsPhone\AnsPhone.app"
"\epoc32\data\z\system\apps\AnsPhone\AnsPhone.r01 " - "l:\system\apps\AnsPhone\AnsPhone.rsc" "\epoc32\data\z\system\apps\AnsPhone\AnsPhone.mbm" - "l:\system\apps\AnsPhone\AnsPhone.mbrm"
Note that the Platform UID will need to be changed between versions 1.x and 2.x of the .pkg file.
Also note that the filename extensions of the source file and the destination file in the .pkg script are not always the same. The reason is that there may be a choice of alternative source files, and this is illustrated in the HelloWorldLoc localized example later in this section.
To give the user the choice of installing the application on any drive on the device (for example, on a removable memory card instead of flash memory), the drive letter is specified by a "!" character, as illustrated in the example given here. During installation the user will be prompted with a list of alternative drives for storing the application.
* To ensure that the application always appears with the correct icon, arrange
TfP the order of the files as shown in the example provided—specifically, place the name of the .aif file before the.app file.
Average user rating: 5 stars out of 1 votes
Post a comment