|
1 /* |
|
2 * Copyright (c) 2002-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 "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: This file contains the implementation of CSilentLauncher |
|
15 * class member functions. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "SilentLauncher.h" |
|
22 #include "SWInstDebug.h" |
|
23 #include "SWInstDefs.h" |
|
24 |
|
25 using namespace Swi; |
|
26 |
|
27 // ============================ MEMBER FUNCTIONS =============================== |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CSilentLauncher::CSilentLauncher |
|
31 // C++ default constructor can NOT contain any code, that |
|
32 // might leave. |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CSilentLauncher::CSilentLauncher( RFs& aFs ) |
|
36 : iFs( aFs ) |
|
37 { |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CSilentLauncher::ConstructL |
|
42 // Symbian 2nd phase constructor can leave. |
|
43 // ----------------------------------------------------------------------------- |
|
44 // |
|
45 void CSilentLauncher::ConstructL() |
|
46 { |
|
47 iOptions.iUpgrade = SwiUI::EPolicyNotAllowed; |
|
48 iOptions.iOCSP = SwiUI::EPolicyNotAllowed; |
|
49 #ifndef RD_MULTIPLE_DRIVE |
|
50 iOptions.iDrive = 'E'; |
|
51 #endif |
|
52 iOptions.iUntrusted = SwiUI::EPolicyNotAllowed; |
|
53 iOptions.iCapabilities = SwiUI::EPolicyNotAllowed; |
|
54 iOptionsPckg = iOptions; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CSilentLauncher::NewL |
|
59 // Two-phased constructor. |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 CSilentLauncher* CSilentLauncher::NewL( RFs& aFs ) |
|
63 { |
|
64 CSilentLauncher* self = new( ELeave ) CSilentLauncher( aFs ); |
|
65 CleanupStack::PushL( self ); |
|
66 self->ConstructL(); |
|
67 CleanupStack::Pop( self ); |
|
68 return self; |
|
69 } |
|
70 |
|
71 // Destructor |
|
72 CSilentLauncher::~CSilentLauncher() |
|
73 { |
|
74 iLauncher.Close(); |
|
75 } |
|
76 |
|
77 // ----------------------------------------------------------------------------- |
|
78 // CSilentLauncher::InstallL |
|
79 // Perform installation. |
|
80 // (other items were commented in a header). |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 void CSilentLauncher::InstallL( const TDesC& aFile, TRequestStatus& aStatus ) |
|
84 { |
|
85 if ( !iConnected ) |
|
86 { |
|
87 FLOG( _L("Daemon: Connect to installer server") ); |
|
88 User::LeaveIfError( iLauncher.Connect() ); |
|
89 FLOG( _L("Daemon: Connected to installer server") ); |
|
90 iConnected = ETrue; |
|
91 } |
|
92 |
|
93 #ifdef RD_MULTIPLE_DRIVE |
|
94 FLOG( _L("Daemon: InstallL: Set drive for install") ); |
|
95 // Set drive for installer. |
|
96 iOptions.iDrive = aFile[0]; |
|
97 #endif |
|
98 |
|
99 // Launch the installation |
|
100 FLOG( _L("Daemon: Launch install") ); |
|
101 iLauncher.SilentInstall( aStatus, aFile, iOptionsPckg ); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CSilentLauncher::Cancel |
|
106 // Cancel the current installation. |
|
107 // (other items were commented in a header). |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 void CSilentLauncher::Cancel() |
|
111 { |
|
112 FLOG( _L("Daemon: Install cancel requested") ); |
|
113 iLauncher.CancelAsyncRequest( SwiUI::ERequestSilentInstall ); |
|
114 } |
|
115 |
|
116 // End of File |