diff -r 7333d7932ef7 -r 8b7f4e561641 appinstaller/AppinstUi/Daemon/Src/SilentLauncher.cpp --- a/appinstaller/AppinstUi/Daemon/Src/SilentLauncher.cpp Tue Aug 31 15:21:33 2010 +0300 +++ b/appinstaller/AppinstUi/Daemon/Src/SilentLauncher.cpp Wed Sep 01 12:22:02 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -44,51 +44,14 @@ // void CSilentLauncher::ConstructL() { - iConnected = EFalse; - - iSifOptions = Usif::COpaqueNamedParams::NewL(); - iSifResults = Usif::COpaqueNamedParams::NewL(); - - // Set needed parameters for silent install. - FLOG( _L("Daemon: CSilentLauncher::ConstructL: InstallSilently") ); - iSifOptions->AddIntL( Usif::KSifInParam_InstallSilently, ETrue ); - - iSifOptions->AddIntL( Usif::KSifInParam_PerformOCSP, EFalse ); - // Note if upgrade is allowed, see NeedsInstallingL function. - iSifOptions->AddIntL( Usif::KSifInParam_AllowUpgrade, EFalse ); - iSifOptions->AddIntL( Usif::KSifInParam_AllowUntrusted, EFalse ); - iSifOptions->AddIntL( Usif::KSifInParam_GrantCapabilities, EFalse ); - // Defined for the install. - iSifOptions->AddIntL( Usif::KSifInParam_InstallOptionalItems, ETrue ); - iSifOptions->AddIntL( Usif::KSifInParam_IgnoreOCSPWarnings, ETrue ); - iSifOptions->AddIntL( Usif::KSifInParam_AllowAppShutdown, ETrue ); - iSifOptions->AddIntL( Usif::KSifInParam_AllowDownload, ETrue ); - iSifOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue ); - iSifOptions->AddIntL( Usif::KSifInParam_AllowOverwrite, ETrue ); - -// TODO: is this defined in USIF? - //iSifOptions->AddIntL( Usif::KSifInParam_Languages, NULL ); -// TODO: Not supported anymore after wk18, do we have some other param for this. - //iSifOptions->AddIntL( Usif::KSifInParam_DisplayPackageInfo, ETrue ); - -// TODO: remove old params. - /* - // Old swinstdefs.inl defines for install. - iUpgrade( EPolicyAllowed ), - iOptionalItems( EPolicyAllowed ), - iOCSP( EPolicyAllowed ), - iIgnoreOCSPWarnings( EPolicyAllowed ), - iUntrusted( EPolicyNotAllowed ), - iPackageInfo( EPolicyAllowed ), - iCapabilities( EPolicyAllowed ), - iKillApp( EPolicyAllowed ), - iDownload( EPolicyAllowed ), - iOverwrite( EPolicyAllowed ), - iDrive( 'C' ), - iLang( ELangNone ), - iUsePhoneLang( ETrue ), - iUpgradeData( EPolicyAllowed ) - */ + iOptions.iUpgrade = SwiUI::EPolicyNotAllowed; + iOptions.iOCSP = SwiUI::EPolicyNotAllowed; +#ifndef RD_MULTIPLE_DRIVE + iOptions.iDrive = 'E'; +#endif + iOptions.iUntrusted = SwiUI::EPolicyNotAllowed; + iOptions.iCapabilities = SwiUI::EPolicyNotAllowed; + iOptionsPckg = iOptions; } // ----------------------------------------------------------------------------- @@ -104,64 +67,38 @@ CleanupStack::Pop( self ); return self; } - -// ----------------------------------------------------------------------------- -// CSilentLauncher::~CSilentLauncher() -// Destructor. -// ----------------------------------------------------------------------------- -// + +// Destructor CSilentLauncher::~CSilentLauncher() - { - delete iSifOptions; - delete iSifResults; - - if ( iConnected ) - { - iSWInstallerFW.Close(); - } - - delete iDrive; + { + iLauncher.Close(); } - // ----------------------------------------------------------------------------- // CSilentLauncher::InstallL -// Perform installation with file handle. +// Perform installation. +// (other items were commented in a header). // ----------------------------------------------------------------------------- // -void CSilentLauncher::InstallL( RFile& aFileHandle, - const TDesC& aFile, - TRequestStatus& aStatus ) +void CSilentLauncher::InstallL( const TDesC& aFile, TRequestStatus& aStatus ) { - FLOG( _L("Daemon: CSilentLauncher::InstallL (aFileHandle) START") ); - if ( !iConnected ) - { - FLOG( _L("Daemon: Connect to sif installer server") ); - User::LeaveIfError( iSWInstallerFW.Connect() ); - iConnected = ETrue; - } + { + FLOG( _L("Daemon: Connect to installer server") ); + User::LeaveIfError( iLauncher.Connect() ); + FLOG( _L("Daemon: Connected to installer server") ); + iConnected = ETrue; + } - // Set drive for installer. -// delete iDrive -// iDrive = NULL; -// iDrive = HBufC::NewLC( 8 ); -// TPtr drivePtr = iDrive->Des(); -// -// TInt driveNumber = 0; -// TDriveInfo driveInfo; -// aFileHandle.Drive( driveNumber, driveInfo ); -// TODO: how is this used? Is this drive letter? -// iSifOptions->AddStringL( Usif::KSifInParam_Drive , *drive ); - +#ifdef RD_MULTIPLE_DRIVE + FLOG( _L("Daemon: InstallL: Set drive for install") ); + // Set drive for installer. + iOptions.iDrive = aFile[0]; +#endif + + // Launch the installation FLOG( _L("Daemon: Launch install") ); - iSWInstallerFW.Install( aFileHandle, - *iSifOptions, - *iSifResults, - aStatus, - ETrue ); - - FLOG( _L("Daemon: CSilentLauncher::InstallL (aFileHandle) END") ); + iLauncher.SilentInstall( aStatus, aFile, iOptionsPckg ); } // ----------------------------------------------------------------------------- @@ -172,8 +109,8 @@ // void CSilentLauncher::Cancel() { - FLOG( _L("Daemon: Cancel Install operation") ); - iSWInstallerFW.CancelOperation(); + FLOG( _L("Daemon: Install cancel requested") ); + iLauncher.CancelAsyncRequest( SwiUI::ERequestSilentInstall ); } // End of File