widgets/widgetstartup/src/WidgetStartup.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Launches startup widget applications
       
    15 *
       
    16 */
       
    17 
       
    18 #include <apacmdln.h>           // For CApaCommandLine
       
    19 #include <apgcli.h>             // For RApaLsSession
       
    20 #include "WidgetStartup.h"
       
    21 
       
    22 //  CONSTANTS
       
    23 _LIT(KPreInstallerExe,"WidgetPreInstaller.exe");
       
    24 
       
    25 // ============================================================================
       
    26 // CWidgetStartup::ConstructL()
       
    27 // Constructs and start installs
       
    28 //
       
    29 // @since 3.1
       
    30 // ============================================================================
       
    31 //
       
    32 void CWidgetStartup::ConstructL()
       
    33     {    
       
    34     BaseConstructL( ENonStandardResourceFile | ENoScreenFurniture  );
       
    35     
       
    36     DoPreInstallL();
       
    37     
       
    38     Exit();
       
    39     }
       
    40 
       
    41 // ============================================================================
       
    42 // CWidgetStartup::CWidgetStartup()
       
    43 // C++ constructor
       
    44 //
       
    45 // @since 3.1
       
    46 // ============================================================================
       
    47 //
       
    48 CWidgetStartup::CWidgetStartup()
       
    49     {
       
    50     }
       
    51   
       
    52     
       
    53 // -----------------------------------------------------------------------------
       
    54 // CWidgetStartup::~CWidgetStartup
       
    55 // C++ destructor
       
    56 // 
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CWidgetStartup::~CWidgetStartup()
       
    60     {
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // Execute startup functionality.
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CWidgetStartup::DoPreInstallL()
       
    68     {
       
    69     RApaLsSession appArcSession;
       
    70     CleanupClosePushL(appArcSession);
       
    71     CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
       
    72     cmdLine->SetCommandL(EApaCommandBackground); 
       
    73     cmdLine->SetExecutableNameL( KPreInstallerExe );
       
    74     
       
    75     appArcSession.StartApp( *cmdLine ); 
       
    76     CleanupStack::PopAndDestroy(2); // cmdLine, appArcSession
       
    77     }
       
    78 // End of File