From 1c899d8ad13bce91e62d8679971fcdc7bfe0ed0d Mon Sep 17 00:00:00 2001 From: Vladimir Borisov Date: Mon, 3 Oct 2022 15:13:34 +0300 Subject: [PATCH] Installer build scripts --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ setup/create_setup.bat | 11 ++++++----- setup/generate_stremio-runtime.bat | 4 +++- setup/get_exe_from_zip.ps1 | 1 + 4 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b0ca9dc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build Installer + +on: [pull_request, push] + +jobs: + build: + runs-on: windows-latest + steps: + # The Windows runners have autocrlf enabled by default + # which causes failures for some of rustfmt's line-ending sensitive tests + - name: disable git eol translation + run: git config --global core.autocrlf false + - name: checkout + uses: actions/checkout@v3 + - name: Stable with rustfmt and clippy + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt, clippy + - name: Build + run: cargo test + - uses: actions/upload-artifact@v3 + with: + name: stremio-setup + path: Stremio*.exe diff --git a/setup/create_setup.bat b/setup/create_setup.bat index 788c44c..bd09727 100644 --- a/setup/create_setup.bat +++ b/setup/create_setup.bat @@ -3,14 +3,15 @@ set mypath=%~dp0 :: Download ffmpeg and node set missing= -if not exist "%mypath%..\bin" missing=1 -if not exist "%mypath%..\bin\node.exe" missing=1 -if not exist "%mypath%..\bin\ffmpeg.exe" missing=1 -if not exist "%mypath%..\bin\ffprobe.exe" missing=1 +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 and node are already present + echo Binaries for ffmpeg, ffprobe, node and ResHack are already present ) :: Convert node to stremio-runtime diff --git a/setup/generate_stremio-runtime.bat b/setup/generate_stremio-runtime.bat index 690be09..4895f52 100644 --- a/setup/generate_stremio-runtime.bat +++ b/setup/generate_stremio-runtime.bat @@ -4,11 +4,13 @@ set "rt_path=%~dpf1" set rt_exe="%rt_path%\stremio-runtime.exe" -set rh="C:\RH\ResourceHacker.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" diff --git a/setup/get_exe_from_zip.ps1 b/setup/get_exe_from_zip.ps1 index 0e548b0..5a1347d 100644 --- a/setup/get_exe_from_zip.ps1 +++ b/setup/get_exe_from_zip.ps1 @@ -4,6 +4,7 @@ $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