settingsengines/sdb/group/sdb.configure.nsh
changeset 1 b538b70cbe51
child 2 87cfa131b535
equal deleted inserted replaced
0:2e8eeb919028 1:b538b70cbe51
       
     1 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 # All rights reserved.
       
     3 # This component and the accompanying materials are made available
       
     4 # under the terms of the License "Symbian Foundation License v1.0"
       
     5 # which accompanies this distribution, and is available
       
     6 # at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 #
       
     8 # Initial Contributors:
       
     9 # Nokia Corporation - initial contribution.
       
    10 #
       
    11 # Contributors:
       
    12 #
       
    13 # Description:
       
    14 #
       
    15 
       
    16 DetailPrint "Configuring SDB..."
       
    17 
       
    18 push $R0
       
    19 push $R1
       
    20 
       
    21 ClearErrors
       
    22 ${REReplace} $R0 "\\" $INSTDIR "\\\\" 1
       
    23 IfErrors REGEXP_ERRS_SDB_INSTDIR REGEXP_NO_ERRS_SDB_INSTDIR
       
    24 
       
    25 REGEXP_NO_ERRS_SDB_INSTDIR:
       
    26 ClearErrors
       
    27 FileOpen $R1 "$INSTDIR\sdb-creator\config\sdb.properties" w
       
    28 IfErrors FILEOPEN_ERRS_SDB_INSTDIR FILEOPEN_NO_ERRS_SDB_INSTDIR
       
    29 
       
    30 
       
    31 FILEOPEN_NO_ERRS_SDB_INSTDIR:
       
    32 FileWrite $R1 "# Log File Settings$\r$\n"
       
    33 FileWrite $R1 "sdb.log.file.enabled = true$\r$\n"
       
    34 FileWrite $R1 "sdb.log.file.format  = %-5p [%-20.20C{1}] %-8r %4L - %m%n$\r$\n"
       
    35 FileWrite $R1 "sdb.log.file.path    = logs\\sdb.log$\r$\n"
       
    36 FileWrite $R1 "sdb.log.file.level   = DEBUG$\r$\n$\r$\n"
       
    37 FileWrite $R1 "# Console Log Settings$\r$\n"
       
    38 FileWrite $R1 "sdb.log.console.format = %m%n$\r$\n"
       
    39 FileWrite $R1 "sdb.log.console.level  = INFO$\r$\n$\r$\n"
       
    40 FileWrite $R1 "#Default Database Settings$\r$\n"
       
    41 FileWrite $R1 "sdb.dbname = sdb.db$\r$\n$\r$\n"
       
    42 FileWrite $R1 "#JDBC dll location$\r$\n"
       
    43 FileWrite $R1 "org.sqlite.lib.path = $R0\\sdb-creator\\lib\\$\r$\n"
       
    44 FileWrite $R1 "com.symbian.dbms.lib.path = $R0\\sdb-creator\\lib\\$\r$\n"
       
    45 FileWrite $R1 "sdb.contacts.configuration = $R0\\sdb-creator\\config\\contacts.xml$\r$\n"
       
    46 FileWrite $R1 "sdb.contacts.configuration.locale = $R0\\sdb-creator\\config\\contacts_locale_en_gb.xml$\r$\n"
       
    47 FileWrite $R1 "sdb.ced.location = $R0\\ced\\win$\r$\n"
       
    48 FileClose $R1
       
    49 DetailPrint "Successfully wrote config file for SDB."
       
    50 GOTO SDB_END
       
    51 
       
    52 
       
    53 FILEOPEN_ERRS_SDB_INSTDIR:
       
    54 DetailPrint "ERROR: Failed to open SDB configuration file for writing."
       
    55 
       
    56 GOTO SDB_END
       
    57 
       
    58 REGEXP_ERRS_SDB_INSTDIR:
       
    59 DetailPrint "ERROR: Failed to write INSTDIR variable with double backslash."
       
    60 
       
    61 SDB_END:
       
    62 
       
    63 pop $R1
       
    64 pop $R0