installationservices/swi/source/swis/server/installationplanner.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 12 7ca52d38f8c3
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
    65 #include "certchainconstraints.h"
    65 #include "certchainconstraints.h"
    66 
    66 
    67 #include "sisregistryserverconst.h"
    67 #include "sisregistryserverconst.h"
    68 #include "dessisdataprovider.h"
    68 #include "dessisdataprovider.h"
    69 #include "adornedutilities.h"
    69 #include "adornedutilities.h"
       
    70 #include "sislauncherclient.h"
    70 
    71 
    71 using namespace Swi;
    72 using namespace Swi;
    72 using namespace Swi::Sis;
    73 using namespace Swi::Sis;
    73 
    74 
    74 _LIT(KSysBin, "\\sys\\bin\\");
    75 _LIT(KSysBin, "\\sys\\bin\\");
   980 	ReclaimUninstallSpaceL(*application);
   981 	ReclaimUninstallSpaceL(*application);
   981 
   982 
   982 	// Size of this controller only!!
   983 	// Size of this controller only!!
   983 	TInt64 size = iContentProvider.TotalSizeL(aController.InstallBlock(), iExpressionEvaluator, EFalse);
   984 	TInt64 size = iContentProvider.TotalSizeL(aController.InstallBlock(), iExpressionEvaluator, EFalse);
   984 
   985 
   985 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   986 	// Invoke the drive selection part when the planner is not in info collection mode. Otherwise do not.
       
   987 	if (IsInInfoCollectionMode())
       
   988 		{
       
   989 		// for GetInfo purposes we select an existing system drive. We need to make sure that a valid drive is selected for installation planning,  and in any case no files will get copied there, 
       
   990 		application->UserSelections().SetDrive(iSystemDriveChar);
       
   991 		}
       
   992 	else
       
   993 		{
       
   994 	#endif
       
   995 		// If the package is partial upgrade, extract drive from the registry, and dont
   986 		// If the package is partial upgrade, extract drive from the registry, and dont
   996 		// display the drive selection option except where we are upgrading a ROM stub
   987 		// display the drive selection option except where we are upgrading a ROM stub
   997 		if(error == KErrNone && aController.Info().InstallType() == EInstPartialUpgrade && !registryEntry.IsInRomL())
   988 		if(error == KErrNone && aController.Info().InstallType() == EInstPartialUpgrade && !registryEntry.IsInRomL())
   998 			{
   989 			{
   999 			TChar drive = registryEntry.SelectedDriveL();
   990 			TChar drive = registryEntry.SelectedDriveL();
  1001 				{
   992 				{
  1002 				// Base package had hard coded file paths so we can't make
   993 				// Base package had hard coded file paths so we can't make
  1003 				// any assumptions about where to install the upgrade
   994 				// any assumptions about where to install the upgrade
  1004 				// we need to ask the user where they would like to install 
   995 				// we need to ask the user where they would like to install 
  1005 				// this upgrade
   996 				// this upgrade
  1006 				ChooseDriveDialogL(*content, *application, size);	
   997 			    #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
   998 			        if(IsInInfoCollectionMode())
       
   999 			            {
       
  1000 			            application->UserSelections().SetDrive(iSystemDriveChar);
       
  1001 			            const_cast <Sis::CController&>(aController).SetDriveSelectionRequired(ETrue);
       
  1002 			            }
       
  1003 			        else
       
  1004 			            {
       
  1005 			    #endif			            
       
  1006 				ChooseDriveDialogL(*content, *application, size);				
       
  1007                 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK                    
       
  1008                         }
       
  1009                 #endif								
  1007 				}
  1010 				}
  1008 			else
  1011 			else
  1009 				{
  1012 				{
  1010 				// install partial upgrade on the same drive as base package
  1013 				// install partial upgrade on the same drive as base package
  1011 				application->UserSelections().SetDrive(drive);
  1014 				application->UserSelections().SetDrive(drive);
  1012 				}
  1015 				}
  1013 			}
  1016 			}		       		
  1014 		else if(error == KErrNotFound && aController.Info().InstallType() == EInstPartialUpgrade &&
  1017 		else if(error == KErrNotFound && aController.Info().InstallType() == EInstPartialUpgrade &&
  1015 				iFilesFromPlannedControllers[baseControllerIndex]->Drive() != TChar(KNoDriveSelected))
  1018 		        iCurrentController > 0 && iFilesFromPlannedControllers[baseControllerIndex]->Drive() != TChar(KNoDriveSelected) )
  1016 				{
  1019 				{
  1017 				//Use the base package's drive
  1020 				//Use the base package's drive
  1018 				application->UserSelections().SetDrive(iFilesFromPlannedControllers[baseControllerIndex]->Drive());			
  1021 				application->UserSelections().SetDrive(iFilesFromPlannedControllers[baseControllerIndex]->Drive());			
  1019 				}
  1022 				}		
  1020 		else if((aController.Info().InstallType() == EInstInstallation
  1023 		else if((aController.Info().InstallType() == EInstInstallation
  1021 				|| aController.Info().InstallType() == EInstAugmentation)
  1024 				|| aController.Info().InstallType() == EInstAugmentation)
  1022 				&& iIsPropagated)
  1025 				&& iIsPropagated)
  1023 			{
  1026 			{
  1024 			// This is a removable media card stub, the files must 
  1027 			// This is a removable media card stub, the files must 
  1036 			application->UserSelections().SetDrive(iSisHelper.GetSisFileDriveL());
  1039 			application->UserSelections().SetDrive(iSisHelper.GetSisFileDriveL());
  1037 			}
  1040 			}
  1038 		else if (IsUserDriveSelectionRequiredL(aController.InstallBlock()))
  1041 		else if (IsUserDriveSelectionRequiredL(aController.InstallBlock()))
  1039 			{
  1042 			{
  1040 			// User needs to choose which drive will be used for the installation
  1043 			// User needs to choose which drive will be used for the installation
  1041 	 		ChooseDriveDialogL(*content, *application, size);	
  1044             #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
  1042 			}
  1045                 if(IsInInfoCollectionMode())
  1043 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
  1046                    {
  1044 		}
  1047                    application->UserSelections().SetDrive(iSystemDriveChar);
  1045 	#endif
  1048                    const_cast <Sis::CController&>(aController).SetDriveSelectionRequired(ETrue);
       
  1049                    }
       
  1050                 else
       
  1051                    {
       
  1052             #endif                  
       
  1053             ChooseDriveDialogL(*content, *application, size);                  
       
  1054             #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK                   
       
  1055                    }
       
  1056             #endif
       
  1057 			}
       
  1058 		
  1046 	CleanupStack::PopAndDestroy(content);
  1059 	CleanupStack::PopAndDestroy(content);
  1047 
  1060 
  1048 	// To accurately display the space avaialble for next controller 
  1061 	// To accurately display the space avaialble for next controller 
  1049 	// we need to subtract the space used by this controller
  1062 	// we need to subtract the space used by this controller
  1050 	TChar drive = application->UserSelections().Drive();
  1063 	TChar drive = application->UserSelections().Drive();
  1066 		ProcessFileDescriptionL(aFileDescription, *application, aFilesToCapabilityCheck, *filesList);
  1079 		ProcessFileDescriptionL(aFileDescription, *application, aFilesToCapabilityCheck, *filesList);
  1067 		}
  1080 		}
  1068 			
  1081 			
  1069 	// Process the actual controller, then return the application
  1082 	// Process the actual controller, then return the application
  1070 	ProcessInstallBlockL(aController.InstallBlock(), *application, aFilesToCapabilityCheck, *filesList);
  1083 	ProcessInstallBlockL(aController.InstallBlock(), *application, aFilesToCapabilityCheck, *filesList);
  1071 	
  1084 
  1072 	//Publishing the UID of the associated package.
  1085 	//Publishing the UID of the associated package.
  1073 	TUid publishUid = aController.Info().Uid().Uid();
  1086 	TUid publishUid = aController.Info().Uid().Uid();
  1074 	if(!(Swi::SecUtils::IsPackageUidPresent(publishUid, iUidList)))
  1087 	if(!(Swi::SecUtils::IsPackageUidPresent(publishUid, iUidList)))
  1075 	    {
  1088 	    {
  1076 	    TInt err = Swi::SecUtils::PublishPackageUid(publishUid, iUidList);
  1089 	    TInt err = Swi::SecUtils::PublishPackageUid(publishUid, iUidList);
  1090 	        {
  1103 	        {
  1091             DEBUG_PRINTF3(_L("CInstallationPlanner::ProcessControllerL failed to publish Uid %x with error %d."),publishUid.iUid, err);
  1104             DEBUG_PRINTF3(_L("CInstallationPlanner::ProcessControllerL failed to publish Uid %x with error %d."),publishUid.iUid, err);
  1092             User::Leave(err);
  1105             User::Leave(err);
  1093 	        }
  1106 	        }
  1094 	    }
  1107 	    }
  1095 
  1108 		
       
  1109 	// Filtering of rsc files from the set of files to be copied and using parser to 
       
  1110 	// extract app uid,foldername,filename and iconfilename 
       
  1111     #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
       
  1112     if(IsInInfoCollectionMode())
       
  1113        {        
       
  1114         _LIT(KApparcRegDir, "\\private\\10003a3f\\import\\apps\\");	
       
  1115         _LIT(KApparcRegistrationFileExtn,".rsc");
       
  1116         
       
  1117         //Getting the list of files to be added from CApplication Object
       
  1118         RPointerArray<CSisRegistryFileDescription> listOfFilesToBeAdded = application->FilesToAdd();
       
  1119         //Stores the registration resource files which are passed to the apparc parser
       
  1120         RPointerArray<TDesC> regFilesArray;	  
       
  1121         CleanupResetAndDestroyPushL(regFilesArray);
       
  1122         RPointerArray<CSisRegistryFileDescription> listOfFilesToBeExtracted;  
       
  1123         CleanupClosePushL(listOfFilesToBeExtracted);
       
  1124         RFs fs;	
       
  1125         RArray<TChar> drives;                               // Array of system drives    
       
  1126         RArray<TInt64> driveSpaces;                         // Space available on each drive
       
  1127         CleanupClosePushL(drives);
       
  1128         CleanupClosePushL(driveSpaces);
       
  1129         TInt64 currentAvailableDriveSpace = 0 ;         
       
  1130         TInt64 totalApplicationDataSize = 0;
       
  1131         CSisRegistryFileDescription* currentFileDescription = NULL;
       
  1132      
       
  1133         //Obtain the disk space available on the drives
       
  1134         iSisHelper.FillDrivesAndSpacesL(drives, driveSpaces);
       
  1135         TChar systemDrive = RFs::GetSystemDriveChar();
       
  1136         TInt driveIndex = drives.Find(systemDrive);
       
  1137         currentAvailableDriveSpace = driveSpaces[driveIndex];            //first drive is 'C' drive only
       
  1138     
       
  1139         //Opening a file server session
       
  1140         User::LeaveIfError(fs.Connect());
       
  1141         CleanupClosePushL(fs);
       
  1142         User::LeaveIfError(fs.ShareProtected());
       
  1143     
       
  1144         TInt noOfFilesToBeAdded = listOfFilesToBeAdded.Count();
       
  1145         // Processing each file and checking if a file is an resource file(*_reg.rsc or *.rsc or *.r%d)
       
  1146         for(TInt i=0 ; i < noOfFilesToBeAdded ; i++)
       
  1147             {
       
  1148             HBufC* targetFileName;	    	   	
       
  1149             targetFileName = listOfFilesToBeAdded[i]->Target().Alloc();	   
       
  1150             CleanupStack::PushL(targetFileName);
       
  1151             TParsePtrC filename(*targetFileName);	    	   
       
  1152             TBool isApparcFile = EFalse;
       
  1153             HBufC* extension = TParsePtrC(*targetFileName).Ext().AllocLC();
       
  1154             
       
  1155             if(!extension->Compare(KApparcRegistrationFileExtn)) // for resource files *_reg.rsc or *.rsc
       
  1156                 {
       
  1157                 isApparcFile = ETrue;
       
  1158                 }
       
  1159             else
       
  1160                 {
       
  1161                 TInt extnLength = extension->Length();
       
  1162                 HBufC* extn;
       
  1163                 if(extnLength == 4)                            //for localizable resource files with extn like .r01
       
  1164                     {
       
  1165                     extn = extension->Right(2).AllocLC();
       
  1166                     }
       
  1167                 else if(extnLength == 5)
       
  1168                     {
       
  1169                     extn = extension->Right(3).AllocLC();       //for localizable resource files with extn like .r101	            
       
  1170                     }
       
  1171                 else
       
  1172                     {   
       
  1173                     CleanupStack::PopAndDestroy(2, targetFileName);  //extension
       
  1174                     continue;
       
  1175                     }
       
  1176     
       
  1177                 //Check to find if the extension is of valid localizable resource files 
       
  1178                 TInt value = 0;
       
  1179                 // Declare the variable
       
  1180                 TLex lex(*extn);
       
  1181                 // Convert the descriptor into the integer number
       
  1182                 TInt err = lex.Val(value);
       
  1183                 if(err == KErrNone)
       
  1184                   {
       
  1185                   isApparcFile = ETrue;    
       
  1186                   }	        
       
  1187                 CleanupStack::PopAndDestroy(extn);	        
       
  1188                 }
       
  1189             
       
  1190             //If its an apparc file(rsc) file then add its size to the total application size
       
  1191             if(isApparcFile)
       
  1192                 {	        
       
  1193                 listOfFilesToBeExtracted.AppendL(listOfFilesToBeAdded[i]);
       
  1194                 totalApplicationDataSize += listOfFilesToBeAdded[i]->UncompressedLength();
       
  1195                 }	    
       
  1196             CleanupStack::PopAndDestroy(2, targetFileName);  //extension	    
       
  1197             }                   
       
  1198             
       
  1199         //Here we do extraction of rsc files ,before extracting files we check if there is an enough space on the disk(C drive)
       
  1200         //to extract the files then extract the file to a temporary location and
       
  1201         //check if it is a registration resource file(using target path) then store it into an array.     
       
  1202         TInt noOfFilesToBeExtracted = listOfFilesToBeExtracted.Count();            
       
  1203         DEBUG_PRINTF2(_L("Total number resource files (registration/localizable)to be extracted is %d"), noOfFilesToBeExtracted);            
       
  1204         if(0 != noOfFilesToBeExtracted)
       
  1205             {	
       
  1206             
       
  1207             //Check if there is enough space to extract the resource (registration or localizable) files    
       
  1208             if(totalApplicationDataSize > currentAvailableDriveSpace)
       
  1209                 {
       
  1210                 //No memory to extract the file
       
  1211                 User::LeaveIfError(KErrDiskFull);
       
  1212                 }
       
  1213             
       
  1214             //Extraction of rsc file to a temporary location and if it is a reg resource filr append t to an array for parsing
       
  1215             for (TInt i = 0 ; i < noOfFilesToBeExtracted ; i++)
       
  1216                 {
       
  1217                 TFileName resourceFileName;    
       
  1218                 _LIT(KResourceFileNameFmt, "%c:\\resource\\install\\temp\\0x%08x\\%S"); // Pakage Uid  
       
  1219                 TFileName finalToBeExtracted = TParsePtrC(listOfFilesToBeExtracted[i]->Target()).NameAndExt();              	             	                 
       
  1220                 resourceFileName.Format(KResourceFileNameFmt, TUint(systemDrive), aController.Info().Uid().Uid().iUid,
       
  1221                         &finalToBeExtracted);
       
  1222                 
       
  1223                  TInt err = fs.MkDirAll(resourceFileName);
       
  1224                  if (err!= KErrNone && err != KErrAlreadyExists)
       
  1225                      User::LeaveIfError(err);                                           
       
  1226                               
       
  1227                  RFile resourceFile;    
       
  1228                  User::LeaveIfError(resourceFile.Replace(fs, resourceFileName, 
       
  1229                      EFileStream|EFileWrite|EFileRead|EFileShareExclusive));
       
  1230                  CleanupClosePushL(resourceFile);	         	         
       
  1231                  
       
  1232                  // Extract resource file to a temporary file.
       
  1233                  DEBUG_PRINTF2(_L("Current resource file (registration/localizable) to be extraced is %S"), &resourceFileName);
       
  1234                  User::LeaveIfError(iSisHelper.ExtractFileL(fs, resourceFile,
       
  1235                          listOfFilesToBeExtracted[i]->Index(), application->AbsoluteDataIndex(), UiHandler()));	 
       
  1236                  
       
  1237                  CleanupStack::PopAndDestroy(&resourceFile);
       
  1238                                   
       
  1239                  // If target of the file is apparc's private folder then it is registration resource file for an app
       
  1240                  TParsePtrC filename(listOfFilesToBeExtracted[i]->Target());
       
  1241                  if (filename.Path().Left(KApparcRegDir().Length()).CompareF(KApparcRegDir) == 0)
       
  1242                      {
       
  1243                      HBufC* regResourceFileName = resourceFileName.AllocL();
       
  1244                      
       
  1245                      regFilesArray.AppendL(regResourceFileName);   	             
       
  1246                      }   
       
  1247                  }
       
  1248             //Since the files have been extracted the available disk space is reduced
       
  1249             currentAvailableDriveSpace -= totalApplicationDataSize;                
       
  1250             }            
       
  1251     
       
  1252         DEBUG_PRINTF(_L8("Finished extracting all resource files (registration/localizable) successfuly"));
       
  1253         //Pass each registration resource file to the parser to fetch the app info  and then if icon file is present fetch the icon file
       
  1254         //to a temporary location.
       
  1255             
       
  1256         TInt noOfRegFilesToBeParsed = regFilesArray.Count();        
       
  1257         DEBUG_PRINTF2(_L("Total number Registration Resource files to be parsed is %d"), noOfRegFilesToBeParsed);        
       
  1258         for(TInt i = 0 ; i < noOfRegFilesToBeParsed ; i++)
       
  1259             {	   	    
       
  1260             Usif::CApplicationRegistrationData *appData = NULL;	    	    
       
  1261             CNativeComponentInfo::CNativeApplicationInfo* applicationInfo = NULL;
       
  1262             RArray<TLanguage> languages;	 
       
  1263             TFileName iconFile;	    
       
  1264             // Calling the apparc parser to fetch the app info from the resouce files	
       
  1265             
       
  1266             DEBUG_PRINTF2(_L("Current Registration Resource file to be parsed is %S"), regFilesArray[i]);
       
  1267             
       
  1268             // Ask the launcher to parse the registration resource file 
       
  1269             RSisLauncherSession launcher;
       
  1270             CleanupClosePushL(launcher);
       
  1271             User::LeaveIfError(launcher.Connect());
       
  1272             RFile file;
       
  1273             User::LeaveIfError(file.Open(fs, *regFilesArray[i], EFileRead));
       
  1274             RArray<TLanguage> appLanguages;
       
  1275             CleanupClosePushL(appLanguages);
       
  1276             TRAPD(err,appData=launcher.SyncParseResourceFileL(file, appLanguages));
       
  1277             CleanupStack::PopAndDestroy(&appLanguages);
       
  1278             file.Close();
       
  1279             CleanupStack::PopAndDestroy(&launcher);            // popping and destroying as it is not reqd further.
       
  1280             
       
  1281             DEBUG_PRINTF2(_L("Finished Parsing Registration Resource file %S successfuly"), regFilesArray[i]);
       
  1282             if(KErrCorrupt == err)	        
       
  1283                 {	                                       
       
  1284                 continue;
       
  1285                 }
       
  1286             else if(KErrNone != err)
       
  1287                 {	                                             
       
  1288                 User::Leave(err);
       
  1289                 }
       
  1290             
       
  1291             CleanupStack::PushL(appData);
       
  1292             TUid appuid = appData->AppUid();            
       
  1293             HBufC* finalAppName = TParsePtrC(appData->AppFile()).NameAndExt().AllocLC();
       
  1294             const RPointerArray<Usif::CLocalizableAppInfo> aLocalizableAppInfoList = appData->LocalizableAppInfoList();
       
  1295             HBufC* groupName = NULL;
       
  1296             HBufC* iconFileName = NULL;
       
  1297             TInt fileSize = 0 ;
       
  1298             
       
  1299             //If localizable info for an app is present get the localized group name, else get it from app registration data 
       
  1300             if(0 == aLocalizableAppInfoList.Count())
       
  1301                 {
       
  1302                 if(appData->GroupName().Length())
       
  1303                     {
       
  1304                     groupName = appData->GroupName().AllocLC();
       
  1305                     DEBUG_PRINTF2(_L("Application Group Name %S"), groupName);
       
  1306                     }
       
  1307                 //Since locale does not exists no need to extract, create CNativeApplicationInfo without iconFileName
       
  1308                 applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), _L(""));  
       
  1309                 }
       
  1310             else
       
  1311                 {
       
  1312                 Usif::CLocalizableAppInfo* localizedInfo = NULL;
       
  1313                 const Usif::CCaptionAndIconInfo* captionAndIconInfo = NULL;
       
  1314                 localizedInfo = aLocalizableAppInfoList[0];
       
  1315                 if(localizedInfo->GroupName().Length())
       
  1316                     {
       
  1317                     groupName = localizedInfo->GroupName().AllocLC();
       
  1318                     }
       
  1319                 captionAndIconInfo = localizedInfo->CaptionAndIconInfo();
       
  1320                 //Check if caption and icon info for an app is present or not, if present extract the icon file.
       
  1321                 if(captionAndIconInfo)
       
  1322                     {
       
  1323                     if(captionAndIconInfo->IconFileName().Length())
       
  1324                         iconFileName = captionAndIconInfo->IconFileName().AllocLC();
       
  1325                     
       
  1326                     if(iconFileName != NULL)
       
  1327                         {                        
       
  1328                         HBufC* finalIconFileName = TParsePtrC(*iconFileName).NameAndExt().AllocLC();
       
  1329                         
       
  1330                         _LIT(KIconFileNameFmt, "%c:\\resource\\install\\icon\\0x%08x\\%S");     // Applicaiton Uid
       
  1331                         iconFile.Format(KIconFileNameFmt, TUint(systemDrive), appuid.iUid,
       
  1332                         finalIconFileName);
       
  1333                         
       
  1334                         TInt err = fs.MkDirAll(iconFile);
       
  1335                         if (err!= KErrNone && err != KErrAlreadyExists)
       
  1336                         User::LeaveIfError(err);
       
  1337                         
       
  1338                         //Find from the list of files to be copied , the file description of the icon file returned by the parser
       
  1339                         for(TInt k = 0; k < listOfFilesToBeAdded.Count() ; k++)
       
  1340                             {                      
       
  1341                             currentFileDescription = listOfFilesToBeAdded[k];
       
  1342                             if(TParsePtrC(currentFileDescription->Target()).NameAndExt().Compare(*finalIconFileName))
       
  1343                                 {
       
  1344                                 break;
       
  1345                                 }
       
  1346                             }	              
       
  1347                         //Check if there is enough space to extract the icon file           
       
  1348                         fileSize = currentFileDescription->UncompressedLength();
       
  1349                         if(currentAvailableDriveSpace <  fileSize)
       
  1350                             {
       
  1351                             //No memory to extract the file
       
  1352                             User::LeaveIfError(KErrDiskFull);
       
  1353                             }
       
  1354                         
       
  1355                         //Extracting the icon file to a temp location
       
  1356                         RFile tempIconFile;
       
  1357                         TInt index = 1;
       
  1358                         TBuf<10>  integerAppendStr;
       
  1359                         // Check if file already exists, if yes then create file with another name (e.g. *_1 or *_2)
       
  1360                         while(1)
       
  1361                             {	                  
       
  1362                             err = tempIconFile.Create(fs, iconFile, EFileStream|EFileWrite|EFileRead|EFileShareExclusive);
       
  1363                             if(err == KErrAlreadyExists)
       
  1364                                 {	                     
       
  1365                                 integerAppendStr.TrimAll();
       
  1366                                 integerAppendStr.Format(_L("%d"), index++);
       
  1367                                 TInt pos = iconFile.Length()-TParsePtrC(iconFile).Ext().Length();
       
  1368                                 iconFile.Insert(pos,integerAppendStr);	                      
       
  1369                                 }
       
  1370                             else if(err == KErrNone)
       
  1371                                 {
       
  1372                                 //Everthing is fine, proceed	                      
       
  1373                                 break;               
       
  1374                                 }
       
  1375                             else
       
  1376                                 {
       
  1377                                 tempIconFile.Close();
       
  1378                                 User::Leave(err);
       
  1379                                 }
       
  1380                             }
       
  1381                         CleanupClosePushL(tempIconFile);  
       
  1382                         
       
  1383                         DEBUG_PRINTF2(_L("Icon file to be extraced is %S"), &iconFile);
       
  1384                         User::LeaveIfError(iSisHelper.ExtractFileL(fs, tempIconFile, listOfFilesToBeAdded[i]->Index(), application->AbsoluteDataIndex(), UiHandler())); 	              
       
  1385                         DEBUG_PRINTF(_L8("Finished extracting Icon file successfuly"));
       
  1386                         //After copy the available disk space is reduced
       
  1387                         currentAvailableDriveSpace -= fileSize;                        
       
  1388                         CleanupStack::PopAndDestroy(3,iconFileName);  //file,finalIconFileName,iconFileSize
       
  1389                         
       
  1390                         //Create CNativeApplicationInfo with iconFileName
       
  1391                         applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), iconFile);                                          
       
  1392                         }
       
  1393                     else
       
  1394                         {
       
  1395                         //Since iconFileName does not exists no need to extract, create CNativeApplicationInfo without iconName
       
  1396                         applicationInfo = Swi::CNativeComponentInfo::CNativeApplicationInfo::NewLC(appuid, *finalAppName, groupName?*groupName:_L(""), _L(""));  
       
  1397                         }
       
  1398                     }
       
  1399                 }	    
       
  1400 
       
  1401             DEBUG_PRINTF2(_L("Application Uid 0x%08x"), appuid);
       
  1402             DEBUG_PRINTF2(_L("Application Name %S"), finalAppName);
       
  1403             if(groupName)
       
  1404                 DEBUG_PRINTF2(_L("Application Group Name %S"), groupName);
       
  1405             if(iconFile.Length())
       
  1406                 DEBUG_PRINTF2(_L("Application Icon File Name %S"), &iconFile);
       
  1407                              
       
  1408             const_cast <Sis::CController&>(aController).AddApplicationInfoL(applicationInfo);
       
  1409             CleanupStack::Pop(applicationInfo);
       
  1410             if(groupName)
       
  1411                 CleanupStack::PopAndDestroy(3, appData);	//groupName,finalAppName,appData
       
  1412             else
       
  1413                 CleanupStack::PopAndDestroy(2, appData);    //finalAppName,appData
       
  1414             languages.Close();	    
       
  1415             }
       
  1416               
       
  1417         CleanupStack::PopAndDestroy(3,&drives);  //fs,driveSpaces,drives
       
  1418         CleanupStack::Pop(&listOfFilesToBeExtracted);
       
  1419         listOfFilesToBeExtracted.Close(); 
       
  1420         CleanupStack::PopAndDestroy(&regFilesArray);  
       
  1421       }       
       
  1422     #endif    
       
  1423     
  1096 	//Append planned controllers list
  1424 	//Append planned controllers list
  1097 	iFilesFromPlannedControllers.AppendL(filesList);
  1425 	iFilesFromPlannedControllers.AppendL(filesList);
  1098 	CleanupStack::Pop(filesList);
  1426 	CleanupStack::Pop(filesList);
  1099 
  1427 
  1100 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
  1428 	#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
  1101 	// Some files may need to be questioned of overwrite only when the planner is not in info collection mode.
  1429 	// Some files may need to be questioned of overwrite only when the planner is not in info collection mode.
  1102 	if (!IsInInfoCollectionMode())	
  1430 	if (!IsInInfoCollectionMode())	
  1103 	#endif
  1431 	#endif
  1104 	 //Some files may need to be questioned of overwrite
  1432 	//Some files may need to be questioned of overwrite
  1105 		WarnEclipseOverWriteL(*application);
  1433 		WarnEclipseOverWriteL(*application);
  1106  	
  1434  	
  1107  	// Reset the file list array for next controller use
  1435  	// Reset the file list array for next controller use
  1108  	iEclipsableOverwriteFiles.Reset();
  1436  	iEclipsableOverwriteFiles.Reset();
  1109 
  1437 
  1112 	CleanupStack::PopAndDestroy(2, &registrySession); // registryEntry, registrySession
  1440 	CleanupStack::PopAndDestroy(2, &registrySession); // registryEntry, registrySession
  1113 
  1441 
  1114   	CleanupStack::Pop(application); 
  1442   	CleanupStack::Pop(application); 
  1115 	return application;
  1443 	return application;
  1116 	}
  1444 	}
  1117 
  1445 	
  1118 
       
  1119 // Prepare the eclipsable files list from the right source according to the upgrade.	
  1446 // Prepare the eclipsable files list from the right source according to the upgrade.	
  1120 void CInstallationPlanner::PrepareEclipsableFilesListL(const Sis::CController& aController)
  1447 void CInstallationPlanner::PrepareEclipsableFilesListL(const Sis::CController& aController)
  1121 	{
  1448 	{
  1122 	// If the package is allowed to install based on SU Cert rule, then no need to generate 
  1449 	// If the package is allowed to install based on SU Cert rule, then no need to generate 
  1123 	// eclipsable file list, it can eclipse any files from rom	
  1450 	// eclipsable file list, it can eclipse any files from rom