×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    23

    Unable to execute file for security reasons on E61

    I wrote a s60 3rd program on s60 3rd maintenance SDK. It reads a very short web page and uses CAknInformationNote to display.
    It works on the simulator, but when installed on my E61, although i can start the program, but when i choose the menu item to start reading the web page, it refuses with an error message:
    Code:
    Unable to execute file for security reasons
    I use carbide c++, it signs sis and generates a sisx file. i don't know where the certificate comes.

    mmp file:
    Code:
    /*
    ============================================================================
     Name		: TT.mmp
     Author	  : Neil
     Copyright   : Neil
     Description : This is the project specification file for TT.
    ============================================================================
    */
    
    
    TARGET			TT_0xE3AD7FD8.exe
    TARGETTYPE		exe
    UID		  0x100039CE 0xE3AD7FD8
    
    SOURCEPATH		..\src
    SOURCE			TT.cpp
    SOURCE			TTApplication.cpp
    SOURCE			TTAppView.cpp
    SOURCE			TTAppUi.cpp
    SOURCE			TTDocument.cpp
    
    SOURCEPATH		..\data
    
    START RESOURCE	TT.rss
    HEADER
    TARGET TT_0xE3AD7FD8
    TARGETPATH resource\apps
    END //RESOURCE
    
    START RESOURCE	TT_reg.rss
    TARGET TT_0xE3AD7FD8_reg
    TARGETPATH 	  \private\10003a3f\apps
    END //RESOURCE
    
    
    
    USERINCLUDE	   ..\inc
    USERINCLUDE    ..\help
    
    SYSTEMINCLUDE	 \epoc32\include
    
    LIBRARY		   euser.lib
    LIBRARY		   apparc.lib
    LIBRARY		   cone.lib
    LIBRARY		   eikcore.lib
    LIBRARY		   avkon.lib
    LIBRARY		   commonengine.lib
    LIBRARY		   efsrv.lib 
    LIBRARY		   estor.lib
    LIBRARY        aknnotify.lib
    LIBRARY        hlplch.lib esock.lib charconv.lib insock.lib
     
    
    LANG SC
    
    VENDORID	  	  0
    SECUREID		  0xE3AD7FD8
    CAPABILITY	  	  ReadUserData
    
    #ifdef ENABLE_ABIV2_MODE
    DEBUGGABLE
    #endif
    // End of File
    SOURCEPATH ..\src
    SOURCE ShowInformationSeveralTimes.cpp
    Code snippet:
    Code:
    TInt OutputWebPageL(const TDesC& aServerName, const TDesC& aDoc)
    {
    	TRequestStatus status;
    	RSocketServ sockSrv;
    	sockSrv.Connect();
    	CleanupClosePushL(sockSrv);
    	RSocket sock;
    	TInt res = sock.Open(sockSrv, KAfInet, KSockStream, KProtocolInetTcp);
    	if (res != KErrNone)
    		{
    		CAknErrorNote *note = new (ELeave) CAknErrorNote ;
    		note->ExecuteLD(_L("Open socket error."));
    		User::Leave(res);
    		}
    	CleanupClosePushL(sock);
    /*	TNameEntry nameEntry;
    	RHostResolver resolver;
    	res = resolver.Open(sockSrv, KAfInet, KProtocolInetTcp);
    	if (res != KErrNone)
    		{
    		sockSrv.Close();
    
    		return res;
    		}
    	//resolver.GetByName(aServerName, nameEntry, status);
    	//User::WaitForRequest(status);
    	//resolver.Close();
    	/*if (status != KErrNone)
    		{
    
    		sockSrv.Close();
    		return res;
    		}*/
    	TInetAddr destAddr;
    	destAddr.Input(aServerName);
    //	destAddr = nameEntry().iAddr; // set address to DNS returned IP
    	// address
    	destAddr.SetPort(80); // Set to well-known HTTP port
    	// Connect to the remote host
    	sock.Connect(destAddr, status);
    	User::WaitForRequest(status);
    	if (status != KErrNone)
    		{
    		CAknErrorNote *note = new (ELeave) CAknErrorNote ;
    		TBuf<120> prompt;
    		prompt.Format(_L("Connect error, status = %d."), status.Int());
    
    		note->ExecuteLD(prompt);
    
    		User::Leave( status.Int());
    		}
    	// Assemble HTTP GET command
    	TBuf8<300> getBuff;
    	getBuff.Copy(_L8("GET "));
    	getBuff.Append(aDoc);
    	getBuff.Append(_L("\xD\xA"));
    	// Send HTTP GET
    	sock.Send(getBuff, 0, status);
    	
    	sock.Send(_L8("\xD\xA"), 0, status);
    	User::WaitForRequest(status);
    	TBuf8<300> buff;
    		{
    		TSockXfrLength len;
    		TBuf16<300> prompt;
    		
    		sock.RecvOneOrMore(buff, 0, status, len);
    		User::WaitForRequest(status);
    		CAknInformationNote* informationNote;
    
    		informationNote = new ( ELeave ) CAknInformationNote;
    		// Show the information Note
    		
    		CnvUtfConverter::ConvertToUnicodeFromUtf8( prompt, buff);
    		
    		informationNote->ExecuteLD(prompt );
    		User::WaitForRequest(status);
    		//PrintOutput(buff); // some generic 8-bit output-to screen or file
    		}
    
    
    		CleanupStack::PopAndDestroy( 2 );
    	return (KErrNone);
    }

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

    Re: Unable to execute file for security reasons on E61

    Since your code can be executed in the emulator, you will quickly find out what is missing after checking the logfile http://wiki.forum.nokia.com/index.php/Epocwind.out for warning messages...

  3. #3
    Super Contributor
    Join Date
    Jul 2007
    Location
    ShenZhen, China
    Posts
    4,346

    Re: Unable to execute file for security reasons on E61

    your mmp not define any capability, so you can't caller network app.
    ----------------------------
    坚持学习, 坚持编码
    http://www.devdiv.net/
    qxiaoyuan

  4. #4
    Registered User
    Join Date
    Mar 2006
    Posts
    23

    Re: Unable to execute file for security reasons on E61

    Quote Originally Posted by qxiaoyuan View Post
    your mmp not define any capability, so you can't caller network app.
    What should i do in my mmp file? i attempted to connect with WiFi and GPRS, but the same error occurred.

  5. #5
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: Unable to execute file for security reasons on E61

    Hi,
    I think you need Network capability that is you need NetworkServices in your mmp alongwith ReaduserData.
    Maximus
    S60 Developer
    Impossible is nothing

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

    Re: Unable to execute file for security reasons on E61

    Quote Originally Posted by neilxp View Post
    What should i do in my mmp file? i attempted to connect with WiFi and GPRS, but the same error occurred.
    You should check that logfile first. The bold blue text in my previous post is a link actually, you might have considered trying what happens if you click on it.

  7. #7
    Registered User
    Join Date
    Mar 2006
    Posts
    23

    Re: Unable to execute file for security reasons on E61

    Thx u all! I added NetworkServices and it works!

  8. #8
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Unable to execute file for security reasons on E61

    But do you know why you had to add that capability?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

Similar Threads

  1. Error : Cannot find file : for DUMMIES
    By PACALA_BA in forum Symbian
    Replies: 7
    Last Post: 2008-07-06, 13:18
  2. Unable to create file
    By Ajmal in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2008-06-05, 04:39
  3. Unable to execute file for security reasons for bluetooth
    By manjunaths in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2008-05-23, 10:10
  4. Replies: 2
    Last Post: 2008-05-08, 19:50
  5. Replies: 1
    Last Post: 2005-05-26, 14:22

Posting Permissions

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