@@ -9,57 +9,35 @@ set rh="C:\RH\ResourceHacker.exe"
9
9
set node = " C:\Program Files (x86)\nodejs\node.exe"
10
10
11
11
pushd %~dp0
12
+ set rcedit = " %cd% \..\rcedit-x86.exe"
12
13
pushd ..\images
13
14
set rt_icon = " %cd% \stremio_gray.ico"
14
15
popd
15
16
popd
16
17
17
18
:: Check if all paths are correct
18
- if not exist %rh % goto :norh
19
+ if not exist %rcedit % goto :norcedit
19
20
if not exist %node% goto :nonode
20
21
if not exist %rt_icon% goto :noico
21
22
if not exist " %rt_path% \" goto :nodir
22
23
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%
26
27
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%
58
36
59
37
:: Error states
60
38
61
- :norh
62
- echo ResourceHacker .exe not found at %rh %
39
+ :norcedit
40
+ echo rcedit-x86 .exe not found at %rcedit %
63
41
exit /b 1
64
42
65
43
:nonode
0 commit comments