diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index 9888212..3de4edb 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -16,20 +16,11 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: Build run: cargo build --release --features=bundled - - name: Sign executables - run: | - & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe' sign /f "resources\certificates\smartcode-20211118-20241118.pfx" /p ${{ secrets.WIN_CERT_PASSWORD }} /v ".\target\release\stremio-service.exe" - & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe' sign /f "resources\certificates\smartcode-20211118-20241118.pfx" /p ${{ secrets.WIN_CERT_PASSWORD }} /v ".\resources\bin\windows\node.exe" - & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe' sign /f "resources\certificates\smartcode-20211118-20241118.pfx" /p ${{ secrets.WIN_CERT_PASSWORD }} /v ".\resources\bin\windows\ffmpeg.exe" - & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe' sign /f "resources\certificates\smartcode-20211118-20241118.pfx" /p ${{ secrets.WIN_CERT_PASSWORD }} /v ".\resources\bin\windows\ffprobe.exe" - name: Zip release for windows uses: vimtor/action-zip@v1.1 with: files: resources/bin/windows/ffmpeg.exe resources/bin/windows/ffprobe.exe resources/bin/windows/stremio-runtime.exe target/release/stremio-service.exe resources/bin/windows/server.js LICENSE.md dest: stremio-service-windows.zip - - name: Installer - run: | - & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' '/Sstremiosign=$qC:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\signtool.exe$q sign /f $q${{ github.workspace }}\resources\certificates\smartcode-20211118-20241118.pfx$q /p ${{ secrets.WIN_CERT_PASSWORD }} /v $f' 'setup\StremioService.iss' - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 @@ -40,15 +31,12 @@ jobs: - name: Upload to Amazon S3 run: | - aws s3 cp --acl public-read StremioServiceSetup.exe s3://stremio-artifacts/stremio-service/${{ github.ref_name }}/ + aws s3 cp --acl public-read stremio-service-windows.zip s3://stremio-artifacts/stremio-service-unsigned/${{ github.ref_name }}/ - - name: Generate RC descriptor - run: | - node ./generate_descriptor.js --wait-all --tag=${{ github.ref_name }} - name: Get current date id: date run: echo "TODAY_DATE=$(date +'%d %b %Y')" >> $GITHUB_OUTPUT - - name: Upload dmg and zip file to release + - name: Upload zip file to release uses: softprops/action-gh-release@v1 with: # Use the same name as all releases! @@ -58,4 +46,3 @@ jobs: fail_on_unmatched_files: true files: | stremio-service-windows.zip - StremioServiceSetup.exe diff --git a/.gitignore b/.gitignore index 9d25e1c..a3f2e9a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target .flatpak-builder -StremioServiceSetup.exe \ No newline at end of file +StremioServiceSetup.exe +stremio-service-windows* \ No newline at end of file diff --git a/resources/bin/windows/avcodec-58.dll b/resources/bin/windows/avcodec-58.dll index ec783a5..85c1a5d 100755 Binary files a/resources/bin/windows/avcodec-58.dll and b/resources/bin/windows/avcodec-58.dll differ diff --git a/resources/bin/windows/avdevice-58.dll b/resources/bin/windows/avdevice-58.dll index 6fa85d4..91f8001 100755 Binary files a/resources/bin/windows/avdevice-58.dll and b/resources/bin/windows/avdevice-58.dll differ diff --git a/resources/bin/windows/avfilter-7.dll b/resources/bin/windows/avfilter-7.dll index 32baf9d..6142975 100755 Binary files a/resources/bin/windows/avfilter-7.dll and b/resources/bin/windows/avfilter-7.dll differ diff --git a/resources/bin/windows/avformat-58.dll b/resources/bin/windows/avformat-58.dll index 4ac7b34..bf9dc11 100755 Binary files a/resources/bin/windows/avformat-58.dll and b/resources/bin/windows/avformat-58.dll differ diff --git a/resources/bin/windows/avutil-56.dll b/resources/bin/windows/avutil-56.dll index ff8d066..be12785 100755 Binary files a/resources/bin/windows/avutil-56.dll and b/resources/bin/windows/avutil-56.dll differ diff --git a/resources/bin/windows/ffmpeg.exe b/resources/bin/windows/ffmpeg.exe index 2410be4..329a6bc 100755 Binary files a/resources/bin/windows/ffmpeg.exe and b/resources/bin/windows/ffmpeg.exe differ diff --git a/resources/bin/windows/ffprobe.exe b/resources/bin/windows/ffprobe.exe index e6a1bfa..f628500 100755 Binary files a/resources/bin/windows/ffprobe.exe and b/resources/bin/windows/ffprobe.exe differ diff --git a/resources/bin/windows/postproc-55.dll b/resources/bin/windows/postproc-55.dll index 1355a2b..e971d5b 100755 Binary files a/resources/bin/windows/postproc-55.dll and b/resources/bin/windows/postproc-55.dll differ diff --git a/resources/bin/windows/swresample-3.dll b/resources/bin/windows/swresample-3.dll index 8a7d66b..277dd97 100755 Binary files a/resources/bin/windows/swresample-3.dll and b/resources/bin/windows/swresample-3.dll differ diff --git a/resources/bin/windows/swscale-5.dll b/resources/bin/windows/swscale-5.dll index f386223..f92a316 100755 Binary files a/resources/bin/windows/swscale-5.dll and b/resources/bin/windows/swscale-5.dll differ diff --git a/setup/StremioService.iss b/setup/StremioService.iss index 0560f40..6cc8dc5 100644 --- a/setup/StremioService.iss +++ b/setup/StremioService.iss @@ -4,7 +4,7 @@ #define MyAppShortName "StremioService" #define MyAppExeName "stremio-service.exe" #define MyAppRoot SourcePath + "..\" -#define MyAppBinLocation SourcePath + "..\target\release\" +#define MyAppBinLocation SourcePath + "..\stremio-service-windows\" #define MyAppResBinLocation SourcePath + "..\resources\bin\windows\" #define MyAppExeLocation MyAppBinLocation + MyAppExeName #define MyAppVersion() GetVersionComponents(MyAppExeLocation, Local[0], Local[1], Local[2], Local[3]), \ @@ -148,20 +148,20 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}" [Files] ; NOTE: Don't use "Flags: ignoreversion" on any shared system files -Source: "{#MyAppExeLocation}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppExeLocation}"; DestDir: "{app}"; Flags: ignoreversion signonce Source: "{#MyAppRoot}LICENSE.md"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}ffmpeg.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}ffprobe.exe"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}stremio-runtime.exe"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppResBinLocation}ffmpeg.exe"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}ffprobe.exe"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}stremio-runtime.exe"; DestDir: "{app}"; Flags: ignoreversion signonce Source: "{#MyAppResBinLocation}server.js"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}avcodec-58.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}avdevice-58.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}avfilter-7.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}avformat-58.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}avutil-56.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}postproc-55.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}swresample-3.dll"; DestDir: "{app}"; Flags: ignoreversion -Source: "{#MyAppResBinLocation}swscale-5.dll"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MyAppResBinLocation}avcodec-58.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}avdevice-58.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}avfilter-7.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}avformat-58.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}avutil-56.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}postproc-55.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}swresample-3.dll"; DestDir: "{app}"; Flags: ignoreversion signonce +Source: "{#MyAppResBinLocation}swscale-5.dll"; DestDir: "{app}"; Flags: ignoreversion signonce [Registry] diff --git a/sign.ps1 b/sign.ps1 new file mode 100644 index 0000000..630e907 --- /dev/null +++ b/sign.ps1 @@ -0,0 +1,36 @@ +param ( + [String]$pw = $( Read-Host "Password" ) +) + +if ($null -eq (Get-Command "signtool" -ErrorAction SilentlyContinue)) { + Write-Host "No VC vars found" +} + +$thread = Start-ThreadJob -InputObject ($pw) -ScriptBlock { + $wshell = New-Object -ComObject wscript.shell; + $pw = "$($input)~" + while ($true) { + while ( -not $wshell.AppActivate("Token Logon")) { + Start-Sleep 1 + } + Start-Sleep 1 + $wshell.SendKeys($pw, $true) + Start-Sleep 1 + } +} + +# Get latest build from s3 +Write-Host "Getting latest build from S3..." +$tag = $(git describe --tags --abbrev=0) +aws s3 cp s3://stremio-artifacts/stremio-service-unsigned/$tag/stremio-service-windows.zip . +if (Test-Path "stremio-service-windows") { + Remove-Item -Recurse -Force .\stremio-service-windows +} +Expand-Archive -Path .\stremio-service-windows.zip -DestinationPath .\stremio-service-windows + +$env:package_version = (Select-String -Path .\CMakeLists.txt -Pattern '^project\(stremio VERSION "([^"]+)"\)').Matches.Groups[1].Value +Write-Host "Building the installer" +& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' '/Sstremiosign=$qsigntool.exe$q sign /fd SHA256 /t http://timestamp.digicert.com /n $qSmart Code OOD$q $f' 'setup\StremioService.iss' + +Stop-Job $thread +Write-Host "Done"