-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathextract_deps.bat
More file actions
38 lines (35 loc) · 876 Bytes
/
extract_deps.bat
File metadata and controls
38 lines (35 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@echo off
if [%1] == [] (
set PWD=%CD%
) else (
set PWD=%1
)
REM 设置下载URL和目标文件路径
set "url=http://172.20.180.14/soft/OrcaDepsLib.zip"
set "zipfile=%PWD%\OrcaDepsLib.zip"
set "unzipdir=%PWD%"
if [%2] == [Debug] (
set "url=http://172.20.180.14/soft/OrcaDepsLib_Debug.zip"
set "zipfile=%PWD%\OrcaDepsLib_Debug.zip"
)
REM 1. download zip file
echo downloading... %zipfile%
powershell -Command "(New-Object Net.WebClient).DownloadFile('%url%', '%zipfile%')"
REM 2. check download result
echo %zipfile%
if not exist "%zipfile%" (
echo download failed!
exit /b 1
)
REM 3. mkdir destdir
mkdir "%unzipdir%"
REM 4. unzip
echo unziping...
powershell -Command "Expand-Archive -LiteralPath '%zipfile%' -DestinationPath '%unzipdir%' -Force"
REM 5. check unzip result
if errorlevel 1 (
echo unzip failed!
exit /b 1
)
del "%zipfile%"
echo done.