@echo off
setlocal

echo Instaling custom RustDesk configuration...

REM RustDesk configuration folder
set TARGET_DIR=%APPDATA%\RustDesk\config
set TARGET_FILE=%TARGET_DIR%\RustDesk2.toml

REM If directory does not exist, create one
if not exist "%TARGET_DIR%" (
    mkdir "%TARGET_DIR%"
)

REM If old config file exist, delete it
if exist "%TARGET_FILE%" (
    del "%TARGET_FILE%"
)

REM Create new RustDesk2.toml
(
echo rendezvous_server = 'helpdesk.mitroserverdonttouch.net:21116'
echo nat_type = 2
echo serial = 0
echo unlock_pin = ''
echo trusted_devices = ''
echo.
echo [options]
echo relay-server = 'helpdesk.mitroserverdonttouch.net'
echo av1-test = 'Y'
echo key = 'gseZwCp2z5Ke8JABtGU6xRmUWdVth4MRXBVx0osP0e0='
echo stop-service = 'Y'
echo allow-auto-update = 'Y'
echo custom-rendezvous-server = 'helpdesk.mitroserverdonttouch.net'
) > "%TARGET_FILE%"

echo Done! New RustDesk2.toml is installed.
pause
