×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    54

    [Moved] How to install/uninstall an application?

    Hi

    How can I install or uninstall an application in S60 3rd?

    Thanks

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    3

    Re: How to install/uninstall an application?

    Hi, U will need a sis file of the application you want to install....You can insert the sis file into mobile device via various ways...GPRS, bluetooth, message, data cabel etc. when you insert the sis file and run it....installer will be invoked and it will guide you through the installation.

    To uninstall any application....you have to go to the application manager and select the perticular application..then select uninstall option.

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    54

    Re: How to install/uninstall an application?

    Thanks, but I mean how to install/uninstall an application programatically (from my code)?

  4. #4
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: How to install/uninstall an application?

    See the sw installer launcher in the plugin pack:
    http://wiki.forum.nokia.com/index.php/SDK_API_Plug-in

  5. #5
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    54

    Re: How to install/uninstall an application?

    It works fine for SISX files, but not for java applications. Could anyone guide me to install/uninstall a java application?

  6. #6
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,562

    Re: How to install/uninstall an application?

    Quote Originally Posted by mobi1 View Post
    It works fine for SISX files, but not for java applications. Could anyone guide me to install/uninstall a java application?
    I believe you are asking how to embed jar/jad in a sis file. Here is a way.

  7. #7
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    54

    Re: How to install/uninstall an application?

    No
    I want to have my own installer to install/uninstall applications. Now I can install/uninstall sisx files, but not the jar files. Can you help me in that?

  8. #8
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,562

    Re: How to install/uninstall an application?

    Quote Originally Posted by mobi1 View Post
    No
    I want to have my own installer to install/uninstall applications. Now I can install/uninstall sisx files, but not the jar files. Can you help me in that?

    Maybe something like this :

    Code:
    _LIT(KMyAppName, "z:\\system\\Apps\\AppInst\\Appinst.app");
    TBuf<15> filePath;
    filePath.Append(_L("E:\\MyJar.jar"));
    RApaLsSession sess;
    sess.Connect();
    CApaCommandLine * cmd=CApaCommandLine::NewL(); 
    cmd->SetLibraryNameL(KMyAppName); 
    cmd->SetDocumentNameL(filePath);
    cmd->SetCommandL(EApaCommandRun);
    sess.StartApp(*cmd);
    sess.Close();
    
    Pkg file format.
    "..\..\..\..\Epoc32\release\thumb\urel\jarInstall.exe"-"e:\system\apps\myapp\jarInstall.exe",FILERUN,RUNINSTALL

  9. #9
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    54

    Re: How to install/uninstall an application?

    I mean how to install/uninstall a java application from my application code in S60 3rd?

  10. #10
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: How to install/uninstall an application?

    Hello,
    you'll need the API plugin pack provided apart:
    http://wiki.forum.nokia.com/index.php/SDK_API_Plug-in

    then, for installing something like:

    case EHelloWorldBasicCommand2:
    {
    _LIT( KTempPath , "C:\\Data\\Installs\\BlockBuster.jad" );

    TBufC<50> FName(KTempPath);

    // Silent Installer
    SwiUI::RSWInstLauncher iLauncher;
    //RSWInstSilentLauncher iLauncher;
    //Install Option
    SwiUI::TInstallOptions iOptions;
    //Installation Option pkg
    SwiUI::TInstallOptionsPckg iOptionsPckg;

    iLauncher.Connect();

    /*
    iOptions.iUpgrade = SwiUI::EPolicyNotAllowed;
    iOptions.iOCSP = SwiUI::EPolicyNotAllowed;
    iOptions.iDrive = 'C';
    */
    iOptions.iUntrusted = SwiUI::EPolicyAllowed;
    iOptions.iCapabilities = SwiUI::EPolicyAllowed;

    iOptionsPckg = iOptions;


    iLauncher.Install(FName);

    iLauncher.Close();
    }
    break;

    and for uninstalling:

    case EHelloWorldBasicCommand2:
    {
    UninstallMIDletL();
    }
    break;

    void CHelloWorldBasicAppUi::UninstallMIDletL()
    {
    RFs fileSession;
    CDir* dirList;
    TInt i;
    TFileName fullPath;
    TUint contextUid;
    TFileName fileName;

    _LIT(KDirName1, "c:\\system\\install\\registry\\");
    _LIT(KFileSpec1,"c:\\system\\install\\registry\\*.*");

    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("temp")) == 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("BlockBuster.jar"));
    if (err != KErrNotFound)
    {
    TLex lex( fileName.Mid(0,8) );
    lex.Val( contextUid, EHex );
    //SwiUI::RSWInstSilentLauncher inst;
    SwiUI::RSWInstLauncher 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::KJavaMIMEType );
    TInt resp = inst.Uninstall( TUid::Uid(contextUid), SwiUI::KJarMIMEType );
    inst.Close();
    }
    }
    CleanupStack::PopAndDestroy(2); // buff, lBuf
    }
    }
    CleanupStack::PopAndDestroy(2); // dirList, fileSession
    }

    if this is not understandable, contact me via email, i will provide you sample applications

    best regards
    pg

  11. #11
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: How to install/uninstall an application?

    I already answered in the other thread, but adding it here could help someone else, so, here is the "official" and working solution to this problem:

    http://wiki.forum.nokia.com/index.ph...ogrammatically

    best regards
    pg

  12. #12
    Registered User
    Join Date
    Dec 2006
    Posts
    187

    Re: How to install/uninstall an application?

    I want to uninstall silently a symbian application. i m using RSWInstSilentLauncher and using


    in .h file

    SwiUI::TUninstallOptions iUnInstOptions;
    SwiUI::TUninstallOptionsPckg iUnIstOptionsPckg;


    in.cpp file i m using like this

    iUnInstOptions.iKillApp = SwiUI::EPolicyAllowed;
    iUnIstOptionsPckg = iUnInstOptions;
    const TUid KMyAppUid = {0x236586e5};

    Launcher.SilentUninstall(waiter->iStatus,KMyAppUid,iUnIstOptionsPckg, MimeType Needed );

    then what is the "Data type of the package to be uninstalled" is to be given in last parameter for symbian application.

    Thanks in advance

    Regards
    Asif Nazir

  13. #13
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: How to install/uninstall an application?

    Check swinstdefs.h for available MIME-types:
    Code:
    // Handeled mime types
    
    _LIT8( KSisxMimeType, "x-epoc/x-sisx-app" );
    _LIT8( KSisMimeType, "application/vnd.symbian.install" );
    _LIT8( KPipMimeType, "application/x-pip" );
    _LIT8( KJadMIMEType, "text/vnd.sun.j2me.app-descriptor" );
    _LIT8( KJarMIMEType, "application/java-archive" );
    _LIT8( KJavaMIMEType, "application/java");
    _LIT8( KJarxMIMEType, "application/x-java-archive");
    So if you want to uninstall java application you must use KJavaMIMEType
    Code:
    Launcher.SilentUninstall(waiter->iStatus,KMyAppUid,iUnIstOptionsPckg,  SwiUI::KJavaMIMEType );

  14. #14
    Registered User
    Join Date
    Jun 2010
    Posts
    8

    Re: How to install/uninstall an application?

    Quote Originally Posted by pavarang View Post
    Hello,
    you'll need the API plugin pack provided apart:
    http://wiki.forum.nokia.com/index.php/SDK_API_Plug-in

    then, for installing something like:

    case EHelloWorldBasicCommand2:
    {
    _LIT( KTempPath , "C:\\Data\\Installs\\BlockBuster.jad" );

    TBufC<50> FName(KTempPath);

    // Silent Installer
    SwiUI::RSWInstLauncher iLauncher;
    //RSWInstSilentLauncher iLauncher;
    //Install Option
    SwiUI::TInstallOptions iOptions;
    //Installation Option pkg
    SwiUI::TInstallOptionsPckg iOptionsPckg;

    iLauncher.Connect();

    /*
    iOptions.iUpgrade = SwiUI::EPolicyNotAllowed;
    iOptions.iOCSP = SwiUI::EPolicyNotAllowed;
    iOptions.iDrive = 'C';
    */
    iOptions.iUntrusted = SwiUI::EPolicyAllowed;
    iOptions.iCapabilities = SwiUI::EPolicyAllowed;

    iOptionsPckg = iOptions;


    iLauncher.Install(FName);

    iLauncher.Close();
    }
    break;

    and for uninstalling:

    case EHelloWorldBasicCommand2:
    {
    UninstallMIDletL();
    }
    break;

    void CHelloWorldBasicAppUi::UninstallMIDletL()
    {
    RFs fileSession;
    CDir* dirList;
    TInt i;
    TFileName fullPath;
    TUint contextUid;
    TFileName fileName;

    _LIT(KDirName1, "c:\\system\\install\\registry\\");
    _LIT(KFileSpec1,"c:\\system\\install\\registry\\*.*");

    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("temp")) == 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("BlockBuster.jar"));
    if (err != KErrNotFound)
    {
    TLex lex( fileName.Mid(0,8) );
    lex.Val( contextUid, EHex );
    //SwiUI::RSWInstSilentLauncher inst;
    SwiUI::RSWInstLauncher 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::KJavaMIMEType );
    TInt resp = inst.Uninstall( TUid::Uid(contextUid), SwiUI::KJarMIMEType );
    inst.Close();
    }
    }
    CleanupStack::PopAndDestroy(2); // buff, lBuf
    }
    }
    CleanupStack::PopAndDestroy(2); // dirList, fileSession
    }

    if this is not understandable, contact me via email, i will provide you sample applications

    best regards
    pg
    Hi, all

    I have tried these codes, but it returned an system-wide error code (-12) which means KErrPathNotFound when I excuted
    Code:
    User::LeaveIfError( fileSession.GetDir( KFileSpec1,
    KEntryAttMaskSupported,
    ESortByName, dirList ) );
    ,
    so I wonder whether the registry path exists or not. Now I don't know how to solve this problem, is there any other ways to uninstall MIDlets? I'm eager for the solutions.

    Best regards,

    David Lee
    Last edited by Li Dabao; 2010-06-30 at 08:27. Reason: mistakes found

  15. #15
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: How to install/uninstall an application?

    Hello,
    look at this article:
    http://wiki.forum.nokia.com/index.ph...ogrammatically

    somewhere it states:
    This method is deprecated and no longer works from S60 3rd Edition, Feature Pack 2 onwards.

    so, maybe this is your case.

    I don't know an alternative method, maybe a deeper search here on forum will help you...

    best regards,
    pg

Similar Threads

  1. [Moved] Can't uninstall application
    By danhicksbyron in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 8
    Last Post: 2010-03-23, 21:30
  2. [moved] Strange problem during uninstall the application..
    By aamitgupta in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 8
    Last Post: 2010-03-19, 13:14
  3. Replies: 29
    Last Post: 2008-08-20, 09:52
  4. Replies: 6
    Last Post: 2008-08-20, 08:45
  5. how to install/uninstall SIP application???
    By pahmed in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2005-06-11, 03:50

Posting Permissions

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