## Creating a PKG File

After creating a project for the application you are developing for a device, you will need to create a .pkg file if you are using Application CODA. A .pkg file contains all the files that will need to be downloaded to the device. Once a .pkg file is available, you can add it to a project, and the IDE will use it and additional information entered in the SIS Builder pane to create an application's .sis installation file. By default, when creating a project, the .pkg file is located in the project's sis folder.

A minimal .pkg file consists of the following lines:

- Header — provides the following information on a single line:
  - application name — name of the application displayed on the target device
  - UID — (0x10004299) unique application ID value
  - major and minor version numbers — values that represent the application's major and minor version numbers
  - current build number — value that represents the current .sis build number
- Filenames and install location — the name of the file to include in the .sis file and its install location within the target device. Each line describes a single file.
- Comments — .pkg file comment lines are preceeded by a semi-colon

### PKG File Symbols

Carbide.c++ attempts to build SIS files for the current build configuration when a PKG file exists in a given build project. However, there can be one or more SIS file per project but only one can be selected in the Installation pane for downloading and debugging. We have introduced symbols you can use within your PKG file for Carbide so that you can use one PKG file in a project to produce several different SIS files, if required.

The following symbols are available for PKG files in order to make reuse of PKG files more efficient across build targets. These symbols are only supported within Carbide.c++. They are:

- $(EPOCROOT) — the location of the epoc32 folder but not including the epoc32 folder
- $(PLATFORM) — platform designator, for example: ARMI, WINSC (Emulator) , GCCE, THUMB, etc.
- $(TARGET) — target designator UDEB (Debug) or UREL (Release)

These symbols are used to specify the input location of file resources on your host PC to be packaged in the SIS file.

#### Sample PKG file

A sample .pkg file might look like this:

;Header
#{"HelloWorld"},(0xA0004299),1,0,0
"$(EPOCROOT)epoc32\release\$(PLATFORM)\$(TARGET)\HelloWorld.exe" -"!:\sys\bin\HelloWorld.exe"
"$(EPOCROOT)epoc32\data\z\resource\apps\HelloWorld.rsc" -"!:\resource\apps\HelloWorld.rsc"
"$(EPOCROOT)epoc32\data\z\private\10003af\import\apps\HelloWorld_reg.rsc" - "!:\private\10003a3f\import\apps\HelloWorld_reg.rsc"
"$(EPOCROOT)epoc32\data\z\resource\apps\HelloWorld.mbm" -"!:\resource\apps\HelloWorld.mbm"

In addition you will need to add the PKG file to the project before building the final application. Add the pkg file in the SIS builder tab of the Carbide Build Configurations in the project properties window.

##### Related references

- SIS Builder pane
- SIS Properties