Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Determining the application path using Symbian C++

From Wiki
Jump to: navigation, search
Article Metadata
CompatibilityArticle
Created: User:Technical writer 1 (08 Aug 2008)
Last edited: hamishwillee (19 Sep 2012)

Contents

Description

The end user can install applications either on the C: (phone memory) or E: (memory card, flash, or hard disk) drive. Applications may need to be aware of their installation location. The way the installation location is determined depends on the S60 platform version.

Solution

S60 3rd Edition (and later)

From S60 3rd Edition onwards, all application binaries (EXE and DLL files) are stored under \sys\bin. To access this directory, the application needs AllFiles capability. Resources and data cannot be stored in this directory. Instead, applications have their own restricted view on the file system consisting of the directory subtree \private\<SID>\, where SID is a security identifier, unique to each process. Applications use their private directory to hold .ini, .mbm, .rsc, and data files. Other processes cannot access the directory without the AllFiles capability.

CompleteWithAppPath() will always return \sys\bin as the application installation path on S60 3rd Edition. To access application data files located in the application's private directory, a different way to construct the path is needed:

TFileName appPath;
TBuf<2> appDrive;
 
// Returns private path of this application
// in following format: \Private\<SID of the application>\
// (does not contain drive specification).

iEikonEnv->FsSession().PrivatePath( appPath );
 
// Extract drive letter into appDrive
appDrive.Copy(iEikonEnv->EikAppUi()->Application()->AppFullName().Left(2));
 
// Insert drive letter into path
appPath.Insert(0, appDrive);


S60 2nd Edition

On S60 2nd Edition, use the CompleteWithAppPath( TDes& aFileName ) method from aknutils.h. All the components that are specified in the given descriptor (drive letter, path, and file name including the extension) are returned in the result; any missing components (path and drive letter) are taken from the application path (<drive>:\system\apps\<application_name> directory).

#include <aknutils.h>
 
// Insert the full application path into the file name (fileName)
TFileName fullPath(fileName);
CompleteWithAppPath(fullPath); // from aknutils.h

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

This page was last modified on 19 September 2012, at 00:15.
92 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×