installationservices/swi/source/swis/server/installserver.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 0 ba25891c3a9e
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
     1 /*
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   334 	}
   334 	}
   335 
   335 
   336 // Initiate server exit when the timer expires
   336 // Initiate server exit when the timer expires
   337 void CInstallServerShutdown::RunL()
   337 void CInstallServerShutdown::RunL()
   338 	{
   338 	{
       
   339     DeleteTempRscFilesL();
   339 	CActiveScheduler::Stop();
   340 	CActiveScheduler::Stop();
   340 	}
   341 	}
       
   342 
       
   343 void CInstallServerShutdown::DeleteTempRscFilesL()
       
   344     {
       
   345     DEBUG_PRINTF(_L8("Deleting temporary application registration rsource files"));
       
   346     TChar systemDrive = RFs::GetSystemDriveChar();
       
   347     TFileName tempResourceFileLocation; 
       
   348     _LIT(KTempRscFileLocation, "%c:\\resource\\install\\temp\\");
       
   349     tempResourceFileLocation.Format(KTempRscFileLocation, TUint(systemDrive));
       
   350     RFs fileSession;    
       
   351     User::LeaveIfError(fileSession.Connect());
       
   352     CleanupClosePushL(fileSession);   
       
   353     CFileMan* fileManager = NULL;
       
   354     TRAPD(err, fileManager = CFileMan::NewL(fileSession))
       
   355     if (KErrNone != err)
       
   356         {
       
   357         DEBUG_PRINTF2(_L8("Can not delete temp app rsc files %d"), err);
       
   358         if(NULL != fileManager)
       
   359             delete fileManager;
       
   360         CleanupStack::Pop(&fileSession);
       
   361         fileSession.Close();  
       
   362         return;
       
   363         }        
       
   364     
       
   365     err = fileManager->RmDir(tempResourceFileLocation);
       
   366     if (KErrNone != err)
       
   367         DEBUG_PRINTF2(_L8("Deleting temp app rsc file resulted in an error %d"), err);
       
   368     
       
   369     delete fileManager;
       
   370     CleanupStack::Pop(&fileSession);
       
   371     fileSession.Close();    
       
   372     }
   341 
   373 
   342 //
   374 //
   343 // CInstallServer
   375 // CInstallServer
   344 //
   376 //
   345 
   377