Skip to content

Commit 982945f

Browse files
authored
Merge pull request #376 from Stremio/notarytool
Use notarytool instead of altool and rcedit instead of ResourceHacker
2 parents 8e0b301 + 97a0f56 commit 982945f

File tree

4 files changed

+22
-68
lines changed

4 files changed

+22
-68
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ icons
5656
server.js
5757
Stremio*.exe
5858

59+
rcedit-x86.exe

appveyor.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ install:
3030
del $file
3131
- set OPENSSL_BIN_PATH=C:\OpenSSL-Win32\bin
3232

33-
# Install Resource Hacker
34-
- ps: $env:RH_INSTALLER = "reshacker_setup.exe"
35-
- ps: Start-FileDownload "http://www.angusj.com/resourcehacker/$env:RH_INSTALLER"
36-
- ps: Start-Process "$env:RH_INSTALLER" -ArgumentList "/silent /verysilent /sp- /suppressmsgboxes /dir=C:\RH" -Wait
37-
- ps: del "$env:RH_INSTALLER"
33+
# Download rcedit
34+
- ps: Start-FileDownload "https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x86.exe"
3835

3936
# Temp debugging
4037
- ps: $env:DLL_DIR = "windows"

mac/notarizer.sh

+4-26
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,14 @@ TEAM_ID="$4"
1515
echo Compresing...
1616
ditto -c -k --rsrc --keepParent "$APP_PATH" "$ZIP_PATH"
1717

18-
echo Sending notarizing request...
19-
REQUEST=$(xcrun altool --notarize-app -t osx -f "$ZIP_PATH" --primary-bundle-id com.smartcodeltd.stremio -u "$USER" -p "$PASS" --asc-provider "$TEAM_ID" | awk '/RequestUUID =/ { print $3 }')
18+
echo "Create keychain profile"
19+
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$USER" --team-id "$TEAM_ID" --password "$PASS"
2020

21-
echo Got request ID: $REQUEST
21+
echo Sending notarizing request...
22+
xcrun notarytool submit "$ZIP_PATH" --keychain-profile "notarytool-profile" --wait
2223

2324
rm "$ZIP_PATH"
2425

25-
#get_status() {
26-
# xcrun altool --notarization-info "$REQUEST" -u "$USER" -p "$PASS" | awk '/Status:/ { print $2 }'
27-
#}
28-
#
29-
#echo Checking notarizing response...
30-
#STATUS="$(get_status)"
31-
#while [ "$STATUS" == "in progress" ]; do
32-
# sleep 30
33-
# echo Not ready yet. Checking again...
34-
# STATUS="$(get_status)"
35-
#done
36-
#
37-
#echo Status: $STATUS
38-
#
39-
#if [ "$STATUS" != "success" ]; then
40-
# exit 1
41-
#fi
42-
echo Waiting for notarization...
43-
sleep 480
44-
45-
echo Check the notarization status...
46-
xcrun altool --notarization-info "$REQUEST" -u "$USER" -p "$PASS"
47-
4826
echo Stapling the app...
4927
xcrun stapler staple "$APP_PATH"
5028
echo Done.

windows/generate_stremio-runtime.cmd

+15-37
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,35 @@ set rh="C:\RH\ResourceHacker.exe"
99
set node="C:\Program Files (x86)\nodejs\node.exe"
1010

1111
pushd %~dp0
12+
set rcedit="%cd%\..\rcedit-x86.exe"
1213
pushd ..\images
1314
set rt_icon="%cd%\stremio_gray.ico"
1415
popd
1516
popd
1617

1718
:: Check if all paths are correct
18-
if not exist %rh% goto :norh
19+
if not exist %rcedit% goto :norcedit
1920
if not exist %node% goto :nonode
2021
if not exist %rt_icon% goto :noico
2122
if not exist "%rt_path%\" goto :nodir
2223

23-
:: Create temp dir
24-
set "res_dir=%TEMP%\srres"
25-
md "%res_dir%"
24+
:: Copy node.exe to the dist dir and remove signature
25+
copy %node% "%rt_exe%"
26+
signtool remove /s %rt_exe%
2627

27-
:: Copy node.exe to the temp dir and remove signature
28-
copy %node% "%res_dir%\node.exe"
29-
set node="%res_dir%\node.exe"
30-
signtool remove /s %node%
31-
32-
:: Extract Node.js resources
33-
%rh% -open %node% -save "%res_dir%\resources.rc" -action extract -mask ",,"
34-
35-
:: Replace desired resources
36-
copy /D /Y %rt_icon% "%res_dir%\ICON1_1.ico"
37-
38-
set textFile="%res_dir%\resources.rc"
39-
for /f "delims=" %%i in ('type "%textFile%" ^& break ^> "%textFile%" ') do (
40-
set "line=%%i"
41-
setlocal enabledelayedexpansion
42-
set line=!line:Node.js=Stremio Runtime!
43-
>>"%textFile%" echo !line:node.exe=stremio-runtime.exe!
44-
endlocal
45-
)
46-
47-
:: Compile new resource file
48-
pushd "%res_dir%"
49-
%rh% -open .\resources.rc -save .\stremio-rt.res -action compile
50-
popd
51-
52-
:: Build the stremio-runtime executable
53-
%rh% -open %node% -saveas %rt_exe% -action addoverwrite -res "%res_dir%\stremio-rt.res"
54-
55-
:: Cleanup
56-
rd /S /Q "%res_dir%"
57-
exit /b 0
28+
:: Patch the exe
29+
%rcedit% %rt_exe% ^
30+
--set-icon %rt_icon% ^
31+
--set-version-string "ProductName" "StremioRuntime" ^
32+
--set-version-string "FileDescription" "Stremio Server JavaScript Runtime" ^
33+
--set-version-string "OriginalFilename" "stremio-runtime.exe" ^
34+
--set-version-string "InternalName" "stremio-runtime"
35+
exit /b %errorlevel%
5836

5937
:: Error states
6038

61-
:norh
62-
echo ResourceHacker.exe not found at %rh%
39+
:norcedit
40+
echo rcedit-x86.exe not found at %rcedit%
6341
exit /b 1
6442

6543
:nonode

0 commit comments

Comments
 (0)