Symbian
Symbian OS Library

FAQ-1113 How do I avoid using absolute paths in my package file ?

[Index][spacer] [Previous] [Next]



 

Classification: General Category: Tools
Created: 08/19/2004 Modified: 09/13/2004
Number: FAQ-1113
Platform: Not Applicable

Question:
Is there a recommended way to point to files in a pkg file ?

Answer:
When you run the makesis command on a pkg file the current directory is used as the relative path from which you point to any file.
So you can package a file that exist locally in your source directory as follows:

"..\data\myfile.txt"-"c:\System\data\myfile.txt"

By default all binaries are built under the \Epoc32\Release\... directory branch when you compile and link your project. As running the makesis
command only gives you file visibility from the current directory, to avoid using any relative paths to system folders in your pkg file, the recommended way to reference
a file in the release directory is as follows:

"Epoc32\Release\thumb\urel\myapi.dll"-"c:\System\libs\myapi.dll"
"Epoc32\Release\thumb\urel\myserver.exe"-"c:\System\programs\myserver\myserver.exe"

Now when you run the makesis command you will use the -d option:

makesis -d%EPOCROOT% myfiles.pkg

The -d option allows to set a search directory if the file is not found locally. The normal practice is to pass the directory pointed by your EPOCROOT
environment variable. You need to set your EPOCROOT for this to work. If you are using the devices.exe command to manage your SDKs you can
set EPOCROOT by using the path pointed by the 'Root is...' line when you run devices.exe with the -info option.

Unlike the above the line below uses a relative path to the system folder:

"..\..\Epoc32\Release\thumb\urel\myapi.dll"-"c:\System\libs\myapi.dll"

This line expects the EPOC32 directory to be present two levels up from the current directory. Using such a relative path restricts the running of your
pkg file to a particular directory position i.e. in relation to EPOC32.