Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 13:17, 8 December 2007.

Getting application installation path

From Forum Nokia Wiki

End user can install application on either C: (Phone Memory) or E: (Memory Card- MMC). Sometimes programmers need to know which is the installation drive.


CompleteWithAppPath() from aknutils.h is used to determine installation path of the application.

void CYrContainer::GetFullPathL(const TFileName& aFileName)
{      
	TFileName completePath(aFileName);
	// insert the full application path into the file name
 
	CompleteWithAppPath(completePath); // from aknutils.h
 
        
        //Just for displaying what we have got in 'completePath'
	CAknInformationNote* info= new(ELeave) CAknInformationNote;
	info->ExecuteLD(completePath);
 
        // implement your own logic once you get complete path
        .....
        ..... 
}


Now call GetFullPathL() according to your requirements.

Following are some sample scenario which illustrate usage of CompleteWithAppPath().

Scenario 1:

We need to open/read Test.txt file which is supplied to application installation path.

_LIT(KMyFileName, "Test.txt");
TBuf16<50> FileName;
FileName.Copy(KMyFileName);
GetFullPathL(FileName);
 
 
-------------------------------------
Output: C:\System\apps\myapp\Test.txt
	           or 
        E:\System\apps\myapp\Test.txt

Scenario 2:

We need to open/read Test.txt file which is supplied to root directory.

If your file is located on root, then feed following path

_LIT(KMyFileName, "\\Test.txt");
TBuf16<50> FileName;
FileName.Copy(KMyFileName);
GetFullPathL(FileName);
 
 
-------------------
Output: C:\Test.txt
	    or
        E:\Test.txt

Scenario 3:

We need to open/read Test.txt file which is supplied to \System folder.

If your file is located on \System, then feed following path:

_LIT(KMyFileName, "\\System\\Test.txt");
TBuf16<50> FileName;
FileName.Copy(KMyFileName);
GetFullPathL(FileName);
 
 
--------------------------------
Output: C:\System\Test.txt
	       or
	E:\System\Test.txt
Related Discussions
Thread Thread Starter Forum Replies Last Post
Where is my file? patbys General Symbian C++ 3 2003-05-29 10:04
Application Installation on Devices raks35 Mobile Java Tools & SDKs 3 2007-09-27 05:59
S60 3rd edition SDK Emulator query DanDanDan Symbian Tools & SDKs 10 2008-02-02 13:56
Self-Copy while installation william2008 General Symbian C++ 13 2007-06-12 08:02
mekesis don't create .exe file Pando General Symbian C++ 12 2008-04-26 11:17
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX