2679 TBuf<KSysUtilVersionTextLength> fwVersion; |
2680 TBuf<KSysUtilVersionTextLength> fwVersion; |
2680 TInt errorCode = iCentralRepository->Get( key, fwVersion ); |
2681 TInt errorCode = iCentralRepository->Get( key, fwVersion ); |
2681 if( ( errorCode == KErrNone ) && |
2682 if( ( errorCode == KErrNone ) && |
2682 ( fwVersion.Length() == 0 ) ) |
2683 ( fwVersion.Length() == 0 ) ) |
2683 { |
2684 { |
2684 // Install manifest files from ROM |
2685 // Install widgets from \private\200159C0\install\ directories (ROM and UDA image) |
2685 InstallManifestsFromRomDriveL(); |
2686 InstallWidgetsL(); |
2686 |
2687 |
2687 // install widgets from UDA image |
2688 // Install widgets from \private\200159C0\imports\ directory (UDA image) |
2688 InstallUDAWidgetsL(); |
2689 InstallUDAWidgetsL(); |
2689 |
2690 |
2690 // Post RFS installations have been done, prevent re-installations at next startup |
2691 // Post RFS installations have been done, prevent re-installations at next startup |
2691 // by reading firmware version and saving it to cenrep. |
2692 // by reading firmware version and saving it to cenrep. |
2692 GetFWVersion( fwVersion ); |
2693 GetFWVersion( fwVersion ); |
2760 res.Close(); |
2761 res.Close(); |
2761 CleanupStack::PopAndDestroy(1, &res); |
2762 CleanupStack::PopAndDestroy(1, &res); |
2762 } |
2763 } |
2763 |
2764 |
2764 // ----------------------------------------------------------------------------- |
2765 // ----------------------------------------------------------------------------- |
2765 // ChspsThemeServer::InstallManifestsFromRomDriveL() |
2766 // ChspsThemeServer::InstallWidgetsL() |
2766 // ----------------------------------------------------------------------------- |
2767 // ----------------------------------------------------------------------------- |
2767 // |
2768 // |
2768 void ChspsThemeServer::InstallManifestsFromRomDriveL() |
2769 void ChspsThemeServer::InstallWidgetsL() |
2769 { |
2770 { |
2770 if ( iRomInstaller || iManifestFiles.Count() ) |
2771 __ASSERT_DEBUG( !iRomInstaller, User::Leave( KErrGeneral) ); |
2771 { |
|
2772 // Invalid usage |
|
2773 User::Leave( KErrGeneral ); |
|
2774 } |
|
2775 iRomInstaller = ChspsRomInstaller::NewL( *this, iFsSession ); |
2772 iRomInstaller = ChspsRomInstaller::NewL( *this, iFsSession ); |
2776 #ifdef HSPS_LOG_ACTIVE |
2773 #ifdef HSPS_LOG_ACTIVE |
2777 iRomInstaller->SetLogBus( iLogBus ); |
2774 iRomInstaller->SetLogBus( iLogBus ); |
2778 #endif |
2775 #endif |
2779 |
2776 |
2780 // An array for installation files with V2 directory structure |
|
2781 RPointerArray<HBufC> pluginFolders; |
2777 RPointerArray<HBufC> pluginFolders; |
2782 CleanupClosePushL( pluginFolders ); |
2778 CleanupClosePushL( pluginFolders ); |
2783 |
2779 |
2784 // Retrieve an array of folder names |
2780 // Find UDA and ROM widgets to be installed |
2785 iRomInstaller->GetInstallationFoldersL( pluginFolders ); |
2781 iRomInstaller->FindInstallationFilesL( pluginFolders ); |
2786 |
2782 |
2787 // Add manifest files from the subfolders |
2783 // Install the manifest files |
2788 FindRomInstallationsV2L( pluginFolders ); |
2784 for( TInt index=0; index < pluginFolders.Count(); index++ ) |
2789 |
2785 { |
2790 pluginFolders.ResetAndDestroy(); |
2786 TPtrC namePtr( pluginFolders[index]->Des() ); |
2791 |
|
2792 if ( iManifestFiles.Count() < 1 ) |
|
2793 { |
|
2794 #ifdef HSPS_LOG_ACTIVE |
2787 #ifdef HSPS_LOG_ACTIVE |
2795 iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - mandatory plugins were not found from the ROM drive!" ) ); |
2788 iLogBus->LogText( _L( "ChspsThemeServer::InstallWidgetsL(): - installing configuration: %S" ), &namePtr ); |
2796 #endif |
2789 #endif |
2797 // Mandatory plugins were missing from the ROM drive |
2790 |
2798 User::Leave( KErrGeneral ); |
2791 // Synchronous method |
2799 } |
2792 ThspsServiceCompletedMessage ret = iRomInstaller->InstallThemeL( namePtr ); |
2800 |
2793 if ( ret != EhspsInstallThemeSuccess ) |
2801 CleanupStack::PopAndDestroy( 1, &pluginFolders ); |
2794 { |
2802 |
|
2803 |
|
2804 // Install configurations from the manifest files |
|
2805 ThspsServiceCompletedMessage ret = EhspsInstallThemeFailed; |
|
2806 for( TInt manifestIndex=0; manifestIndex < iManifestFiles.Count(); manifestIndex++ ) |
|
2807 { |
|
2808 // Synchronous API call |
|
2809 TPtr name( iManifestFiles[manifestIndex]->Des() ); |
|
2810 #ifdef HSPS_LOG_ACTIVE |
2795 #ifdef HSPS_LOG_ACTIVE |
2811 iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - installing ROM configuration from: %S" ), &name ); |
2796 iLogBus->LogText( _L( "ChspsThemeServer::InstallWidgetsL(): - installation failed: %S" ), &namePtr ); |
2812 #endif |
|
2813 ret = iRomInstaller->InstallThemeL( name ); |
|
2814 if ( ret != EhspsInstallThemeSuccess ) |
|
2815 { |
|
2816 #ifdef HSPS_LOG_ACTIVE |
|
2817 iLogBus->LogText( _L( "ChspsThemeServer::InstallManifestsFromRomDriveL(): - configuration is corrupted, critical error - shutting down!" ) ); |
|
2818 #endif |
2797 #endif |
2819 // User::Leave( KErrAbort ); |
2798 // User::Leave( KErrAbort ); |
2820 } |
2799 } |
2821 } |
2800 } |
2822 |
2801 |
2823 // Cancel any actions done in the previous functionality |
2802 if ( pluginFolders.Count() == 0 ) |
2824 iManifestFiles.ResetAndDestroy(); |
2803 { |
|
2804 #ifdef HSPS_LOG_ACTIVE |
|
2805 iLogBus->LogText( _L( "ChspsThemeServer::InstallWidgetsL(): - mandatory plugins were not found!" ) ); |
|
2806 #endif |
|
2807 // Mandatory plugins were missing |
|
2808 User::Leave( KErrCorrupt ); |
|
2809 } |
|
2810 |
|
2811 pluginFolders.ResetAndDestroy(); |
|
2812 CleanupStack::PopAndDestroy( 1, &pluginFolders ); |
2825 |
2813 |
2826 // The ROM installer is not needed anymore and therefore it can be released |
2814 // The ROM installer is not needed anymore and therefore it can be released |
2827 delete iRomInstaller; |
2815 delete iRomInstaller; |
2828 iRomInstaller = NULL; |
2816 iRomInstaller = 0; |
2829 |
2817 |
2830 // Force updating of the header cache |
2818 // Force updating of the header cache |
2831 ThspsRepositoryInfo info( EhspsCacheUpdate ); |
2819 ThspsRepositoryInfo info( EhspsCacheUpdate ); |
2832 iDefinitionRepository->RegisterNotification( info ); |
2820 iDefinitionRepository->RegisterNotification( info ); |
2833 } |
2821 } |
2834 |
|
2835 // ----------------------------------------------------------------------------- |
|
2836 // ChspsThemeServer::FindRomInstallationsV2L() |
|
2837 // ----------------------------------------------------------------------------- |
|
2838 // |
|
2839 void ChspsThemeServer::FindRomInstallationsV2L( |
|
2840 RPointerArray<HBufC>& aPluginFolders ) |
|
2841 { |
|
2842 _LIT(KHspsFolder, "hsps\\"); |
|
2843 TFileName hspsPath; |
|
2844 for( TInt folderIndex=0; folderIndex < aPluginFolders.Count(); folderIndex++ ) |
|
2845 { |
|
2846 // Set path |
|
2847 hspsPath.Copy( aPluginFolders[folderIndex]->Des() ); |
|
2848 hspsPath.Append( KHspsFolder ); |
|
2849 |
|
2850 // Add full path into the installation queue |
|
2851 TInt len = hspsPath.Length() + 3 + KDoubleBackSlash().Length() + KManifestFile().Length(); |
|
2852 HBufC* manifestBuf = HBufC::NewLC( len ); |
|
2853 manifestBuf->Des().Copy( hspsPath ); |
|
2854 manifestBuf->Des().Append( _L("00") ); |
|
2855 manifestBuf->Des().Append( KDoubleBackSlash ); |
|
2856 manifestBuf->Des().Append( KManifestFile ); |
|
2857 |
|
2858 iManifestFiles.AppendL( manifestBuf ); |
|
2859 CleanupStack::Pop( manifestBuf ); |
|
2860 } |
|
2861 } |
|
2862 |
2822 |
2863 // ----------------------------------------------------------------------------- |
2823 // ----------------------------------------------------------------------------- |
2864 // ChspsThemeServer::GetConfigurationHeader() |
2824 // ChspsThemeServer::GetConfigurationHeader() |
2865 // ----------------------------------------------------------------------------- |
2825 // ----------------------------------------------------------------------------- |
2866 // |
2826 // |