vpnengine/vpnins/src/vpninsexe.cpp
changeset 0 33413c0669b9
child 23 473321461bba
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2005-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 "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: VPN Installer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <e32base.h>
       
    21 
       
    22     #include <centralrepository.h> // link against centralrepository.lib
       
    23     #include <settingsinternalcrkeys.h>
       
    24 
       
    25     #include <certificateapps.h>
       
    26 
       
    27 
       
    28 _LIT(KVpnManagementUiDllName, "vpnmanagementui.dll");
       
    29 
       
    30 LOCAL_C void setKeysAndOtherSettingsL();
       
    31 
       
    32 // The starting point
       
    33 GLDEF_C TInt E32Main()
       
    34     {
       
    35     __UHEAP_MARK;
       
    36     CTrapCleanup* cleanup = CTrapCleanup::New();
       
    37     TRAPD(error, setKeysAndOtherSettingsL());
       
    38     if (error != KErrNone)
       
    39         {
       
    40         ;
       
    41         }
       
    42     delete cleanup;
       
    43     __UHEAP_MARKEND;
       
    44     return 0;
       
    45     }
       
    46 
       
    47  
       
    48 LOCAL_C void setKeysAndOtherSettingsL()
       
    49     {
       
    50     // Connecting and initialization:
       
    51     CRepository* repository = CRepository::NewL( KCRUidCommunicationSettings );
       
    52     repository->Set( KSettingsVPNSupported, 1 );
       
    53     repository->Set( KSettingsVPNImplementation, KVpnManagementUiDllName );
       
    54     delete repository;
       
    55 
       
    56     CCertificateAppInfoManager* manager = CCertificateAppInfoManager::NewLC();
       
    57     
       
    58     const TUid KUidVpn = {0x101F7993};
       
    59     _LIT(KVpnApplicationName, "VPN");
       
    60     TName vpnApplicationName(KVpnApplicationName);
       
    61     TCertificateAppInfo client(KUidVpn, vpnApplicationName);
       
    62     
       
    63     manager->AddL(client);
       
    64     CleanupStack::PopAndDestroy(); // manager
       
    65     }