×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Smile delete application database on application Uninstall

    Hi All,

    I want to delete application database when my application is uninstall..
    i have written code in my .pkg file.

    "" -"C:\Demodatabse.db"
    but when i try to install application in my device it gives me error: file corrupted and installation is failed..
    How do i solve this problem ?

    Plz help..
    Thanks
    Kalgi Modi

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: delete application database on application Uninstall

    The correct syntax would be
    Code:
    "" -"C:\Demodatabse.db",FN
    as FILENULL.
    However this option is said to be deprecated, so you may want to test if it really works. For such test it may be a good idea to put the file into a visible location, so you can see in the File Manager if it is removed or not.
    The more current approach is to put such files into the private folder which is completely removed automatically when the application gets uninstalled.

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: delete application database on application Uninstall

    hey wizard..

    many thanks.. it works perfectly..
    Thanks
    Kalgi Modi

  4. #4
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: delete application database on application Uninstall

    Hi All,

    I have tried to put the database in private folder & its work perfectly in Nokia C7, but when i have tried to create database in private folder in Nokia E72 then it gives me error -12 (i.e. Unable to find the specified folder)
    How can i resolve this issue.??

    Plz help me..
    Thanks
    Kalgi Modi

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: delete application database on application Uninstall

    Quote Originally Posted by kalgi View Post
    Unable to find the specified folder)
    How can i resolve this issue.??
    Create it. Though I find it a bit puzzling that it exists in the C7 already.
    The installer creates the private folder only if it installs something into it.
    Otherwise you can create it manually, RFs::MkDirAll is the simplest API for this (where RFs::PrivatePath can generate the name), though there is also RFs::CreatePrivatePath.
    It also matters if you want the database on the same drive where your application is installed, or if you always want to store it on a specific drive, like c:. Were you installing the application on the same drive on both devices?

  6. #6
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: delete application database on application Uninstall

    Hi Wizard,
    thanks for the reply..
    Yes i am installing application in phone memory in both the device..

    I have used code to get private path :
    TFileName fileName;
    // Get drive which the app is installed to
    TParse parse;
    parse.SetNoWild(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName(), NULL, NULL);
    TBuf<50> iPrivatePath;
    iPrivatePath = parse.Drive();

    // Now get the private path and combine them
    RFs fileServer;
    User::LeaveIfError(fileServer.Connect());
    User::LeaveIfError(fileServer.PrivatePath(fileName));
    fileServer.Close();
    iPrivatePath.Append(fileName);
    is it correct ??
    Thanks
    Kalgi Modi

  7. #7
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: delete application database on application Uninstall

    It takes path perfectly..
    C:\Private\ec41f54a\DemoDb.db
    in that ec41f54a is my UID of application.. still it is not allowing me to create database & giving me error (i.e -12).
    What is going wrong ??
    Thanks
    Kalgi Modi

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: delete application database on application Uninstall

    You can simply pass the result to MkDirAll, and it will create the folder. The DemoDb.db will not disturb it (folder-management API-s check the argument until the last backslash). Also, on the second-third-etc. call it will return KErrAlreadyExists, but you can simply ignore it.

Similar Threads

  1. local database for application on N95 mobile
    By burinutit in forum Mobile Java General
    Replies: 7
    Last Post: 2010-06-05, 07:52
  2. Replies: 12
    Last Post: 2008-08-06, 09:54
  3. delete files on uninstall
    By Bill_Murray in forum Symbian
    Replies: 4
    Last Post: 2007-06-20, 15:37
  4. Replies: 1
    Last Post: 2004-09-03, 18:18
  5. Replies: 3
    Last Post: 2004-09-03, 08:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×