@echo off
title Uzaktan Destek
color 0B

echo.
echo   ============================================
echo      UZAKTAN DESTEK HAZIRLANIYOR
echo   ============================================
echo.

set "TMPEXE=%TEMP%\destek-rustdesk.exe"
set "CFGDIR=%APPDATA%\RustDesk\config"

rem --- Program indiriliyor (daha once indirildiyse atlanir) ---
if exist "%TMPEXE%" goto ayarla
echo   Program indiriliyor, lutfen bekleyin...
curl -L -s -o "%TMPEXE%" "https://destek.uygulamalarim.com/rustdesk.exe"
if not exist "%TMPEXE%" (
  echo.
  echo   HATA: Program indirilemedi.
  echo   Internet baglantinizi kontrol edip tekrar deneyin.
  echo.
  pause
  exit /b 1
)

:ayarla
echo   Ayarlar uygulaniyor...
if not exist "%CFGDIR%" mkdir "%CFGDIR%" >nul 2>&1

> "%CFGDIR%\RustDesk2.toml" (
  echo rendezvous_server = 'destek.uygulamalarim.com:21116'
  echo nat_type = 1
  echo serial = 0
  echo.
  echo [options]
  echo custom-rendezvous-server = 'destek.uygulamalarim.com'
  echo relay-server = 'destek.uygulamalarim.com'
  echo key = 'BlP9lJOxuoddT0Kem3TO2m3DIQGZB703R6beU4pDjWk='
)

echo   Program aciliyor...
start "" "%TMPEXE%"

echo.
echo   ============================================
echo      HAZIR
echo   ============================================
echo.
echo   Acilan pencerede gordugunuz
echo.
echo      KIMLIK ^(ID^)  ve  SIFRE
echo.
echo   bilgilerini destek yetkilisine bildirin.
echo.
echo   Destek bitince pencereyi kapatmaniz yeterli.
echo.
echo   ============================================
echo.

timeout /t 20 >nul
