diff --git a/.gitignore b/.gitignore index 0a6c9cd..9a61f43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /target -/bin -/stremio*.exe \ No newline at end of file +stremio*.exe \ No newline at end of file diff --git a/bin/ffmpeg.exe b/bin/ffmpeg.exe new file mode 100644 index 0000000..e5f9a3b Binary files /dev/null and b/bin/ffmpeg.exe differ diff --git a/bin/ffprobe.exe b/bin/ffprobe.exe new file mode 100644 index 0000000..3db452f Binary files /dev/null and b/bin/ffprobe.exe differ diff --git a/setup/create_setup.bat b/setup/create_setup.bat index 9c9e20e..8996fc8 100644 --- a/setup/create_setup.bat +++ b/setup/create_setup.bat @@ -1,26 +1,6 @@ @echo off set mypath=%~dp0 -:: Download ffmpeg and node -set missing= -if not exist "%mypath%..\bin" set missing=1 -if not exist "%mypath%..\bin\node.exe" set missing=1 -if not exist "%mypath%..\bin\ResourceHacker.exe" set missing=1 -if not exist "%mypath%..\bin\ffmpeg.exe" set missing=1 -if not exist "%mypath%..\bin\ffprobe.exe" set missing=1 -if defined missing ( - powershell -nologo -executionpolicy bypass -File "%mypath%get_exe_from_zip.ps1" -) else ( - echo Binaries for ffmpeg, ffprobe, node and ResHack are already present -) - -:: Convert node to stremio-runtime -if not exist "%mypath%..\bin\stremio-runtime.exe" ( - call "%mypath%generate_stremio-runtime.bat" %mypath%..\bin -) else ( - echo The executable stremio-runtime.exe is already generated -) - :: Compile the main executable if not exist "%mypath%..\target\release\stremio-shell-ng.exe" ( cargo build --release diff --git a/setup/generate_stremio-runtime.bat b/setup/generate_stremio-runtime.bat deleted file mode 100644 index 4895f52..0000000 --- a/setup/generate_stremio-runtime.bat +++ /dev/null @@ -1,78 +0,0 @@ -@echo off - -:: Prepare paths and environment -set "rt_path=%~dpf1" -set rt_exe="%rt_path%\stremio-runtime.exe" - -::set rh="C:\RH\ResourceHacker.exe" - -pushd %~dp0 -pushd ..\bin -set node="%cd%\node.exe" -set rh="%cd%\ResourceHacker.exe" - -popd -pushd ..\images -set rt_icon="%cd%\stremio_gray.ico" -popd -popd - -:: Check if all paths are correct -if not exist %rh% goto :norh -if not exist %node% goto :nonode -if not exist %rt_icon% goto :noico -if not exist "%rt_path%\" goto :nodir - -:: Create temp dir -set "res_dir=%TEMP%\srres" -md "%res_dir%" - -:: Copy node.exe to the temp dir and remove signature -copy %node% "%res_dir%\node.exe" -set node="%res_dir%\node.exe" -signtool remove /s %node% - -:: Extract Node.js resources -%rh% -open %node% -save "%res_dir%\resources.rc" -action extract -mask ",," - -:: Replace desired resources -copy /D /Y %rt_icon% "%res_dir%\ICON1_1.ico" - -set textFile="%res_dir%\resources.rc" -for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do ( - set "line=%%i" - setlocal enabledelayedexpansion - set line=!line:Node.js=Stremio Runtime! - >>"%textFile%" echo !line:node.exe=stremio-runtime.exe! - endlocal -) - -:: Compile new resource file -pushd "%res_dir%" -%rh% -open .\resources.rc -save .\stremio-rt.res -action compile -popd - -:: Build the stremio-runtime executable -%rh% -open %node% -saveas %rt_exe% -action addoverwrite -res "%res_dir%\stremio-rt.res" - -:: Cleanup -rd /S /Q "%res_dir%" -exit /b 0 - -:: Error states - -:norh -echo ResourceHacker.exe not found at %rh% -exit /b 1 - -:nonode -echo Node.exe not found at %node% -exit /b 2 - -:noico -echo Icon file not found at %rt_icon% -exit /b 3 - -:nodir -echo Destination directory does not exists at %rt_path% -exit /b 4 diff --git a/setup/get_exe_from_zip.ps1 b/setup/get_exe_from_zip.ps1 index 5a1347d..0e548b0 100644 --- a/setup/get_exe_from_zip.ps1 +++ b/setup/get_exe_from_zip.ps1 @@ -4,7 +4,6 @@ $files = @( "https://github.com/vot/ffbinaries-prebuilt/releases/download/v3.3/ffmpeg-3.3.4-win-32.zip" "https://github.com/vot/ffbinaries-prebuilt/releases/download/v3.3/ffprobe-3.3.4-win-32.zip" "https://nodejs.org/dist/v16.17.0/node-v16.17.0-win-x86.zip" - "http://www.angusj.com/resourcehacker/resource_hacker.zip" ) New-Item -Path ".\bin" -ItemType Directory -Force