iaupdate/IAD/updater/src/iaupdatersilentlauncher.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 0 ba25891c3a9e
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
    41 // Symbian 2nd phase constructor can leave.
    41 // Symbian 2nd phase constructor can leave.
    42 // -----------------------------------------------------------------------------
    42 // -----------------------------------------------------------------------------
    43 //
    43 //
    44 void CIAUpdaterSilentLauncher::ConstructL()
    44 void CIAUpdaterSilentLauncher::ConstructL()
    45     {
    45     {
    46     iOptionsPckg = SilentInstallOptionsL();
    46     
       
    47     iOptionsPckg = Usif::COpaqueNamedParams::NewL();
       
    48     iResults = Usif::COpaqueNamedParams::NewL();
       
    49     
       
    50     UsifSilentInstallOptionsL( iOptionsPckg );    
       
    51 
    47     }
    52     }
    48 
    53 
    49 // -----------------------------------------------------------------------------
    54 // -----------------------------------------------------------------------------
    50 // CIAUpdaterSilentLauncher::NewL
    55 // CIAUpdaterSilentLauncher::NewL
    51 // Two-phased constructor.
    56 // Two-phased constructor.
    66 // -----------------------------------------------------------------------------
    71 // -----------------------------------------------------------------------------
    67 //
    72 //
    68 CIAUpdaterSilentLauncher::~CIAUpdaterSilentLauncher()
    73 CIAUpdaterSilentLauncher::~CIAUpdaterSilentLauncher()
    69     {
    74     {
    70     iLauncher.Close();
    75     iLauncher.Close();
       
    76     
       
    77     delete iOptionsPckg;
       
    78     delete iResults;
       
    79     
    71     }
    80     }
    72 
    81 
    73 // -----------------------------------------------------------------------------
    82 // -----------------------------------------------------------------------------
    74 // CIAUpdaterSilentLauncher::InstallL
    83 // CIAUpdaterSilentLauncher::InstallL
    75 // Perform installation.
    84 // Perform installation.
    86         iConnected = ETrue;            
    95         iConnected = ETrue;            
    87         }
    96         }
    88 
    97 
    89     // Launch the installation   
    98     // Launch the installation   
    90     IAUPDATE_TRACE("[IAUpdater] Launch silent install");                    
    99     IAUPDATE_TRACE("[IAUpdater] Launch silent install");                    
    91     iLauncher.SilentInstall( aStatus, aFile, iOptionsPckg );    
   100     iLauncher.Install( aFile, *iOptionsPckg, *iResults, aStatus );
    92 
   101 
    93     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::InstallL() end"); 
   102     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::InstallL() end"); 
    94     }
   103     }
    95        
   104        
    96 // -----------------------------------------------------------------------------
   105 // -----------------------------------------------------------------------------
   100 // 
   109 // 
   101 void CIAUpdaterSilentLauncher::Cancel()
   110 void CIAUpdaterSilentLauncher::Cancel()
   102     {
   111     {
   103     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() begin");       
   112     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() begin");       
   104 
   113 
   105     iLauncher.CancelAsyncRequest( SwiUI::ERequestSilentInstall );   
   114     iLauncher.CancelOperation();
   106 
   115 
   107     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() end"); 
   116     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::Cancel() end"); 
   108     }
   117     }
   109 
   118 
   110 
       
   111 // ---------------------------------------------------------------------------
   119 // ---------------------------------------------------------------------------
   112 // CIAUpdaterSilentLauncher::SilentInstallOptionsL
   120 // IAUpdateUtils::UsifSilentInstallOptionsL
   113 // 
   121 // 
   114 // ---------------------------------------------------------------------------
   122 // ---------------------------------------------------------------------------
   115 //
   123 
   116 SwiUI::TInstallOptions CIAUpdaterSilentLauncher::SilentInstallOptionsL() const
   124 void  CIAUpdaterSilentLauncher::UsifSilentInstallOptionsL( 
       
   125         Usif::COpaqueNamedParams * aOptions )
   117     {
   126     {
   118     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() begin"); 
   127 
       
   128     aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue );
       
   129 
       
   130     // Upgrades are allowed 
       
   131     aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, Usif::EAllowed );
   119     
   132     
   120     SwiUI::TInstallOptions options;
       
   121 
       
   122     // Upgrades are allowed        
       
   123     options.iUpgrade = SwiUI::EPolicyAllowed;
       
   124 
       
   125     // Install all if optional packets exist.
   133     // Install all if optional packets exist.
   126     options.iOptionalItems = SwiUI::EPolicyAllowed;
   134     aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, Usif::EAllowed );
   127 
   135     
   128     // Prevent online cert revocation check.
   136     // Prevent online cert revocation check.
   129     options.iOCSP = SwiUI::EPolicyNotAllowed;
   137     aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, Usif::ENotAllowed );
   130     
   138     
   131     // See iOCSP setting above
   139     // See iOCSP setting above
   132     options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed;
   140     aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed );
   133 
   141     
   134     // Do not allow installation of uncertified packages.
   142     // Do not allow installation of uncertified packages.
   135     options.iUntrusted = SwiUI::EPolicyNotAllowed;
   143     aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, Usif::ENotAllowed );
   136 
   144     
   137     // If filetexts are included in SIS package. Then, show them.
   145     // If filetexts are included in SIS package, show them.
   138     options.iPackageInfo = SwiUI::EPolicyUserConfirm;
   146     aOptions->AddIntL( Usif::KSifInParam_PackageInfo, Usif::EAllowed );
   139     
   147     
   140     // Automatically grant user capabilities.
   148     // Automatically grant user capabilities.
   141     // See also iUntrusted above.
   149     // See also KSifInParam_AllowUntrusted above.
   142     options.iCapabilities = SwiUI::EPolicyAllowed;
   150     aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, Usif::EAllowed );
   143 
   151     
   144     // Open application will be closed.
   152     // Open application will be closed.
   145     options.iKillApp = SwiUI::EPolicyAllowed;
   153     aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, Usif::EAllowed );
   146     
   154     
   147     // Files can be overwritten.
   155     // Files can be overwritten.
   148     options.iOverwrite = SwiUI::EPolicyAllowed;
   156     aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, Usif::EAllowed  );
       
   157     
       
   158     // Incompatible allowed
       
   159     aOptions->AddIntL( Usif::KSifInParam_AllowIncompatible, Usif::EAllowed  );
   149     
   160     
   150     // This only affects Java applications.
   161     // This only affects Java applications.
   151     options.iDownload = SwiUI::EPolicyAllowed;
   162     aOptions->AddIntL( Usif::KSifInParam_AllowDownload, Usif::EAllowed  );
   152 
   163     
   153     // Notice! Here we use always the same drive for the IAD.
   164     // Where to save.
   154     // So, this will not change automatically according to the disk spaces 
   165     //aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC );
   155     // and when new memory cards are inserted into the phone.    
       
   156     options.iDrive = IAUpdaterDefs::KIAUpdaterDrive;
       
   157     
   166     
   158     // Choose the phone language.
   167     // Choose the phone language.
   159     options.iLang = User::Language();
   168     TLanguage lang = User::Language();
       
   169     //aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() );
   160     
   170     
   161     // If language is asked, then use the current phone language.
   171     //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) );
   162     options.iUsePhoneLang = ETrue;
       
   163     
       
   164     // Does not affect SISX. This is for Java.
       
   165     options.iUpgradeData = SwiUI::EPolicyAllowed;
       
   166 
       
   167     IAUPDATE_TRACE("[IAUpdater] CIAUpdaterSilentLauncher::SilentInstallOptionsL() end"); 
       
   168     
       
   169     return options;
       
   170     }
   172     }
   171 
   173 
   172 
   174 
   173 // ======== GLOBAL FUNCTIONS ========
   175 // ======== GLOBAL FUNCTIONS ========
   174 
   176