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