xref: /aoo41x/main/odk/setsdkenv_windows.bat (revision cdf0e10c)
1@echo off
2
3set SDK_DIR_TMP=%~dp0
4set SDK_DIR=%SDK_DIR_TMP:~0,-1%
5
6if "%@RIGHT[5,%SDK_DIR%]" EQU "~0,-1" (
7   set SDK_DIR=%@FULL[%0]
8   set /A LENGTH=%@LEN[%SDK_DIR%] - 22
9   set SDK_DIR=%@LEFT[%LENGTH%,%SDK_DIR%]
10   unset LENGTH
11)
12
13set OO_SDK_NAME=__SDKNAME__
14
15set OO_USER_SDK_DIR=%APPDATA%\%OO_SDK_NAME%
16set OO_USER_SDKENV_SCRIPT=%OO_USER_SDK_DIR%\setsdkenv_windows.bat
17
18if "%1" EQU "--force-configure" (
19   if exist "%OO_USER_ENV_SCRIPT%". (
20      del "%OO_USER_SDKENV_SCRIPT%"
21   )
22   goto start
23)
24
25if "%1" EQU "-h" goto printhelp
26if "%1" EQU "--help" goto printhelp
27if "%1" NEQ "" goto printhelp
28
29:start
30cls
31
32if not exist "%OO_USER_SDKENV_SCRIPT%". (
33   echo.
34   echo  ******************************************************************
35   echo  *
36   echo  *  You have to configure your SDK environment first before you can
37   echo  *  can use it! The configuration has to be done only once.
38   echo  *
39   echo  ******************************************************************
40   echo.
41
42   cscript //I //Nologo "%SDK_DIR%\cfgWin.js"
43   goto setenv
44)
45
46goto setenv
47
48:printhelp
49echo.
50echo  using: setsdkenv_windows.bat [options]
51echo.
52echo  options:
53echo     --force-configure : force a new configuration of your SDK environment.
54echo                         Alternatively can you edit your SDK environment script directly:
55echo                           "%OO_USER_SDKENV_SCRIPT%"
56echo     -h, --help        : print this help and exit
57echo.
58goto end
59
60
61:setenv
62call "%OO_USER_SDKENV_SCRIPT%"
63
64:end