Compare commits

...

5 Commits

Author SHA1 Message Date
Typikal_Failman
4521414d39
Merge e4b4ac7654 into 3ef216b71b 2025-06-17 06:33:46 +04:00
unknown
3ef216b71b Fixed DelayedExpansion, game filter template 2025-06-17 03:47:27 +03:00
Typikal_Failman
e4b4ac7654
Update launcher.bat
Убрал сортировку.
2025-06-10 14:42:10 +05:00
Typikal_Failman
d34a415dda
Update launcher.bat
Убрал не нужный endlocal.
2025-06-09 19:38:08 +05:00
Typikal_Failman
d68879e6d8
Create launcher.bat
Adding laucher.bat for create shortcut to fast change of configure. Usable for laptops rapidly moved between different Internet providers.
2025-06-09 19:29:59 +05:00
3 changed files with 114 additions and 20 deletions

1
bin/game_filter.enabled Normal file
View File

@ -0,0 +1 @@
ENABLED

47
launcher.bat Normal file
View File

@ -0,0 +1,47 @@
@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion
:: Создаем временный файл для сортировки
:: Searching for .bat files in current folder, except files that start with "service"
echo Pick one of the options:
set "count=0"
for %%f in (*.bat) do (
if /i not "%%~nxf"=="launcher.bat" (
set "filename=%%~nxf"
set /a count+=1
echo !count!. %%f
set "file!count!=%%f"
)
)
:: Choosing file
:input
set "choice="
set /p "choice=Input file index (number): "
if "!choice!"=="" goto :eof
set "selectedFile=!file%choice%!"
if not defined selectedFile (
echo Invalid choice, try again...
goto input
)
:: Блок ввода номера
:input
echo.
set /p "choice=Введите номер файла (1-%count%): "
echo.
:: Проверка корректности ввода
set valid=0
for /l %%i in (1,1,%count%) do if "!choice!"=="%%i" set valid=1
if !valid! equ 0 (
echo Ошибка: неверный номер. Введите число от 1 до %count%.
goto input
)
:: Запуск выбранного файла
echo Запускаем файл: !file%choice%!
call "!file%choice%!"

View File

