iaupdate/IAD/engine/controller/src/iaupdateutils.cpp
changeset 53 ae54820ef82c
parent 52 92f864ef0288
child 72 a0dc14075813
equal deleted inserted replaced
52:92f864ef0288 53:ae54820ef82c
   507 // ---------------------------------------------------------------------------
   507 // ---------------------------------------------------------------------------
   508 // IAUpdateUtils::UsifSilentInstallOptionsL
   508 // IAUpdateUtils::UsifSilentInstallOptionsL
   509 // 
   509 // 
   510 // ---------------------------------------------------------------------------
   510 // ---------------------------------------------------------------------------
   511 
   511 
   512 EXPORT_C void  IAUpdateUtils::UsifSilentInstallOptionsL( 
   512 void  IAUpdateUtils::UsifSilentInstallOptionsL( 
   513         Usif::COpaqueNamedParams * aOptions )
   513         Usif::COpaqueNamedParams * aOptions )
   514     {
   514     {
   515 
   515 
   516     aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue );
   516     aOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue );
   517 
   517 
   518     // Upgrades are allowed 
   518     // Upgrades are allowed 
   519     aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, ETrue );
   519     aOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, Usif::EAllowed );
   520     
   520     
   521     // Install all if optional packets exist.
   521     // Install all if optional packets exist.
   522     aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, ETrue );
   522     aOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, Usif::EAllowed );
   523     
   523     
   524     // Prevent online cert revocation check.
   524     // Prevent online cert revocation check.
   525     aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, EFalse );
   525     aOptions->AddIntL( Usif::KSifInParam_PerformOCSP, Usif::ENotAllowed );
   526     
   526     
   527     // See iOCSP setting above
   527     // See iOCSP setting above
   528     aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, ETrue );
   528     aOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, Usif::EAllowed );
   529     
   529     
   530     // Do not allow installation of uncertified packages.
   530     // Do not allow installation of uncertified packages.
   531     aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, EFalse );
   531     aOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, Usif::ENotAllowed );
   532     
   532     
   533     // If filetexts are included in SIS package, show them.
   533     // If filetexts are included in SIS package, show them.
   534     aOptions->AddIntL( Usif::KSifInParam_PackageInfo, ETrue );
   534     aOptions->AddIntL( Usif::KSifInParam_PackageInfo, Usif::EAllowed );
   535     
   535     
   536     // Automatically grant user capabilities.
   536     // Automatically grant user capabilities.
   537     // See also KSifInParam_AllowUntrusted above.
   537     // See also KSifInParam_AllowUntrusted above.
   538     aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, EFalse );
   538     aOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, Usif::EAllowed );
   539     
   539     
   540     // Open application will be closed.
   540     // Open application will be closed.
   541     aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, ETrue );
   541     aOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, Usif::EAllowed );
   542     
   542     
   543     // Files can be overwritten.
   543     // Files can be overwritten.
   544     aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue );
   544     aOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, Usif::EAllowed  );
       
   545     
       
   546     // Incompatible allowed
       
   547     aOptions->AddIntL( Usif::KSifInParam_AllowIncompatible, Usif::EAllowed  );
   545     
   548     
   546     // This only affects Java applications.
   549     // This only affects Java applications.
   547     aOptions->AddIntL( Usif::KSifInParam_AllowDownload, ETrue );
   550     aOptions->AddIntL( Usif::KSifInParam_AllowDownload, Usif::EAllowed  );
   548     
   551     
   549     // Where to save.
   552     // Where to save.
   550     aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC );
   553     //aOptions->AddIntL( Usif::KSifInParam_Drive, EDriveC );
   551     
   554     
   552     // Choose the phone language.
   555     // Choose the phone language.
   553     TLanguage lang = User::Language();
   556     TLanguage lang = User::Language();
   554     // aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() );
   557     //aOptions->AddIntL( Usif::KSifInParam_Languages, lang ); // User::Language() );
   555     
   558     
   556     //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) );
   559     //aOptions->AddIntL( Usif::KSifInParam_Drive, IAUpdateUtils::DriveToInstallL( aUid, aSize ) );
   557     }
   560     }
   558 // ---------------------------------------------------------------------------
       
   559 // IAUpdateUtils::SilentInstallOptionsL
       
   560 // 
       
   561 // ---------------------------------------------------------------------------
       
   562 //
       
   563 SwiUI::TInstallOptions IAUpdateUtils::SilentInstallOptionsL(
       
   564     const CIAUpdateBaseNode& aNode )
       
   565     {
       
   566     IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() begin");
       
   567     SwiUI::TInstallOptions options;
       
   568 
       
   569     // Upgrades are allowed        
       
   570     options.iUpgrade = SwiUI::EPolicyAllowed;
       
   571 
       
   572     // Install all if optional packets exist.
       
   573     options.iOptionalItems = SwiUI::EPolicyAllowed;
       
   574 
       
   575     // Prevent online cert revocation check.
       
   576     options.iOCSP = SwiUI::EPolicyNotAllowed;
       
   577     
       
   578     // See iOCSP setting above
       
   579     options.iIgnoreOCSPWarnings = SwiUI::EPolicyAllowed;
       
   580 
       
   581     // Do not allow installation of uncertified packages.
       
   582     options.iUntrusted = SwiUI::EPolicyNotAllowed;
       
   583 
       
   584     // If filetexts are included in SIS package. Then, show them.
       
   585     options.iPackageInfo = SwiUI::EPolicyUserConfirm;
       
   586     
       
   587     // Automatically grant user capabilities.
       
   588     // See also iUntrusted above.
       
   589     options.iCapabilities = SwiUI::EPolicyAllowed;
       
   590 
       
   591     // Open application will be closed.
       
   592     options.iKillApp = SwiUI::EPolicyAllowed;
       
   593     
       
   594     // Files can be overwritten.
       
   595     options.iOverwrite = SwiUI::EPolicyAllowed;
       
   596     
       
   597     // This only affects Java applications.
       
   598     options.iDownload = SwiUI::EPolicyAllowed;
       
   599     
       
   600     // Where to save.
       
   601     IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() before DriveToInstallL");
       
   602     TDriveUnit driveUnit;
       
   603     if ( aNode.Mime().Compare( IAUpdateProtocolConsts::KMimeWidget ) == 0 )
       
   604         {
       
   605         driveUnit = IAUpdateUtils::DriveToInstallWidgetL( aNode.Identifier() );
       
   606         }
       
   607     else
       
   608         {
       
   609         driveUnit = IAUpdateUtils::DriveToInstallL( aNode.Uid(), aNode.OwnContentSizeL() );
       
   610         }
       
   611      IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() after DriveToInstallL");
       
   612     
       
   613     TDriveName driveName = driveUnit.Name();
       
   614     IAUPDATE_TRACE_1("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() driveName: %S", &driveName );
       
   615     options.iDrive = driveName[0];
       
   616     
       
   617     // Choose the phone language.
       
   618     options.iLang = User::Language();
       
   619     
       
   620     // If language is asked, then use the current phone language.
       
   621     options.iUsePhoneLang = ETrue;
       
   622     
       
   623     // Does not affect SISX. This is for Java.
       
   624     options.iUpgradeData = SwiUI::EPolicyAllowed;
       
   625     IAUPDATE_TRACE("[IAUPDATE] IAUpdateUtils::SilentInstallOptionsL() end");
       
   626     return options;
       
   627     }
       
   628 
       
   629 
       
   630 // -----------------------------------------------------------------------------
   561 // -----------------------------------------------------------------------------
   631 // IAUpdateUtils::InstalledDriveL
   562 // IAUpdateUtils::InstalledDriveL
   632 // 
   563 // 
   633 // -----------------------------------------------------------------------------
   564 // -----------------------------------------------------------------------------
   634 // 
   565 //