|
1 /* |
|
2 * Copyright (c) 2008-2009 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: |
|
15 * This file implements the client side of the Reference Installer. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #include <f32file.h> |
|
21 #include <scs/scscommon.h> |
|
22 #include <scs/scsclient.h> |
|
23 #include "sifrefinstallerclientserver.h" |
|
24 #include "sifrefinstallerclient.h" |
|
25 |
|
26 using namespace Usif; |
|
27 |
|
28 namespace |
|
29 { |
|
30 /** SIF server SID. */ |
|
31 const TUid KSifRefInstallerServerUid = {0x1028634E}; |
|
32 |
|
33 /** Executable image which runs the server process. */ |
|
34 _LIT(KRefInstallerServerImageName, "sifrefinstallerserver.exe"); |
|
35 } |
|
36 |
|
37 RSifRefInstallerClient::RSifRefInstallerClient() |
|
38 { |
|
39 } |
|
40 |
|
41 TInt RSifRefInstallerClient::Connect() |
|
42 { |
|
43 return iTransporter.Connect(KSifRefInstallerServerName, Version(), KRefInstallerServerImageName, KSifRefInstallerServerUid); |
|
44 } |
|
45 |
|
46 void RSifRefInstallerClient::Close() |
|
47 { |
|
48 iTransporter.Close(); |
|
49 } |
|
50 |
|
51 void RSifRefInstallerClient::GetComponentInfo(const TDesC& aFileName, CComponentInfo& aComponentInfo, TRequestStatus& aStatus) |
|
52 { |
|
53 iTransporter.GetComponentInfo(aFileName, aComponentInfo, aStatus); |
|
54 } |
|
55 |
|
56 void RSifRefInstallerClient::GetComponentInfo(RFile& aFileHandle, CComponentInfo& aComponentInfo, TRequestStatus& aStatus) |
|
57 { |
|
58 iTransporter.GetComponentInfo(aFileHandle, aComponentInfo, aStatus); |
|
59 } |
|
60 |
|
61 void RSifRefInstallerClient::Install(const TDesC& aFileName, const COpaqueNamedParams& aArguments, |
|
62 COpaqueNamedParams& aResults, TRequestStatus& aStatus) |
|
63 { |
|
64 // Fifth argument of the SifTransportClient::Install() and SifTransportClient::Uninstall() methods, |
|
65 // if set to ETrue, instructs an instance of CSifTransportServer to work in the ExclusiveOperation |
|
66 // mode. In this mode only one request may be processed at a time. In our case an instance of |
|
67 // CSifTransportServer means the Refrence Installer Server. Hence, we have to set this param to |
|
68 // ETrue because the Reference Installer doesn't support concurrent operations. |
|
69 iTransporter.Install(aFileName, aArguments, aResults, aStatus, ETrue); |
|
70 } |
|
71 |
|
72 void RSifRefInstallerClient::Install(RFile& aFileHandle, const COpaqueNamedParams& aArguments, |
|
73 COpaqueNamedParams& aResults, TRequestStatus& aStatus) |
|
74 { |
|
75 // Please see above for a comment about ETrue passed as a fifth param. |
|
76 iTransporter.Install(aFileHandle, aArguments, aResults, aStatus, ETrue); |
|
77 } |
|
78 |
|
79 void RSifRefInstallerClient::Uninstall(TComponentId aComponentId, const COpaqueNamedParams& aArguments, |
|
80 COpaqueNamedParams& aResults, TRequestStatus& aStatus) |
|
81 { |
|
82 // Please see above for a comment about ETrue passed as a fifth param. |
|
83 iTransporter.Uninstall(aComponentId, aArguments, aResults, aStatus, ETrue); |
|
84 } |
|
85 |
|
86 void RSifRefInstallerClient::Activate(TComponentId aComponentId, TRequestStatus& aStatus) |
|
87 { |
|
88 iTransporter.Activate(aComponentId, aStatus); |
|
89 } |
|
90 |
|
91 void RSifRefInstallerClient::Deactivate(TComponentId aComponentId, TRequestStatus& aStatus) |
|
92 { |
|
93 iTransporter.Deactivate(aComponentId, aStatus); |
|
94 } |
|
95 |
|
96 void RSifRefInstallerClient::CancelOperation() |
|
97 { |
|
98 iTransporter.CancelOperation(); |
|
99 } |