configurationengine/source/cone.cmd
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     1 @rem
       
     2 @rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 @rem All rights reserved.
       
     4 @rem This component and the accompanying materials are made available
       
     5 @rem under the terms of "Eclipse Public License v1.0"
       
     6 @rem which accompanies this distribution, and is available
       
     7 @rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 @rem
       
     9 @rem Initial Contributors:
       
    10 @rem Nokia Corporation - initial contribution.
       
    11 @rem
       
    12 @rem Contributors:
       
    13 @rem
       
    14 @rem Description:
       
    15 @rem
       
    16 
       
    17 :: ============================================================================
       
    18 ::  Name        : cone.cmd
       
    19 ::  Part of     : ConE
       
    20 ::  Description : ConE tool wrapper for Windows
       
    21 ::  Version     : %version: 1 %
       
    22 ::
       
    23 :: ============================================================================
       
    24 
       
    25 
       
    26 
       
    27 @echo off
       
    28 setlocal
       
    29 
       
    30 set CONE_CMDARG=%*
       
    31 set CONE_BASEDIR=%~dp0
       
    32 set PYTHONCASEOK=1
       
    33 
       
    34 @rem Check that Python is available
       
    35 call python -h >nul 2>&1
       
    36 if %errorlevel% neq 0 (
       
    37 echo Python is required to run ConE!
       
    38 exit /b 1
       
    39 )
       
    40 
       
    41 @REM Find out Python version
       
    42 set VERFILE=%TEMP%\cone_version_check.tmp
       
    43 python -c "import sys; print sys.version[:3]" > %VERFILE%
       
    44 set varNUM=0
       
    45 for /f "tokens=*" %%T in (%VERFILE%) do call :varSET %%T
       
    46 if exist %VERFILE% del %VERFILE% 
       
    47 
       
    48 
       
    49 @REM Set the used base directory based on the version
       
    50 if %VER1%==2.5 (
       
    51 set CONE_BASEDIR=%CONE_BASEDIR%cone\2.5\
       
    52 goto EndVersionCheck
       
    53 )
       
    54 if %VER1%==2.6 (
       
    55 set CONE_BASEDIR=%CONE_BASEDIR%cone\2.6\
       
    56 goto EndVersionCheck
       
    57 )
       
    58 echo You are using an unsupported Python version (%VER1%)
       
    59 echo ConE requires Python 2.5 or 2.6
       
    60 exit /b 1
       
    61 )
       
    62 :EndVersionCheck
       
    63 
       
    64 @rem Check that this ConE installation supports the Python version
       
    65 if not exist "%CONE_BASEDIR%" (
       
    66 echo Python version %VER1% is not supported by this ConE installation
       
    67 exit /b 1
       
    68 )
       
    69 
       
    70 
       
    71 @rem Set environment variables and run cone_tool.py
       
    72 set CONE_LIBDIR=%CONE_BASEDIR%\lib
       
    73 set CONE_SCRIPTDIR=%CONE_BASEDIR%\scripts
       
    74 set PATH=%CONE_SCRIPTDIR%;%PATH%
       
    75 set PYTHONPATH=%CONE_LIBDIR%;%PYTHONPATH%
       
    76 call python "%CONE_SCRIPTDIR%\cone_tool.py" %CONE_CMDARG%
       
    77 exit /b %ERRORLEVEL%
       
    78 
       
    79 endlocal
       
    80 
       
    81 :VarSET
       
    82 set /a varNUM=%varNUM%+1
       
    83 set VER%varNUM%=%1
       
    84 
       
    85 :: END OF cone.cmd