@echo off
echo ========================================
echo    Instalando RustDesk Pre-configurado
echo ========================================
echo.

:: Crear carpeta de destino
set "DEST=%APPDATA%\RustDesk"
if not exist "%DEST%" mkdir "%DEST%"

:: Copiar ejecutable
copy /Y "%~dp0rustdesk.exe" "%DEST%\rustdesk.exe"

:: Copiar configuracion
set "CONFIG=%APPDATA%\RustDesk\config"
if not exist "%CONFIG%" mkdir "%CONFIG%"
copy /Y "%~dp0RustDesk2.toml" "%CONFIG%\RustDesk2.toml"

:: Crear acceso directo en escritorio
powershell -Command "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut('%USERPROFILE%\Desktop\RustDesk.lnk'); $s.TargetPath = '%DEST%\rustdesk.exe'; $s.WorkingDirectory = '%DEST%'; $s.Save()"

echo.
echo ✓ Instalacion completada!
echo ✓ Acceso directo creado en el escritorio
echo.
echo Servidor configurado: gps.oietema.com
echo.

:: Iniciar RustDesk
start "" "%DEST%\rustdesk.exe"

pause
