Skip to content

Commit

Permalink
Added .bat helper scripts to download PopcornFX Runtime SDK for Deskt…
Browse files Browse the repository at this point in the history
…op, Mobile or all platforms. Updated README to state the dependency with 7-zip
  • Loading branch information
HugoPKFX committed Feb 25, 2022
1 parent 540fa57 commit 621096d
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.swp
Binaries/
Intermediate/
PopcornFX_Runtime_SDK/
4 changes: 4 additions & 0 deletions Download_SDK_All.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@echo off

call "Download_SDK_Desktop.bat"
call "Download_SDK_Mobile.bat"
45 changes: 45 additions & 0 deletions Download_SDK_Desktop.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@echo off

echo "---------- Downloading PopcornFX Runtime SDK for Unreal Engine (Desktop platforms) ----------"

setlocal

bitsadmin /reset
bitsadmin /create third_party_download_desktop
bitsadmin /addfile third_party_download_desktop https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.11.2_Win64_Linux64_Mac64.7z "%~dp0\_PopcornFX_Runtime_SDK_Desktop.7z"
bitsadmin /setpriority third_party_download_desktop "FOREGROUND"
bitsadmin /resume third_party_download_desktop

:WAIT_FOR_DOWNLOAD_LOOP_START
call bitsadmin /info third_party_download_desktop /verbose | find "STATE: TRANSFERRED"
if %ERRORLEVEL% equ 0 goto WAIT_FOR_DOWNLOAD_LOOP_END
call bitsadmin /RawReturn /GetBytesTransferred third_party_download_desktop
echo Bytes transferred
timeout 2 > nul
goto WAIT_FOR_DOWNLOAD_LOOP_START
:WAIT_FOR_DOWNLOAD_LOOP_END

bitsadmin /complete third_party_download_desktop

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.7z ----------"

7z x _PopcornFX_Runtime_SDK_Desktop.7z -o_PopcornFX_Runtime_SDK_Desktop

echo "---------- Copying PopcornFX Runtime SDK ----------"

xcopy _PopcornFX_Runtime_SDK_Desktop\PopcornFX\PopcornFX_Runtime_SDK %~dp0\PopcornFX_Runtime_SDK /S /F /Y

echo "---------- Removing temp files ----------"

rmdir /s /q %~dp0\_PopcornFX_Runtime_SDK_Desktop
del /f _PopcornFX_Runtime_SDK_Desktop.7z

echo "---------- Finished ----------"

endlocal
45 changes: 45 additions & 0 deletions Download_SDK_Mobile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@echo off

echo "---------- Downloading PopcornFX Runtime SDK for Unreal Engine (Mobile platforms) ----------"

setlocal

bitsadmin /reset
bitsadmin /create third_party_download_mobile
bitsadmin /addfile third_party_download_mobile https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.11.2_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 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 ----------"

7z x _PopcornFX_Runtime_SDK_Mobile.7z -o_PopcornFX_Runtime_SDK_Mobile

echo "---------- Copying PopcornFX Runtime SDK ----------"

xcopy _PopcornFX_Runtime_SDK_Mobile\PopcornFX\PopcornFX_Runtime_SDK %~dp0\PopcornFX_Runtime_SDK /S /F /Y

echo "---------- Removing temp files ----------"

rmdir /s /q %~dp0\_PopcornFX_Runtime_SDK_Mobile
del /f _PopcornFX_Runtime_SDK_Mobile.7z

echo "---------- Finished ----------"

endlocal
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ The plugin can only be installed in Code projects (Blueprint-only projects are n

On windows, it is required to install **[Visual studio](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/DevelopmentSetup/VisualStudioSetup/)** to compile the plugin as we do not provide compiled PopcornFX plugin binaries yet.

Check out the **[Installation steps](https://www.popcornfx.com/docs/popcornfx-v2/plugins/ue4-plugin/installation-and-setup/)** to install the plugin and start using PopcornFX!
Currently, you will need to download & install **[7-zip](https://www.7-zip.org/download.html)** and add it to your PATH environment variable (this is a requirement we want to remove in future updates): we currently use 7zip as it produces smaller archives of the PopcornFX Runtime SDK.

Once Visual studio and 7-zip are installed, you can launch `Download_SDK_All.bat` to download PopcornFX Runtime SDK. `Download_SDK_Desktop.bat` and `Download_SDK_Mobile.bat` can be used separately if you only need Desktop or Mobile platforms.

Once PopcornFX Runtime SDK is downloaded and placed in `PopcornFX_Runtime_SDK/` folder, the plugin is ready to be compiled.

Check out the **[General installation steps](https://www.popcornfx.com/docs/popcornfx-v2/plugins/ue4-plugin/installation-and-setup/)** to see how to compile the plugin!

## Quick Links: Documentation and Support

Expand Down

0 comments on commit 621096d

Please sign in to comment.