1@rem Copyright (c) 2020-2021 Huawei Device Co., Ltd. 2@rem Licensed under the Apache License, Version 2.0 (the "License"); 3@rem you may not use this file except in compliance with the License. 4@rem You may obtain a copy of the License at 5@rem 6@rem http://www.apache.org/licenses/LICENSE-2.0 7@rem 8@rem Unless required by applicable law or agreed to in writing, software 9@rem distributed under the License is distributed on an "AS IS" BASIS, 10@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11@rem See the License for the specific language governing permissions and 12@rem limitations under the License. 13 14@echo off 15set BASE_DIR=%~dp0 16set PYTHON=python 17set TOOLS=tools 18cd /d %BASE_DIR% 19 20(where %PYTHON% | findstr %PYTHON%) >nul 2>&1 || ( 21 @echo "Python3.7 or higher version required!" 22 pause 23 goto:eof 24) 25 26python -c "import sys; exit(1) if sys.version_info.major < 3 or sys.version_info.minor < 7 else exit(0)" 27@if errorlevel 1 ( 28 @echo "Python3.7 or higher version required!" 29 pause 30 goto:eof 31) 32 33python -c "import easy_install" 34@if errorlevel 1 ( 35 @echo "Please install setuptools first!" 36 goto:eof 37) 38 39if not exist %TOOLS% ( 40 @echo "no %TOOLS% directory exist" 41 goto:eof 42) 43 44for %%a in (%TOOLS%/*.egg) do ( 45 python -m easy_install --user %TOOLS%/%%a 46 @if errorlevel 1 ( 47 @echo "Error occurs to install %%a!" 48 ) 49) 50for %%a in (%TOOLS%/*.tar.gz) do ( 51 python -m easy_install --user %TOOLS%/%%a 52 @if errorlevel 1 ( 53 @echo "Error occurs to install %%a!" 54 ) 55) 56python -m xdevice %* 57