Skip to content

Commit f4a2c98

Browse files
committed
Moved some vs; fixed potential bug with version comparison
1 parent 45ee2bf commit f4a2c98

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

b-e updater.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ setlocal enabledelayedexpansion
4545
>%TEMP%\batch_update.tmp findstr "tag_name" %updateFileName%
4646
<%TEMP%\batch_update.tmp set /p "ver_entry="
4747
set "ver=%ver_entry:~15,-2%"
48-
set "UpdateVersion=%ver:~1%"
48+
set "UpdateVersion=v%ver:~1%"
4949

5050
set regex_command=powershell -Command "$x = Get-Content %updateFileName% -Raw; $k = $x | Select-String -Pattern '(?s)url(((?^^^!url).)*?)batch\.encoder'; $g = $k.Matches.Value | Select-String -Pattern '^""[^^^^"""]+?^""",'; $g.Matches.Value"
5151

@@ -59,7 +59,7 @@ setlocal enabledelayedexpansion
5959
echo.
6060
timeout /nobreak /t 5 > nul
6161
echo Downloading files...
62-
curl --silent -L -H "Accept: application/octet-stream" -o "batch encoder v%UpdateVersion%.bat" %UpdateAPIURL%
62+
curl --silent -L -H "Accept: application/octet-stream" -o "batch encoder %UpdateVersion%.bat" %UpdateAPIURL%
6363
echo.
6464
echo Download complete. The program will now clean up and restart.
6565
pause
@@ -69,7 +69,7 @@ setlocal enabledelayedexpansion
6969
)
7070
)
7171
del "%updateFileName%"
72-
(goto) 2>nul & "batch encoder v%UpdateVersion%.bat" --updated-from "%~f0"
72+
(goto) 2>nul & "batch encoder %UpdateVersion%.bat" --updated-from "%~f0"
7373

7474
:AutoUpdateError
7575
del "%updateFileName%"

batch encoder.bat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@echo off
22
setlocal enabledelayedexpansion
33

4-
SET CurrentVersion=v1.5.0-alpha3
4+
SET CurrentVersion=v1.5.0-alpha4
55

66
cls
77
if /i "%1"=="--updated-from" (
@@ -36,7 +36,7 @@ if /i "%1"=="--updated-from" (
3636
>%TEMP%\batch_update.tmp findstr "tag_name" %updateFileName%
3737
<%TEMP%\batch_update.tmp set /p "ver_entry="
3838
set "ver=%ver_entry:~15,-2%"
39-
set "UpdateVersion=%ver:~1%"
39+
set "UpdateVersion=v%ver:~1%"
4040

4141
set regex_command=powershell -Command "$x = Get-Content %updateFileName% -Raw; $k = $x | Select-String -Pattern '(?s)url(((?^^^!url).)*?)batch\.encoder'; $g = $k.Matches.Value | Select-String -Pattern '^""[^^^^"""]+?^""",'; $g.Matches.Value"
4242

@@ -45,7 +45,7 @@ if /i "%1"=="--updated-from" (
4545

4646
for %%a in (ver_entry, API_link_entry, UpdateVersion, UpdateAPIURL) do if not defined %%a goto AutoUpdateError
4747

48-
if exist "batch encoder v%UpdateVersion%.bat" set "append=_new"
48+
if exist "batch encoder %UpdateVersion%.bat" set "append=_new"
4949

5050
echo.
5151
if /i "%UpdateVersion%"=="%CurrentVersion%" (
@@ -54,20 +54,20 @@ if /i "%1"=="--updated-from" (
5454
echo Restarting program...
5555
echo.
5656
pause
57-
del "batch_update.json"
57+
del "%updateFileName%"
5858
goto AskProceed
5959
) else (
6060
echo Differing version found^^! ^(%CurrentVersion% -^> %UpdateVersion%^)
6161
echo Proceeding with update in 5 seconds, press CTRL+C or close window to cancel.
6262
echo.
6363
timeout /nobreak /t 5 > nul
6464
echo Downloading files...
65-
curl --silent -L -H "Accept: application/octet-stream" -o "batch encoder v%UpdateVersion%%append%.bat" %UpdateAPIURL%
65+
curl --silent -L -H "Accept: application/octet-stream" -o "batch encoder %UpdateVersion%%append%.bat" %UpdateAPIURL%
6666
echo.
6767
echo Download complete. The program will now clean up and restart.
6868
pause
6969
del "%updateFileName%"
70-
(goto) 2>nul & "batch encoder v%UpdateVersion%%append%.bat" --updated-from "%~f0"
70+
(goto) 2>nul & "batch encoder %UpdateVersion%%append%.bat" --updated-from "%~f0"
7171
)
7272

7373
:FFMPEGLocation

0 commit comments

Comments
 (0)