From 2e77a552dcccd05be5d7e03673ca7e5b80c97676 Mon Sep 17 00:00:00 2001 From: polo Date: Mon, 16 Nov 2026 13:44:19 +0100 Subject: =?UTF-8?q?nouveau=20d=C3=A9p=C3=B4t=20sans=20les=20clients,=20lan?= =?UTF-8?q?cer=20curl.php=20apr=C3=A8s=20clonage=20du=20d=C3=A9p=C3=B4t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/rustdesk-arch.sh | 15 ++++++ scripts/rustdesk-deb.sh | 35 +++++++++++++ scripts/rustdesk-uninstall.bat | 115 +++++++++++++++++++++++++++++++++++++++++ scripts/rustdesk.bat | 101 ++++++++++++++++++++++++++++++++++++ 4 files changed, 266 insertions(+) create mode 100755 scripts/rustdesk-arch.sh create mode 100755 scripts/rustdesk-deb.sh create mode 100755 scripts/rustdesk-uninstall.bat create mode 100644 scripts/rustdesk.bat (limited to 'scripts') diff --git a/scripts/rustdesk-arch.sh b/scripts/rustdesk-arch.sh new file mode 100755 index 0000000..b7446b5 --- /dev/null +++ b/scripts/rustdesk-arch.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# version archlinux + +url=https://remote.ordipolo.fr/client/rustdesk.tar.zst +file=/tmp/rustdesk.tar.zst +config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye + +if [ ! -f $file ]; then + wget -O $file $url || exit 1 +fi + +sudo pacman -U $file --noconfirm || exit 1 +sudo rustdesk --config $config || exit 1 + +rustdesk & diff --git a/scripts/rustdesk-deb.sh b/scripts/rustdesk-deb.sh new file mode 100755 index 0000000..0c03baa --- /dev/null +++ b/scripts/rustdesk-deb.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# version debian + +url=https://remote.ordipolo.fr/client/rustdesk.deb +file=/tmp/rustdesk.deb +config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye + + +if [ ! -f $file ]; then + wget -O $file $url || exit 1 +fi + + +new_version=$(dpkg-deb -f "$file" Version) +installed_version=$(dpkg-query -W -f='${Version}' rustdesk 2>/dev/null || true) +echo "Version installée : ${installed_version:-aucune}" +echo "Version disponible : $new_version" + +if [ -z "$installed_version" ]; then + echo "RustDesk n'est pas installé. Installation..." + sudo apt install -y "$file" +elif dpkg --compare-versions "$new_version" gt "$installed_version"; then + echo "Nouvelle version détectée. Mise à jour..." + sudo apt install -y "$file" +else + echo "RustDesk est déjà à jour." +fi + + +sudo rustdesk --config $config +mkdir -p ~/.config/rustdesk +sudo cp /root/.config/rustdesk/RustDesk2.toml "$HOME/.config/rustdesk/RustDesk2.toml" +sudo chown "$USER:$USER" "$HOME/.config/rustdesk/RustDesk2.toml" + +rustdesk & diff --git a/scripts/rustdesk-uninstall.bat b/scripts/rustdesk-uninstall.bat new file mode 100755 index 0000000..89e1584 --- /dev/null +++ b/scripts/rustdesk-uninstall.bat @@ -0,0 +1,115 @@ +@echo off +setlocal +title Desinstallation de RustDesk + +:: Verifier les droits administrateur et demander l'elevation si necessaire +net session >nul 2>&1 +if %errorlevel% neq 0 ( + echo Demande des droits administrateur... + powershell.exe -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs" + exit /b +) + +cls +echo ========================================== +echo DESINSTALLATION DE RUSTDESK +echo ========================================== +echo. +echo Nettoyage en cours... +echo Veuillez patienter. +echo. + +:: Executer le nettoyage avec PowerShell +powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='SilentlyContinue'; Write-Host '[1/5] Fermeture de RustDesk...'; Get-Process -Name 'rustdesk' | Stop-Process -Force; Start-Sleep -Seconds 2; Write-Host '[2/5] Arret du service...'; $svcs=Get-CimInstance Win32_Service | Where-Object { $_.Name -like '*RustDesk*' -or $_.DisplayName -like '*RustDesk*' }; foreach($s in $svcs) { Stop-Service -Name $s.Name -Force; sc.exe delete $s.Name | Out-Null }; Write-Host '[3/5] Desinstallation du logiciel...'; $keys=@('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*','HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'); $apps=Get-ItemProperty $keys | Where-Object { $_.DisplayName -like '*RustDesk*' }; foreach($app in $apps) { if($app.PSChildName -match '^\{[A-Fa-f0-9-]{36}\}$') { Start-Process msiexec.exe -ArgumentList ('/x ' + $app.PSChildName + ' /qn /norestart') -Wait } }; Start-Sleep -Seconds 3; Write-Host '[4/5] Suppression des fichiers et configurations...'; $paths=@('C:\Program Files\RustDesk','C:\Program Files (x86)\RustDesk','C:\ProgramData\RustDesk'); foreach($p in $paths) { if(Test-Path $p) { Remove-Item $p -Recurse -Force } }; $profiles=Get-CimInstance Win32_UserProfile | Where-Object { !$_.Special -and $_.LocalPath -like 'C:\Users\*' }; foreach($profile in $profiles) { foreach($folder in @('AppData\Roaming\RustDesk','AppData\Local\RustDesk')) { $p=Join-Path $profile.LocalPath $folder; if(Test-Path $p) { Remove-Item $p -Recurse -Force } } }; Write-Host '[5/5] Verification et nettoyage final...'; Get-Process -Name 'rustdesk' | Stop-Process -Force; Get-CimInstance Win32_Service | Where-Object { $_.Name -like '*RustDesk*' } | ForEach-Object { sc.exe delete $_.Name | Out-Null }; Write-Host ''; Write-Host 'Nettoyage termine.' -ForegroundColor Green" + +REM powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ^ +REM "& { + REM $ErrorActionPreference = 'SilentlyContinue' + + REM Write-Host '[1/5] Fermeture de RustDesk...' + REM Get-Process -Name 'rustdesk' | Stop-Process -Force + REM Start-Sleep -Seconds 2 + + REM Write-Host '[2/5] Arret du service...' + REM $svcs = Get-CimInstance Win32_Service | Where-Object { + REM $_.Name -like '*RustDesk*' -or $_.DisplayName -like '*RustDesk*' + REM } + + REM foreach ($s in $svcs) { + REM Stop-Service -Name $s.Name -Force + REM sc.exe delete $s.Name | Out-Null + REM } + + REM Write-Host '[3/5] Desinstallation du logiciel...' + REM $keys = @( + REM 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', + REM 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' + REM ) + + REM $apps = Get-ItemProperty $keys | Where-Object { + REM $_.DisplayName -like '*RustDesk*' + REM } + + REM foreach ($app in $apps) { + REM if ($app.PSChildName -match '^\{[A-Fa-f0-9-]{36}\}$') { + REM Start-Process msiexec.exe -ArgumentList ( + REM '/x ' + $app.PSChildName + ' /qn /norestart' + REM ) -Wait + REM } + REM } + + REM Start-Sleep -Seconds 3 + + REM Write-Host '[4/5] Suppression des fichiers et configurations...' + REM $paths = @( + REM 'C:\Program Files\RustDesk', + REM 'C:\Program Files (x86)\RustDesk', + REM 'C:\ProgramData\RustDesk' + REM ) + + REM foreach ($p in $paths) { + REM if (Test-Path $p) { + REM Remove-Item $p -Recurse -Force + REM } + REM } + + REM $profiles = Get-CimInstance Win32_UserProfile | Where-Object { + REM !$_.Special -and $_.LocalPath -like 'C:\Users\*' + REM } + + REM foreach ($profile in $profiles) { + REM foreach ($folder in @( + REM 'AppData\Roaming\RustDesk', + REM 'AppData\Local\RustDesk' + REM )) { + REM $p = Join-Path $profile.LocalPath $folder + REM if (Test-Path $p) { + REM Remove-Item $p -Recurse -Force + REM } + REM } + REM } + + REM Write-Host '[5/5] Verification et nettoyage final...' + REM Get-Process -Name 'rustdesk' | Stop-Process -Force + + REM Get-CimInstance Win32_Service | Where-Object { + REM $_.Name -like '*RustDesk*' + REM } | ForEach-Object { + REM sc.exe delete $_.Name | Out-Null + REM } + + REM Write-Host '' + REM Write-Host 'Nettoyage termine.' -ForegroundColor Green +REM }" + +echo. +echo ========================================== +echo OPERATION TERMINEE +echo ========================================== +echo. +echo RustDesk a ete desinstalle et ses fichiers +echo de configuration ont ete supprimes. +echo. +echo Vous pouvez fermer cette fenetre. +echo. +pause \ No newline at end of file diff --git a/scripts/rustdesk.bat b/scripts/rustdesk.bat new file mode 100644 index 0000000..708c18e --- /dev/null +++ b/scripts/rustdesk.bat @@ -0,0 +1,101 @@ +rem version windows + +@echo off +setlocal + +net session >nul 2>&1 +if %errorlevel% neq 0 ( + echo les droits administrateur sont necessaires + powershell -Command "Start-Process '%~f0' -Verb RunAs" + exit /b +) + +set config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye + +if defined PROCESSOR_ARCHITEW6432 ( + set "ARCH=64" +) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( + set "ARCH=64" +) else ( + set "ARCH=32" +) +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" +) +echo Architecture : %ARCH% bits +echo URL : %URL% +echo Installateur : %INSTALLER% + +if not exist "C:\Temp" mkdir "C:\Temp" + +if exist "C:\Program Files\RustDesk\rustdesk.exe" ( + echo RustDesk est deja installe + "C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" + timeout /t 2 /nobreak >nul + start "" "C:\Program Files\RustDesk\rustdesk.exe" + exit /b +) + + +@where curl.exe >nul 2>&1 + +@if %errorlevel%==0 ( + echo Telechargement de RustDesk via cURL + curl.exe -fL -z "%INSTALLER%" -o "%INSTALLER%" "%URL%" || exit /b 1 + +) else ( + if not exist "%INSTALLER%" ( + 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 + ) else ( + echo RustDesk deja telecharge + ) +) + + +echo Installation de RustDesk +if "%ARCH%"=="64" ( + msiexec /i "%INSTALLER%" /qn INSTALLPRINTER=N + goto INSTALL_OK +) + +rem évite de mettre :WAIT_INSTALL dans un bloc if, else, etc +start "" /wait "%INSTALLER%" --silent-install +if errorlevel 1 ( + echo "erreur de l'installation de RustDesk" + exit /b 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" ( + echo installation terminee + goto INSTALL_OK +) +set /a COUNT+=1 +if %COUNT% GEQ 60 ( + echo erreur installation non reussie apres 60s + exit /b 1 +) +timeout /t 1 /nobreak >nul +goto WAIT_INSTALL + +:INSTALL_OK + + +echo Installation du service +"C:\Program Files\RustDesk\rustdesk.exe" --install-service +timeout /t 3 /nobreak >nul + +echo Application de la configuration +"C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" +timeout /t 2 /nobreak >nul + +start "" "C:\Program Files\RustDesk\rustdesk.exe" -- cgit v1.2.3