From a05773ec9a0e0335927f2731dfc76ad28f312697 Mon Sep 17 00:00:00 2001
From: polo
Date: Tue, 17 Nov 2026 22:41:47 +0100
Subject: =?UTF-8?q?fonctionne=20avec=20win7,=20correction=20du=20t=C3=A9l?=
=?UTF-8?q?=C3=A9chargement=20avec=20powershell,=20utilisation=20du=20bina?=
=?UTF-8?q?ire=20sciter=20m=C3=AAme=20avec=20win7=2064b?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scripts/rustdesk.bat | 57 +++++++++++++++++++++++++++++++++++++---------------
template.php | 1 +
2 files changed, 42 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 (
set config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye
+rem Architecture
if defined PROCESSOR_ARCHITEW6432 (
set "ARCH=64"
) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
@@ -19,24 +20,49 @@ if defined PROCESSOR_ARCHITEW6432 (
) else (
set "ARCH=32"
)
-if "%ARCH%"=="64" (
- set "URL=https://remote.ordipolo.fr/client/rustdesk-x64.msi"
- set "INSTALLER=C:\Temp\rustdesk.msi"
-) else (
+echo Architecture : %ARCH% bits
+
+rem Version Windows
+for /f "tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion 2^>nul') do set "WINVER=%%a"
+rem Conversion de 6.1 en 61, 6.2 en 62, etc.
+for /f "tokens=1,2 delims=." %%a in ("%WINVER%") do set /a WINVER=%%a*10+%%b
+echo Version Windows : %WINVER%
+
+
+rem Windows 7 et anterieurs (seuil 61)
+if %WINVER% LEQ 61 (
+ echo Ancienne version de Windows detectee
set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe"
set "INSTALLER=C:\Temp\rustdesk.exe"
+
+ if "%ARCH%"=="64" (
+ set "INSTALL_DIR=C:\Program Files (x86)\RustDesk"
+ ) else (
+ set "INSTALL_DIR=C:\Program Files\RustDesk"
+ )
+) else (
+ echo Windows 8 ou superieur
+
+ if "%ARCH%"=="64" (
+ set "URL=https://remote.ordipolo.fr/client/rustdesk-x64.msi"
+ set "INSTALLER=C:\Temp\rustdesk.msi"
+ ) else (
+ set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe"
+ set "INSTALLER=C:\Temp\rustdesk.exe"
+ )
+ set "INSTALL_DIR=C:\Program Files\RustDesk"
)
-echo Architecture : %ARCH% bits
echo URL : %URL%
echo Installateur : %INSTALLER%
+echo Repertoire : %INSTALL_DIR%
if not exist "C:\Temp" mkdir "C:\Temp"
-if exist "C:\Program Files\RustDesk\rustdesk.exe" (
+if exist "%INSTALL_DIR%\rustdesk.exe" (
echo RustDesk est deja installe
- "C:\Program Files\RustDesk\rustdesk.exe" --config "%config%"
+ "%INSTALL_DIR%\rustdesk.exe" --config "%config%"
timeout /t 2 /nobreak >nul
- start "" "C:\Program Files\RustDesk\rustdesk.exe"
+ start "" "%INSTALL_DIR%\rustdesk.exe"
exit /b
)
@@ -49,10 +75,9 @@ if exist "C:\Program Files\RustDesk\rustdesk.exe" (
) else (
if not exist "%INSTALLER%" (
+ rem pas de curl dans windows 7, utiliser powershell (nécessite .NET framework 4.8)
echo Telechargement de RustDesk via PowerShell
- powershell -NoProfile -ExecutionPolicy Bypass -Command ^
- "$web_client = New-Object Net.WebClient; $web_client.DownloadFile('%URL%', '%INSTALLER%')" ^
- || exit /b 1
+ 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
) else (
echo RustDesk deja telecharge
)
@@ -60,7 +85,7 @@ if exist "C:\Program Files\RustDesk\rustdesk.exe" (
echo Installation de RustDesk
-if "%ARCH%"=="64" (
+if "%ARCH%"=="64" if %WINVER% GTR 61 (
msiexec /i "%INSTALLER%" /qn INSTALLPRINTER=N
goto INSTALL_OK
)
@@ -75,7 +100,7 @@ if errorlevel 1 (
rem parce que start "" /wait peut ne pas avoir le comportement attendu
set /a COUNT=0
:WAIT_INSTALL
-if exist "C:\Program Files\RustDesk\rustdesk.exe" (
+if exist "%INSTALL_DIR%\rustdesk.exe" (
echo installation terminee
goto INSTALL_OK
)
@@ -91,11 +116,11 @@ goto WAIT_INSTALL
echo Installation du service
-"C:\Program Files\RustDesk\rustdesk.exe" --install-service
+"%INSTALL_DIR%\rustdesk.exe" --install-service
timeout /t 3 /nobreak >nul
echo Application de la configuration
-"C:\Program Files\RustDesk\rustdesk.exe" --config "%config%"
+"%INSTALL_DIR%\rustdesk.exe" --config "%config%"
timeout /t 2 /nobreak >nul
-start "" "C:\Program Files\RustDesk\rustdesk.exe"
+start "" "%INSTALL_DIR%\rustdesk.exe"
diff --git a/template.php b/template.php
index 6283274..07a136b 100644
--- a/template.php
+++ b/template.php
@@ -30,6 +30,7 @@
Si une fenêtre surgit pour vous demander si vous souhaitez faire confiance à ce logiciel, répondez oui.
= $win_link ?>
= $win_uninstall ?>
+ Remarque: le .NET framework 4.8 est nécessaire sous windows 7