@ -1,5 +1,4 @@
@echo off @echo off
setlocal EnableDelayedExpansion
set "LOCAL_VERSION=1.7.2b" set "LOCAL_VERSION=1.7.2b"
:: External commands :: External commands
@ -13,6 +12,12 @@ if "%~1"=="check_updates" (
exit /b exit /b
) )
if "%~1"=="load_game_filter" (
call :game_switch_status
exit /b
)
if "%1"=="admin" ( if "%1"=="admin" (
echo Started with admin rights echo Started with admin rights
) else ( ) else (
@ -23,9 +28,11 @@ if "%1"=="admin" (
:: MENU ================================ :: MENU ================================
setlocal EnableDelayedExpansion
:menu :menu
cls cls
call :ipset_switch_status call :ipset_switch_status
call :game_switch_status
set "menu_choice=null" set "menu_choice=null"
echo ======================= echo =======================
@ -34,18 +41,20 @@ echo 2. Remove Services
echo 3. Check Service Status echo 3. Check Service Status
echo 4. Run Diagnostics echo 4. Run Diagnostics
echo 5. Check Updates echo 5. Check Updates
echo 6. Switch ipset (%IPsetStatus%) echo 6. Switch Game Filter (%GameFilterStatus%)
echo 7. Update ipset list echo 7. Switch ipset (%IPsetStatus%)
echo 8. Update ipset list
echo 0. Exit echo 0. Exit
set /p menu_choice=Enter choice (0-7): set /p menu_choice=Enter choice (0-8):
if "%menu_choice%"=="1" goto service_install if "%menu_choice%"=="1" goto service_install
if "%menu_choice%"=="2" goto service_remove if "%menu_choice%"=="2" goto service_remove
if "%menu_choice%"=="3" goto service_status if "%menu_choice%"=="3" goto service_status
if "%menu_choice%"=="4" goto service_diagnostics if "%menu_choice%"=="4" goto service_diagnostics
if "%menu_choice%"=="5" goto service_check_updates if "%menu_choice%"=="5" goto service_check_updates
if "%menu_choice%"=="6" goto ipset_switch if "%menu_choice%"=="6" goto game_switch
if "%menu_choice%"=="7" goto ipset_update if "%menu_choice%"=="7" goto ipset_switch
if "%menu_choice%"=="8" goto ipset_update
if "%menu_choice%"=="0" exit /b if "%menu_choice%"=="0" exit /b
goto menu goto menu
@ -258,21 +267,26 @@ if not defined GITHUB_VERSION (
:: Version comparison :: Version comparison
if "%LOCAL_VERSION%"=="%GITHUB_VERSION%" ( if "%LOCAL_VERSION%"=="%GITHUB_VERSION%" (
echo Latest version installed: %LOCAL_VERSION% echo Latest version installed: %LOCAL_VERSION%
) else (
echo New version available: %GITHUB_VERSION%
echo Release page: %GITHUB_RELEASE_URL%%GITHUB_VERSION%
set "CHOICE=" if "%1"=="soft" exit /b
set /p "CHOICE=Do you want to automatically download the new version? (Y/N) (default: Y) " pause
if "!CHOICE!"=="" set "CHOICE=Y" goto menu
if "!CHOICE!"=="y" set "CHOICE=Y"
if /i "!CHOICE!"=="Y" (
echo Opening the download page...
start "" "%GITHUB_DOWNLOAD_URL%%GITHUB_VERSION%.rar"
)
) )
echo New version available: %GITHUB_VERSION%
echo Release page: %GITHUB_RELEASE_URL%%GITHUB_VERSION%
set "CHOICE="
set /p "CHOICE=Do you want to automatically download the new version? (Y/N) (default: Y) "
if "%CHOICE%"=="" set "CHOICE=Y"
if /i "%CHOICE%"=="y" set "CHOICE=Y"
if /i "%CHOICE%"=="Y" (
echo Opening the download page...
start "" "%GITHUB_DOWNLOAD_URL%%GITHUB_VERSION%.rar"
)
if "%1"=="soft" exit /b if "%1"=="soft" exit /b
pause pause
goto menu goto menu
@ -399,15 +413,47 @@ pause
goto menu goto menu
:: GAME SWITCH ========================
:game_switch_status
chcp 437 > nul
set "gameFlagFile=%~dp0bin\game_filter.enabled"
if exist "%gameFlagFile%" (
set "GameFilterStatus=enabled"
set "GameFilter=1024-65535"
) else (
set "GameFilterStatus=disabled"
set "GameFilter=0"
)
exit /b
:game_switch
chcp 437 > nul
cls
if not exist "%gameFlagFile%" (
echo Enabling game filter...
echo ENABLED > "%gameFlagFile%"
) else (
echo Disabling game filter...
del /f /q "%gameFlagFile%"
)
pause
goto menu
:: IPSET SWITCH ======================= :: IPSET SWITCH =======================
:ipset_switch_status :ipset_switch_status
chcp 437 > nul chcp 437 > nul
findstr /R "^0\.0\.0\.0/32$" "%~dp0lists\ipset-all.txt" >nul findstr /R "^0\.0\.0\.0/32$" "%~dp0lists\ipset-all.txt" >nul
if !errorlevel!==0 ( if !errorlevel!==0 (
set "IPsetStatus=load" set "IPsetStatus=empty"
) else ( ) else (
set "IPsetStatus=unload" set "IPsetStatus=loaded"
) )
exit /b exit /b
@ -427,7 +473,7 @@ if !errorlevel!==0 (
del /f /q "%listFile%" del /f /q "%listFile%"
ren "%backupFile%" "ipset-all.txt" ren "%backupFile%" "ipset-all.txt"
) else ( ) else (
echo Error: no backup to restore. Download list from repoistory echo Error: no backup to restore. Update list from service menu by yourself
) )
) else ( ) else (