xref: /aoo41x/main/odk/setsdkenv_windows.bat (revision 5b501c92)
1rem *************************************************************
2rem
3rem  Licensed to the Apache Software Foundation (ASF) under one
4rem  or more contributor license agreements.  See the NOTICE file
5rem  distributed with this work for additional information
6rem  regarding copyright ownership.  The ASF licenses this file
7rem  to you under the Apache License, Version 2.0 (the
8rem  "License"); you may not use this file except in compliance
9rem  with the License.  You may obtain a copy of the License at
10rem
11rem    http://www.apache.org/licenses/LICENSE-2.0
12rem
13rem  Unless required by applicable law or agreed to in writing,
14rem  software distributed under the License is distributed on an
15rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16rem  KIND, either express or implied.  See the License for the
17rem  specific language governing permissions and limitations
18rem  under the License.
19rem
20rem *************************************************************
21@echo off
22
23set SDK_DIR_TMP=%~dp0
24set SDK_DIR=%SDK_DIR_TMP:~0,-1%
25
26if "%@RIGHT[5,%SDK_DIR%]" EQU "~0,-1" (
27   set SDK_DIR=%@FULL[%0]
28   set /A LENGTH=%@LEN[%SDK_DIR%] - 22
29   set SDK_DIR=%@LEFT[%LENGTH%,%SDK_DIR%]
30   unset LENGTH
31)
32
33set OO_SDK_NAME=__SDKNAME__
34
35set OO_USER_SDK_DIR=%APPDATA%\%OO_SDK_NAME%
36set OO_USER_SDKENV_SCRIPT=%OO_USER_SDK_DIR%\setsdkenv_windows.bat
37
38if "%1" EQU "--force-configure" (
39   if exist "%OO_USER_ENV_SCRIPT%". (
40      del "%OO_USER_SDKENV_SCRIPT%"
41   )
42   goto start
43)
44
45if "%1" EQU "-h" goto printhelp
46if "%1" EQU "--help" goto printhelp
47if "%1" NEQ "" goto printhelp
48
49:start
50cls
51
52if not exist "%OO_USER_SDKENV_SCRIPT%". (
53   echo.
54   echo  ******************************************************************
55   echo  *
56   echo  *  You have to configure your SDK environment first before you can
57   echo  *  can use it! The configuration has to be done only once.
58   echo  *
59   echo  ******************************************************************
60   echo.
61
62   cscript //I //Nologo "%SDK_DIR%\cfgWin.js"
63   goto setenv
64)
65
66goto setenv
67
68:printhelp
69echo.
70echo  using: setsdkenv_windows.bat [options]
71echo.
72echo  options:
73echo     --force-configure : force a new configuration of your SDK environment.
74echo                         Alternatively can you edit your SDK environment script directly:
75echo                           "%OO_USER_SDKENV_SCRIPT%"
76echo     -h, --help        : print this help and exit
77echo.
78goto end
79
80
81:setenv
82call "%OO_USER_SDKENV_SCRIPT%"
83
84:end
85