@echo off
echo Iniciando instalacion de RustDesk...

rem Definir URL como variable
set DOWNLOAD_URL=https://descargas.alpex-digital.com/soporte-alpex-digital.exe

rem Crear directorio temporal
if not exist C:\Temp mkdir C:\Temp
cd /d C:\Temp

rem Descargar el archivo
echo Descargando RustDesk...
curl -L "%DOWNLOAD_URL%" -o rustdesk.exe

rem Verificar descarga
if not exist rustdesk.exe (
    echo Error: No se pudo descargar el archivo.
    exit /b 1
)

rem Instalar
echo Instalando RustDesk...
start /wait rustdesk.exe --silent-install

rem Esperar
timeout /t 4 /nobreak > nul

rem Limpiar
echo Eliminando archivo temporal...
del /q rustdesk.exe

echo Instalacion completada.