×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    6

    Smile UNInstall Symbian Applications Programmatically

    please help me on these

  2. #2
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: UNInstall Symbian Applications Programmatically

    Quote Originally Posted by mozuffer View Post
    please help me on these
    you can not uninstall same application from code for this you need to create another application which uninstall your another application.

    for example

    you have two applications A and B, you want to uninstall a programmatic, so you need to write the uninstall code in you B application and launch this B application from A which uninstall your A application.

    you need to send B .sis file from A.sis file, so you will embedded the B.sis file in A PKG file, so B.sis file install automatic.

    LaunchB.sis file exe which will uninstall your A.sis.

    Code:
    //against swinstcli.lib
    
    
    #include <swinstapi.h>
    #include <swinstdefs.h>
    
    
    SwiUI::RSWInstLauncher iLauncher ;
    		SwiUI::TUninstallOptions iOptions;
    		SwiUI::TUninstallOptionsPckg iOptionsPckg; 
    iOptions.iKillApp=SwiUI::EPolicyAllowed;
        iOptions.iBreakDependency = SwiUI::EPolicyAllowed; 
        iOptionsPckg = iOptions; 
    	TUid kUid = {//UID of your A.sis file};//UID of your A.sis file 
    	iLauncher.Connect();
    	// Uninstall Without Call back request
    	TInt a;
    	a=iLauncher.Uninstall(kUid,SwiUI::KSisxMimeType) ;
    //	a=iLauncher.SilentUninstall(kUid, iOptionsPckg,SwiUI::KSisxMimeType) ;
    	
    	TBuf<20> ab;
    	ab.AppendNum(a);
    	iLauncher.Close();
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  3. #3
    Registered User
    Join Date
    Dec 2009
    Posts
    6

    Thumbs up Re: UNInstall Symbian Applications Programmatically

    Thank you for your help

    but for the // a=iLauncher.SilentUninstall(kUid, iOptionsPckg,SwiUI::KSisxMimeType) ;
    we need capabilities called TrustedUI

    Regards
    Mozuffer

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: UNInstall Symbian Applications Programmatically

    If the API requires the capability, you do need to add it to your process, otherwise you can not use the API.

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

    Re: UNInstall Symbian Applications Programmatically

    Dear Amit,
    i've tried your solution, but the uninstaller hangs and the phone blocks :-)

    From what you've written i understood that if you have uninstaller a.exe and application b.exe, you suggest to create a b.sis and embed into it the a.sis... so maybe b.pkg has a line like this @"a.sis"(uid)....
    but should'nt be the opposite? i.e. create a.sis and embed b.sis...? otherwise the whole process hangs...
    or maybe i've written the wrong line @"a.sis" in the wrong place?

    thank you in advance,
    best regards
    PG

  6. #6
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: UNInstall Symbian Applications Programmatically

    Quote Originally Posted by pavarang View Post
    Dear Amit,
    i've tried your solution, but the uninstaller hangs and the phone blocks :-)

    From what you've written i understood that if you have uninstaller a.exe and application b.exe, you suggest to create a b.sis and embed into it the a.sis... so maybe b.pkg has a line like this @"a.sis"(uid)....
    but should'nt be the opposite? i.e. create a.sis and embed b.sis...? otherwise the whole process hangs...
    or maybe i've written the wrong line @"a.sis" in the wrong place?

    thank you in advance,
    best regards
    PG
    there is no matter which sis file you want to make main and which one is embedded, but right this you should embedded the uninstall.sis file in main pkg file. so both the sis file will install and uninstall.sis file has different UID.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: UNInstall Symbian Applications Programmatically

    could it be the the issue identified in #2 post: "you can not uninstall same application from code for this you need to create another application which uninstall your another application."

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

    Re: UNInstall Symbian Applications Programmatically

    thank you symbianyukka, but i think i did it...

    i have exe A
    and i have exe B that uninstall exe A

    when installed with 2 different sis, exe B uninstall A when called from A, now i'd like to have a single SIS... is it possible?

    thank you,
    PG

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: UNInstall Symbian Applications Programmatically

    I suppose you can not have one sis, since you can not uninstall the sis from the exe's supplied in it.

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

    Re: UNInstall Symbian Applications Programmatically

    well, in fact you can have one SIS....
    in the meantime i've done some tests, here the results:
    1. if you package like suggested by Amit, the whole process hangs
    2. if you package like i suggested (the uninstaller sis embeds the app sis) everything is fine, but of course you leave the uninstaller on the phone....

    br,
    PG

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: UNInstall Symbian Applications Programmatically

    A close thing you can do is deploying B.sis in A.sis (not via embedding, but as a normal file). Then when A.exe wants to get uninstalled, it can install B.sis, start B.exe, and B.exe can uninstall A.sis (which removes "A.exe" - so the application -, and B.sis - the file - too, however B.exe remains installed).

    EDIT: Ok, I see, Aamitgupta has suggested the same - though used the word 'embedded'

  12. #12
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: UNInstall Symbian Applications Programmatically

    Quote Originally Posted by symbianyucca View Post
    I suppose you can not have one sis, since you can not uninstall the sis from the exe's supplied in it.
    Yes Yukka you are right but another sis file exe can uninstall the any sis file from phone i did this by following steps.

    1: I added uninstall sis file in pkg file not embedded, i only send it through pkg in any folder of phone.
    "pkg\uninstall.sis" -"!:\uninstall.sis"

    2: Now i install uninstall.sis file programmatic through my main application GUI.

    3: this uninstall.sis file has an exe which can uninstall my main application.

    4: i launch the uninstall.sis file exe from my main application code.

    5: and my main application uninstalled, but in this case uninstall.sis file i available in the phone, and we can see in App Manager.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  13. #13
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: UNInstall Symbian Applications Programmatically

    Quote Originally Posted by wizard_hu_ View Post
    A close thing you can do is deploying B.sis in A.sis (not via embedding, but as a normal file). Then when A.exe wants to get uninstalled, it can install B.sis, start B.exe, and B.exe can uninstall A.sis (which removes "A.exe" - so the application -, and B.sis - the file - too, however B.exe remains installed).

    EDIT: Ok, I see, Aamitgupta has suggested the same - though used the word 'embedded'
    yes wizard, i used the wrong word "Embedded" sorry for that.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  14. #14
    Registered User
    Join Date
    Feb 2012
    Posts
    61

    Re: UNInstall Symbian Applications Programmatically

    I am trying to unistall an application with this code:

    SwiUI::TUninstallOptions options;
    SwiUI::TUninstallOptionsPckg optionsPckg;
    options.iKillApp = SwiUI::EPolicyAllowed;
    options.iBreakDependency = SwiUI::EPolicyAllowed;
    optionsPckg = options;

    TUid kUid = {0xA000D7CE};

    //Silent uninstall

    qDebug() << "Ready TO UNISTALL!";
    TInt resp = iLauncher.SilentUninstall(kUid,optionsPckg,SwiUI::KSisxMimeType);

    qDebug() << "response=" << resp;
    qDebug() << "DONE!";


    Response is always -1 and nothing happens. That kUId is retrieved from that app PKG file but since I am using Qt Creator there are actually 3 PKG files with diferent UIDs. (hellow_template.pkg, hellow_stub.pkg and hellow_installer.pkg).

    Any ideas?

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: UNInstall Symbian Applications Programmatically

    -1 is KErrNotFound (http://www.developer.nokia.com/Commu...ki/Error_codes), so you may really-really want to make sure that the PkgUID is correct.

Similar Threads

  1. Cool symbian sites for applications?
    By jannier in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2008-12-04, 09:38
  2. how to call symbian c++ methods in MIDP java applications?
    By SanjayKhuntia in forum Mobile Java General
    Replies: 4
    Last Post: 2008-10-30, 10:47
  3. Nokia Test Criteria for Symbian C++ applications
    By kumar_sai123 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 2
    Last Post: 2008-08-18, 17:00
  4. Porting Java Applications to Symbian
    By arpitm in forum Mobile Java General
    Replies: 7
    Last Post: 2007-10-31, 07:15
  5. Replies: 0
    Last Post: 2006-04-06, 00:24

Posting Permissions

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