-
Notifications
You must be signed in to change notification settings - Fork 2
/
Download_SDK_Mobile.bat
59 lines (44 loc) · 2.04 KB
/
Download_SDK_Mobile.bat
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
echo "---------- Downloading PopcornFX Runtime SDK for Unreal Engine (Mobile platforms) ----------"
setlocal
@rem Find 7zip
set passed=0
FOR /F "tokens=*" %%g IN ('where 7z') do (set passed=1 && set zip=%%g)
if %passed% == 0 (
if exist "C:\Program Files\7-Zip\7z.exe" (
set zip="C:\Program Files\7-Zip\7z.exe"
) else (
echo Could not find 7-Zip. If you have changed its install directory, please add it to the PATH environment variable. Aborting.
pause
exit 1
)
)
bitsadmin /reset
bitsadmin /create third_party_download_mobile
bitsadmin /addfile third_party_download_mobile https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.20.5_iOS_Android.7z "%~dp0\_PopcornFX_Runtime_SDK_Mobile.7z"
bitsadmin /setpriority third_party_download_mobile "FOREGROUND"
bitsadmin /resume third_party_download_mobile
:WAIT_FOR_DOWNLOAD_LOOP_START
call bitsadmin /info third_party_download_mobile /verbose | find "STATE: TRANSFERRED"
if %ERRORLEVEL% equ 0 goto WAIT_FOR_DOWNLOAD_LOOP_END
call bitsadmin /RawReturn /GetBytesTransferred third_party_download_mobile
echo|set /p=" / "
call bitsadmin /RawReturn /GetBytesTotal third_party_download_mobile
echo Bytes transferred
timeout 2 > nul
goto WAIT_FOR_DOWNLOAD_LOOP_START
:WAIT_FOR_DOWNLOAD_LOOP_END
bitsadmin /complete third_party_download_mobile
echo "---------- Download complete ----------"
echo "---------- Preparing PopcornFX_Runtime_SDK/ ----------"
rem rmdir /s /q "%~dp0\PopcornFX_Runtime_SDK"
mkdir "%~dp0\PopcornFX_Runtime_SDK"
echo "---------- Unzipping _PopcornFX_Runtime_SDK_Mobile.7z ----------"
"%zip%" x _PopcornFX_Runtime_SDK_Mobile.7z -o_PopcornFX_Runtime_SDK_Mobile
echo "---------- Copying PopcornFX Runtime SDK ----------"
robocopy _PopcornFX_Runtime_SDK_Mobile\PopcornFX\PopcornFX_Runtime_SDK "%~dp0\PopcornFX_Runtime_SDK" /s
echo "---------- Removing temp files ----------"
rmdir /s /q "%~dp0\_PopcornFX_Runtime_SDK_Mobile"
del /f _PopcornFX_Runtime_SDK_Mobile.7z
echo "---------- Finished ----------"
endlocal