@echo off
chcp 65001 >nul
title SEGE SYSTEMS - Interception Driver Installer
color 0A

:: -------------------------------
:: Kendi dizinini kesin al
:: -------------------------------
set "BASE_DIR=%~dp0"
cd /d "%BASE_DIR%"

:: -------------------------------
:: Admin kontrolü
:: -------------------------------
net session >nul 2>&1
if %errorLevel% neq 0 (
    echo [!] SEGE SYSTEMS: Admin yetkisi gerekiyor.
    echo     Yeniden baslatiliyor...
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

cls
echo.
echo      ███████╗███████╗ ██████╗ ███████╗
echo      ██╔════╝██╔════╝██╔════╝ ██╔════╝
echo      ███████╗█████╗  ██║  ███╗█████╗  
echo      ╚════██║██╔══╝  ██║   ██║██╔══╝  
echo      ███████║███████╗╚██████╔╝███████╗
echo      ╚══════╝╚══════╝ ╚═════╝ ╚══════╝
echo.
echo   ==========================================
echo        SEGE SYSTEMS
echo     INTERCEPTION DRIVER KURULUMU
echo   ==========================================
echo.

:: -------------------------------
:: Driver exe kontrol
:: -------------------------------
if not exist "%BASE_DIR%driver\install-interception.exe" (
    echo [X] SEGE SYSTEMS HATA:
    echo     driver\install-interception.exe bulunamadi!
    echo.
    echo     Beklenen yol:
    echo     %BASE_DIR%driver\install-interception.exe
    echo.
    pause
    exit /b
)

:: -------------------------------
:: Kurulum
:: -------------------------------
cd /d "%BASE_DIR%driver"

echo [+] SEGE SYSTEMS: Driver kuruluyor...
install-interception.exe /install

if %errorLevel% neq 0 (
    echo.
    echo [X] SEGE SYSTEMS: Kurulum basarisiz!
    echo     Antivirus veya yetkileri kontrol et.
    echo.
    pause
    exit /b
)

echo.
echo [OK] SEGE SYSTEMS:
echo     Interception Driver basariyla kuruldu.
echo.
echo [!] Sistem yeniden baslatilirsa degisiklikler aktif olur.
echo.

pause
exit /b
