Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor Sara Ali's Avatar
    Join Date
    Nov 2008
    Posts
    73
    hi all
    I want to uninstall my application programmaticly from the mobile and i used this code then made some modification to it but nothing occur
    http://wiki.forum.nokia.com/index.ph...ogrammatically
    my code
    void CreinstallContainerView::UninstallSisL()
    {
    RFs fileSession;
    CDir* dirList;
    TInt i;
    TFileName fullPath;
    TUint contextUid;
    TFileName fileName;
    _LIT(KDirName1, "c:\\system\\install\\registry\\");
    _LIT(KFileSpec1,"c:\\system\\install\\registry\\AlMosaly");

    User::LeaveIfError( fileSession.Connect() );
    CleanupClosePushL( fileSession );

    // Get the file list, sorted by name
    User::LeaveIfError( fileSession.GetDir( KFileSpec1,
    KEntryAttMaskSupported,
    ESortByName, dirList ) );
    CleanupStack::PushL(dirList);

    for ( i=0; i < dirList->Count(); i++ )
    {
    fileName = (*dirList)[i].iName;
    if( fileName.Compare(_L("Application name")) == KErrNone )
    {
    continue;
    }

    fullPath = KDirName1;
    fullPath.Append(fileName);
    RFile lFile;
    TInt err = lFile.Open( fileSession, fullPath, EFileShareAny | EFileRead );

    if(err == KErrNone)
    {
    TInt lSize;
    lFile.Size(lSize);
    RBuf8 lBuf;
    lBuf.Create(lSize);
    lBuf.CleanupClosePushL();
    lFile.Read(lBuf);//read contents into buffer
    RBuf buff;
    buff.Create(lSize);
    buff.CleanupClosePushL();
    buff.Copy(lBuf);//Copy into 16 bit buffer
    lFile.Close();
    if (err == KErrNone)
    {
    // Check for MIDlet name in the file
    err = buff.Find(_L("Application name.sis"));
    if (err != KErrNotFound)
    {
    TLex lex( fileName.Mid(0,8) );
    lex.Val( contextUid, EHex );
    SwiUI::RSWInstSilentLauncher inst;
    inst.Connect();
    SwiUI::TUninstallOptions options;
    SwiUI::TUninstallOptionsPckg optionsPckg;
    options.iKillApp = SwiUI::EPolicyAllowed;
    options.iBreakDependency = SwiUI::EPolicyAllowed;
    optionsPckg = options;
    TInt resp = inst.SilentUninstall( TUid::Uid(contextUid),
    optionsPckg,
    SwiUI::KSisMimeType );
    if(resp==1)
    { TBuf<300> c;
    c = (GetNote('%'));
    RunConfQuery1L(&c);
    }

    inst.Close();


    }
    }
    CleanupStack::PopAndDestroy(2); // buff, lBuf
    }
    }
    CleanupStack::PopAndDestroy(2); // dirList, fileSession
    }
    I added the required API,libraries,and run it in the device directly
    what is the problem ????

  2. #2
    Nokia Developer Moderator A.A.M.'s Avatar
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,311
    And what errors or panics you are getting?

    I want to uninstall my application programmaticly
    ...
    Code:
    // Check for MIDlet name in the file
    err = buff.Find(_L("Application name.sis"));
    ???

    Are you sure that you are trying to delete MIDlet (J2ME) application?

  3. #3
    Regular Contributor Sara Ali's Avatar
    Join Date
    Nov 2008
    Posts
    73
    I need to uninstall .sis application not jar
    nothing occur neither error nor panic
    I modified this code to uninstall sis
    is it only for java midlet??????????????
    Last edited by Sara Ali; 2009-07-28 at 11:49.

  4. #4
    Registered User kamalakshan's Avatar
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998
    Please verify if you have added sufficient capabilities to make use of this API.

  5. #5
    Regular Contributor Sara Ali's Avatar
    Join Date
    Nov 2008
    Posts
    73
    yes I added CAPABILITY TrustedUI

  6. #6
    Registered User kamalakshan's Avatar
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998
    Can you put logs and check if it is able to parse and find the application name properly.

Similar Threads

  1. Replies: 158
    Last Post: 2012-05-23, 19:00
  2. Application Termination in S60 5th Edition device (Nokia 5800)
    By neeraja.nokia in forum Mobile Java General
    Replies: 0
    Last Post: 2009-03-23, 08:55
  3. Раскладка клавиатуры в консоли
    By arkenoi in forum Russian Developer Forum - Форум Российских разработчиков
    Replies: 11
    Last Post: 2009-03-18, 18:27
  4. How to Set Orientation of S60 App?
    By vivekg79 in forum Symbian C++
    Replies: 4
    Last Post: 2009-03-10, 08:03
  5. Development of a dictionary application in Symbian S60
    By som_mukhopadhyay in forum Symbian C++
    Replies: 0
    Last Post: 2008-04-24, 05:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved