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 pip" 34@if errorlevel 1 ( 35 @echo "Please install pip first!" 36 pause 37 goto:eof 38) 39 40python -c "import easy_install" 41@if errorlevel 1 ( 42 @echo "Please install setuptools first!" 43 goto:eof 44) 45 46if not exist %TOOLS% ( 47 @echo "no %TOOLS% directory exist" 48 goto:eof 49) 50 51python -m pip uninstall -y xdevice 52python -m pip uninstall -y xdevice-extension 53python -m pip uninstall -y xdevice-ohos 54 55for %%a in (%TOOLS%/*.egg) do ( 56 python -m easy_install --user %TOOLS%/%%a 57 @if errorlevel 1 ( 58 @echo "Error occurs to install %%a!" 59 ) 60) 61for %%a in (%TOOLS%/*.tar.gz) do ( 62 python -m pip install --user %TOOLS%/%%a 63 @if errorlevel 1 ( 64 @echo "Error occurs to install %%a!" 65 ) 66) 67python -m xdevice %* 68