×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    188

    protect uninstallation of a running console application- application manager

    Hi..

    I want to protect uninstallation of console application which is running (listening to receive SMS message)

    That is, when we try to uninstall it, it should check a text file

    c:\data\key.txt

    if (it has a text "allow" )
    -> it will allow to uninstall
    else
    ->it wont allow to uninstall

    I am referring this link

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

    but this will work for GUI application.

    how to do it for console applications

    Thanks

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

    Re: protect uninstallation of a running console application- application manager

    If you create and Connect your own RWsSession instance (instead of using CEikonEnv's), it will work in GUI-less code.

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    188

    Re: protect uninstallation of a running console application- application manager

    thank you for your reply.

    how to create RWsSession instance without using CEikonEnv? pleasde give me some code
    HTML Code:
    	const TUid KInstallerUidin3rdEd = {0xE90A2A27};
    	RWsSession& wsSession = CEikonEnv::Static()->WsSession();
    	TApaTaskList taskList(wsSession);
    	TApaTask aTask = taskList.FindApp(KInstallerUidin3rdEd);
    
    	if(aTask.Exists())
    		{
    		TBuf<20> key;
    		key.Copy(ReadFile(path));// read txt filr
    
    		_LIT(KPwd,"Allow");
    
    		if(pwd.Compare(KPwd) != 0)
    			{					
    			aTask.EndTask();
    			}
    	       }

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: protect uninstallation of a running console application- application manager

    have you checked the SDK help for CEikonEnv which says IMPORT_C CEikonEnv(); is the default constructor. so just use new (ELeave) CEikonEnv()
    Also 0xE90A2A27 can't be a installer's UID3

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    188

    Re: protect uninstallation of a running console application- application manager

    HTML Code:
    const TUid KInstallerUidin3rdEd = {0x101f875a};
    CEikonEnv* env = new CEikonEnv;
    RWsSession& wsSession = env->WsSession();
    TApaTaskList taskList(wsSession);
    TApaTask aTask = taskList.FindApp(KInstallerUidin3rdEd);
    		
    if(aTask.Exists())
    {			
    aTask.EndTask();
    }
    
    ---------
    
    const TUid KInstallerUidin3rdEd = {0x101f875a};
    CEikonEnv* env = new (ELeave) CEikonEnv();
    RWsSession& wsSession = env->WsSession();
    TApaTaskList taskList(wsSession);
    TApaTask aTask = taskList.FindApp(KInstallerUidin3rdEd);
    		
    if(aTask.Exists())
    {			
    aTask.EndTask();
    }
    This code is compiled without error.
    But, not protect the uninstallation. what is wrong?
    Last edited by kuddy_abc; 2010-08-09 at 20:28.

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

    Re: protect uninstallation of a running console application- application manager

    Quote Originally Posted by kuddy_abc View Post
    how to create RWsSession instance without using CEikonEnv? pleasde give me some code
    You have not even tried, have you?
    Here is how we create an RWsSession variable
    Code:
    RWsSession ws;
    and here is how we invoke the Connect method on it:
    Code:
    ws.Connect();
    Quote Originally Posted by kuddy_abc View Post
    what is wrong?
    What is wrong is that you can not create a variable and invoke a method on it without being given the "code" for that.

  7. #7
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    188

    Re: protect uninstallation of a running console application- application manager

    Quote Originally Posted by wizard_hu_ View Post
    You have not even tried, have you?
    Here is how we create an RWsSession variable
    Code:
    RWsSession ws;
    and here is how we invoke the Connect method on it:
    Code:
    ws.Connect();
    What is wrong is that you can not create a variable and invoke a method on it without being given the "code" for that.
    Hi..
    Thank you for your reply.
    it is working. i tested it for both GUI and console application.

    but, when i try to uninstall,
    1) GUI application --> working properly(it pop ups first "Removing" message then "Removing canceled" message)
    2) Console application --> gets stuck(it pop ups "Removing" message then gets stuck)

    what is wrong?

    thanks

Similar Threads

  1. Replies: 2
    Last Post: 2013-02-19, 10:37
  2. Replies: 3
    Last Post: 2009-01-07, 04:55
  3. How do I keep Console application running?
    By MehulPatel in forum General Messaging
    Replies: 2
    Last Post: 2008-07-25, 06:25
  4. console application not running in S602nd FP2
    By avibatbha in forum Symbian
    Replies: 6
    Last Post: 2008-01-31, 15:22
  5. Running console application on the Nokia 6630
    By so002340 in forum Symbian
    Replies: 2
    Last Post: 2004-12-23, 12:57

Posting Permissions

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