@echo off set VERSION=%1 set DOWNLOADFILE="%TEMP%\Nextcloud-%VERSION%.msi" for /F "tokens=3" %%a in ('reg query "HKCU\Control Panel\International" /v LocaleName ^| find "LocaleName"') do ( for /F "tokens=1 delims=-" %%b in ("%%a") do set LANG=%%b ) if "%LANG%" == "en" ( set LANG=en-US ) else if "%LANG%" == "es" ( set LANG=es-ES ) else if "%LANG%" == "pt" ( set LANG=pt-PT ) else if "%LANG%" == "sv" ( set LANG=sv-SE ) if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( set ARCH=x64 ) else if "%PROCESSOR_ARCHITECTURE%" == "ARM64" ( set ARCH=x64 ) else if "%PROCESSOR_ARCHITECTURE%" == "IA64" ( exit 255 ) else if "%PROCESSOR_ARCHITECTURE%" == "x86" ( exit 255 ) else ( exit 254 ) :: download Nextcloud Desktop Client "%SYSTEMROOT%\System32\bitsadmin.exe" /transfer /download https://github.com/nextcloud-releases/desktop/releases/download/v%VERSION%/Nextcloud-%VERSION%-x64.msi %DOWNLOADFILE% >NUL :: install Nextcloud Desktop Client msiexec /qn /i %DOWNLOADFILE% SKIPAUTOUPDATE=1 REBOOT=ReallySuppress /l*v %TEMP%\nextcloud_install.log