summaryrefslogtreecommitdiff
path: root/scripts/rustdesk.bat
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2026-11-17 22:41:47 +0100
committerpolo <ordipolo@gmx.fr>2026-11-17 22:41:47 +0100
commita05773ec9a0e0335927f2731dfc76ad28f312697 (patch)
tree21e3ee846bfa16fa514d292a6861d6dda778dcd7 /scripts/rustdesk.bat
parenteb8712617faa0f26033599f9fa5c3c4f1e30c5ba (diff)
downloadrustdesk-scripts-a05773ec9a0e0335927f2731dfc76ad28f312697.tar.gz
rustdesk-scripts-a05773ec9a0e0335927f2731dfc76ad28f312697.tar.bz2
rustdesk-scripts-a05773ec9a0e0335927f2731dfc76ad28f312697.zip
fonctionne avec win7, correction du téléchargement avec powershell, utilisation du binaire sciter même avec win7 64b
Diffstat (limited to 'scripts/rustdesk.bat')
-rw-r--r--scripts/rustdesk.bat57
1 files changed, 41 insertions, 16 deletions
diff --git a/scripts/rustdesk.bat b/scripts/rustdesk.bat
index 708c18e..5e60787 100644
--- a/scripts/rustdesk.bat
+++ b/scripts/rustdesk.bat
@@ -12,6 +12,7 @@ if %errorlevel% neq 0 (
12 12
13set config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye 13set config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye
14 14
15rem Architecture
15if defined PROCESSOR_ARCHITEW6432 ( 16if defined PROCESSOR_ARCHITEW6432 (
16 set "ARCH=64" 17 set "ARCH=64"
17) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( 18) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
@@ -19,24 +20,49 @@ if defined PROCESSOR_ARCHITEW6432 (
19) else ( 20) else (
20 set "ARCH=32" 21 set "ARCH=32"
21) 22)
22if "%ARCH%"=="64" ( 23echo Architecture : %ARCH% bits
23 set "URL=https://remote.ordipolo.fr/client/rustdesk-x64.msi" 24
24 set "INSTALLER=C:\Temp\rustdesk.msi" 25rem Version Windows
25) else ( 26for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion 2^>nul') do set "WINVER=%%a"
27rem Conversion de 6.1 en 61, 6.2 en 62, etc.
28for /f "tokens=1,2 delims=." %%a in ("%WINVER%") do set /a WINVER=%%a*10+%%b
29echo Version Windows : %WINVER%
30
31
32rem Windows 7 et anterieurs (seuil 61)
33if %WINVER% LEQ 61 (
34 echo Ancienne version de Windows detectee
26 set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe" 35 set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe"
27 set "INSTALLER=C:\Temp\rustdesk.exe" 36 set "INSTALLER=C:\Temp\rustdesk.exe"
37
38 if "%ARCH%"=="64" (
39 set "INSTALL_DIR=C:\Program Files (x86)\RustDesk"
40 ) else (
41 set "INSTALL_DIR=C:\Program Files\RustDesk"
42 )
43) else (
44 echo Windows 8 ou superieur
45
46 if "%ARCH%"=="64" (
47 set "URL=https://remote.ordipolo.fr/client/rustdesk-x64.msi"
48 set "INSTALLER=C:\Temp\rustdesk.msi"
49 ) else (
50 set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe"
51 set "INSTALLER=C:\Temp\rustdesk.exe"
52 )
53 set "INSTALL_DIR=C:\Program Files\RustDesk"
28) 54)
29echo Architecture : %ARCH% bits
30echo URL : %URL% 55echo URL : %URL%
31echo Installateur : %INSTALLER% 56echo Installateur : %INSTALLER%
57echo Repertoire : %INSTALL_DIR%
32 58
33if not exist "C:\Temp" mkdir "C:\Temp" 59if not exist "C:\Temp" mkdir "C:\Temp"
34 60
35if exist "C:\Program Files\RustDesk\rustdesk.exe" ( 61if exist "%INSTALL_DIR%\rustdesk.exe" (
36 echo RustDesk est deja installe 62 echo RustDesk est deja installe
37 "C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" 63 "%INSTALL_DIR%\rustdesk.exe" --config "%config%"
38 timeout /t 2 /nobreak >nul 64 timeout /t 2 /nobreak >nul
39 start "" "C:\Program Files\RustDesk\rustdesk.exe" 65 start "" "%INSTALL_DIR%\rustdesk.exe"
40 exit /b 66 exit /b
41) 67)
42 68
@@ -49,10 +75,9 @@ if exist "C:\Program Files\RustDesk\rustdesk.exe" (
49 75
50) else ( 76) else (
51 if not exist "%INSTALLER%" ( 77 if not exist "%INSTALLER%" (
78 rem pas de curl dans windows 7, utiliser powershell (nécessite .NET framework 4.8)
52 echo Telechargement de RustDesk via PowerShell 79 echo Telechargement de RustDesk via PowerShell
53 powershell -NoProfile -ExecutionPolicy Bypass -Command ^ 80 powershell -NoProfile -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Enum]::ToObject([Net.SecurityProtocolType], 3072); $wc = New-Object Net.WebClient; $wc.DownloadFile('%URL%', '%INSTALLER%')" || exit /b 1
54 "$web_client = New-Object Net.WebClient; $web_client.DownloadFile('%URL%', '%INSTALLER%')" ^
55 || exit /b 1
56 ) else ( 81 ) else (
57 echo RustDesk deja telecharge 82 echo RustDesk deja telecharge
58 ) 83 )
@@ -60,7 +85,7 @@ if exist "C:\Program Files\RustDesk\rustdesk.exe" (
60 85
61 86
62echo Installation de RustDesk 87echo Installation de RustDesk
63if "%ARCH%"=="64" ( 88if "%ARCH%"=="64" if %WINVER% GTR 61 (
64 msiexec /i "%INSTALLER%" /qn INSTALLPRINTER=N 89 msiexec /i "%INSTALLER%" /qn INSTALLPRINTER=N
65 goto INSTALL_OK 90 goto INSTALL_OK
66) 91)
@@ -75,7 +100,7 @@ if errorlevel 1 (
75rem parce que start "" /wait peut ne pas avoir le comportement attendu 100rem parce que start "" /wait peut ne pas avoir le comportement attendu
76set /a COUNT=0 101set /a COUNT=0
77:WAIT_INSTALL 102:WAIT_INSTALL
78if exist "C:\Program Files\RustDesk\rustdesk.exe" ( 103if exist "%INSTALL_DIR%\rustdesk.exe" (
79 echo installation terminee 104 echo installation terminee
80 goto INSTALL_OK 105 goto INSTALL_OK
81) 106)
@@ -91,11 +116,11 @@ goto WAIT_INSTALL
91 116
92 117
93echo Installation du service 118echo Installation du service
94"C:\Program Files\RustDesk\rustdesk.exe" --install-service 119"%INSTALL_DIR%\rustdesk.exe" --install-service
95timeout /t 3 /nobreak >nul 120timeout /t 3 /nobreak >nul
96 121
97echo Application de la configuration 122echo Application de la configuration
98"C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" 123"%INSTALL_DIR%\rustdesk.exe" --config "%config%"
99timeout /t 2 /nobreak >nul 124timeout /t 2 /nobreak >nul
100 125
101start "" "C:\Program Files\RustDesk\rustdesk.exe" 126start "" "%INSTALL_DIR%\rustdesk.exe"