diff options
| author | polo <ordipolo@gmx.fr> | 2026-11-16 13:44:19 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-11-16 13:44:19 +0100 |
| commit | 2e77a552dcccd05be5d7e03673ca7e5b80c97676 (patch) | |
| tree | 954a3532fece0b8b107ce451d6f03d81beaf5319 | |
| download | rustdesk-scripts-2e77a552dcccd05be5d7e03673ca7e5b80c97676.tar.gz rustdesk-scripts-2e77a552dcccd05be5d7e03673ca7e5b80c97676.tar.bz2 rustdesk-scripts-2e77a552dcccd05be5d7e03673ca7e5b80c97676.zip | |
nouveau dépôt sans les clients, lancer curl.php après clonage du dépôt
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | assets/favicon.png | bin | 0 -> 928 bytes | |||
| -rw-r--r-- | assets/logo.png | bin | 0 -> 81428 bytes | |||
| -rw-r--r-- | assets/ordipolo.png | bin | 0 -> 57420 bytes | |||
| -rwxr-xr-x | curl.php | 82 | ||||
| -rw-r--r-- | download.php | 10 | ||||
| -rw-r--r-- | index.php | 21 | ||||
| -rw-r--r-- | main.css | 221 | ||||
| -rw-r--r-- | matomo.php | 10 | ||||
| -rw-r--r-- | rustdesk.txt | 4 | ||||
| -rwxr-xr-x | scripts/rustdesk-arch.sh | 15 | ||||
| -rwxr-xr-x | scripts/rustdesk-deb.sh | 35 | ||||
| -rwxr-xr-x | scripts/rustdesk-uninstall.bat | 115 | ||||
| -rw-r--r-- | scripts/rustdesk.bat | 101 | ||||
| -rw-r--r-- | template.php | 48 |
15 files changed, 663 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ecafd24 --- /dev/null +++ b/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| client/ | |||
diff --git a/assets/favicon.png b/assets/favicon.png new file mode 100644 index 0000000..09300a5 --- /dev/null +++ b/assets/favicon.png | |||
| Binary files differ | |||
diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..2976a9c --- /dev/null +++ b/assets/logo.png | |||
| Binary files differ | |||
diff --git a/assets/ordipolo.png b/assets/ordipolo.png new file mode 100644 index 0000000..03cdd07 --- /dev/null +++ b/assets/ordipolo.png | |||
| Binary files differ | |||
diff --git a/curl.php b/curl.php new file mode 100755 index 0000000..10337d6 --- /dev/null +++ b/curl.php | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | #!/bin/php | ||
| 2 | <?php | ||
| 3 | // téléchargement et mise à jour des clients téléchargés par les scripts | ||
| 4 | |||
| 5 | declare(strict_types=1); | ||
| 6 | |||
| 7 | if(!file_exists('client')){ | ||
| 8 | mkdir('client'); // le serveur n'obtient pas le droit d'écriture (pas besoin) | ||
| 9 | } | ||
| 10 | |||
| 11 | // récupérer la version du client | ||
| 12 | $curl = curl_init('https://github.com/rustdesk/rustdesk/releases/latest'); | ||
| 13 | if(!$curl){ // lien non valide | ||
| 14 | echo "Erreur : Impossible d'initialiser cURL.\n"; | ||
| 15 | return; | ||
| 16 | } | ||
| 17 | |||
| 18 | curl_setopt($curl, CURLOPT_NOBODY, true); // option -I de curl, envoie une requête HEAD, le serveur la traite comme un GET mais ne renvoie pas de contenu | ||
| 19 | |||
| 20 | curl_exec($curl); | ||
| 21 | $link = curl_getinfo($curl, CURLINFO_REDIRECT_URL); | ||
| 22 | $version = basename(parse_url($link, PHP_URL_PATH)); | ||
| 23 | echo $link . "\n"; // https://github.com/rustdesk/rustdesk/releases/tag/1.4.9 | ||
| 24 | |||
| 25 | curl_close($curl); | ||
| 26 | $curl = null; | ||
| 27 | |||
| 28 | |||
| 29 | // téléchargement | ||
| 30 | $web_packages = [ | ||
| 31 | 'win64' => 'rustdesk-' . $version . '-x86_64.msi', | ||
| 32 | 'win32' => 'rustdesk-' . $version . '-x86-sciter.exe', | ||
| 33 | 'deb' => 'rustdesk-' . $version . '-x86_64.deb', | ||
| 34 | 'arch' => 'rustdesk-' . $version . '-0-x86_64.pkg.tar.zst']; | ||
| 35 | $renamed_packages = [ | ||
| 36 | 'win64' => 'rustdesk-x64.msi', | ||
| 37 | 'win32' => 'rustdesk-x86.exe', | ||
| 38 | 'deb' => 'rustdesk.deb', | ||
| 39 | 'arch' => 'rustdesk.tar.zst']; | ||
| 40 | |||
| 41 | $path = 'client/'; | ||
| 42 | if(!is_dir($path)){ | ||
| 43 | mkdir($path, 0755, true); | ||
| 44 | } | ||
| 45 | |||
| 46 | foreach(array_keys($renamed_packages) as $os){ | ||
| 47 | $link = "https://github.com/rustdesk/rustdesk/releases/download/" . $version . "/" . $web_packages[$os]; | ||
| 48 | echo $link . "\n"; | ||
| 49 | |||
| 50 | $curl = curl_init($link); | ||
| 51 | if(!$curl){ // lien non valide | ||
| 52 | echo "Erreur : Impossible d'initialiser cURL.\n"; | ||
| 53 | return; | ||
| 54 | } | ||
| 55 | |||
| 56 | $file = fopen($path . '/' . $renamed_packages[$os], 'w'); // écriture seule | ||
| 57 | if(!$file){ | ||
| 58 | echo "Erreur : Impossible d'ouvrir le fichier" . $path . '/' . $renamed_packages[$os] . "pour l'écriture.\n"; | ||
| 59 | echo "Détails de l'erreur : " . error_get_last()['message'] . "\n"; | ||
| 60 | return; | ||
| 61 | } | ||
| 62 | |||
| 63 | curl_setopt($curl, CURLOPT_FILE, $file); // option -o, sortie dans un fichier au lieu de la console | ||
| 64 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); // option -L, "location" | ||
| 65 | |||
| 66 | $response = curl_exec($curl); | ||
| 67 | if(!$response){ | ||
| 68 | echo "Erreur : Le téléchargement a échoué. cURL Error: " . curl_error($curl) . "\n"; | ||
| 69 | } | ||
| 70 | else{ | ||
| 71 | $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); | ||
| 72 | if($http_code >= 400){ | ||
| 73 | echo "Erreur HTTP : " . $http_code . "\n"; | ||
| 74 | } | ||
| 75 | else{ | ||
| 76 | echo "Téléchargement réussi.\n"; | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | fclose($file); | ||
| 81 | curl_close($curl); | ||
| 82 | } | ||
diff --git a/download.php b/download.php new file mode 100644 index 0000000..94ec6fd --- /dev/null +++ b/download.php | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <?php | ||
| 2 | $file_names = ['win' => 'rustdesk.bat', 'win_uninstall' => 'rustdesk-uninstall.bat', 'deb' => 'rustdesk.sh', 'arch' => 'rustdesk.sh']; | ||
| 3 | $scripts = ['win' => 'scripts/rustdesk.bat', 'win_uninstall' => 'scripts/rustdesk-uninstall.bat', 'deb' => 'scripts/rustdesk-deb.sh', 'arch' => 'scripts/rustdesk-arch.sh']; | ||
| 4 | |||
| 5 | header("Content-Type: application/octet-stream"); | ||
| 6 | header('Content-Disposition: attachment; filename="' . $file_names[$_GET['os']] . '"'); | ||
| 7 | header('Content-Length: ' . filesize($scripts[$_GET['os']])); | ||
| 8 | |||
| 9 | readfile($scripts[$_GET['os']]); | ||
| 10 | exit; | ||
diff --git a/index.php b/index.php new file mode 100644 index 0000000..1b9e811 --- /dev/null +++ b/index.php | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?php | ||
| 2 | $os = [ | ||
| 3 | 'win' => 'Windows', | ||
| 4 | 'linux' => [ | ||
| 5 | 'deb' => 'Debian, Ubuntu, Linux Mint', | ||
| 6 | 'arch' => 'Archlinux, Manjaro' | ||
| 7 | ] | ||
| 8 | ]; | ||
| 9 | |||
| 10 | $win_link = '<a href="download.php?os=win">Installateur</a>'; | ||
| 11 | $win_uninstall = '<a href="download.php?os=win_uninstall">Désinstallateur</a>'; | ||
| 12 | |||
| 13 | $lin_links = ''; | ||
| 14 | foreach($os['linux'] as $key => $value){ | ||
| 15 | $lin_links .= '<p><a href="download.php?os=' . $key . '">' . $value . '</a></p>'; | ||
| 16 | } | ||
| 17 | |||
| 18 | // pour matomo | ||
| 19 | $domain = 'remote.ordipolo.fr'; | ||
| 20 | |||
| 21 | require 'template.php'; | ||
diff --git a/main.css b/main.css new file mode 100644 index 0000000..d9d7328 --- /dev/null +++ b/main.css | |||
| @@ -0,0 +1,221 @@ | |||
| 1 | body | ||
| 2 | { | ||
| 3 | font-size: 100%; | ||
| 4 | font-family: sans; | ||
| 5 | /* pour enlever la bande de la couleur du fond en haut et en bas de la page */ | ||
| 6 | margin: 0; | ||
| 7 | background-color: #F0EC41; | ||
| 8 | } | ||
| 9 | |||
| 10 | #bloc_page | ||
| 11 | { | ||
| 12 | max-width: 1200px; | ||
| 13 | /* la largeur max indiquée sert à réduire la variété des largeurs d'écran à prendre en compte */ | ||
| 14 | margin: auto; | ||
| 15 | padding: 0 20px 30px 20px; | ||
| 16 | background-color: white; | ||
| 17 | } | ||
| 18 | |||
| 19 | h1 | ||
| 20 | { | ||
| 21 | font-weight: normal; | ||
| 22 | display: inline-block; | ||
| 23 | margin: 5px; | ||
| 24 | border: 2px #008100 solid; | ||
| 25 | border-radius: 12px; | ||
| 26 | padding: 3px; | ||
| 27 | background-color: #F4F02D; | ||
| 28 | font-size: 120%; | ||
| 29 | } | ||
| 30 | |||
| 31 | p | ||
| 32 | { | ||
| 33 | margin: 10px; | ||
| 34 | } | ||
| 35 | |||
| 36 | a | ||
| 37 | { | ||
| 38 | color: black; | ||
| 39 | /* les liens déjà cliqués restent noirs */ | ||
| 40 | } | ||
| 41 | |||
| 42 | a:hover /* liens survolés par la souris */ | ||
| 43 | { | ||
| 44 | color: #004F00; | ||
| 45 | } | ||
| 46 | |||
| 47 | a:hover | ||
| 48 | { | ||
| 49 | font-weight: bold; | ||
| 50 | } | ||
| 51 | |||
| 52 | /* En-tête. */ | ||
| 53 | header | ||
| 54 | { | ||
| 55 | background-color: white; | ||
| 56 | display: flex; | ||
| 57 | flex-direction: column; | ||
| 58 | align-items: center; | ||
| 59 | margin-bottom: 20px; | ||
| 60 | } | ||
| 61 | |||
| 62 | header div, header p | ||
| 63 | { | ||
| 64 | margin-top: 5px; | ||
| 65 | } | ||
| 66 | |||
| 67 | #logohaut | ||
| 68 | { | ||
| 69 | width: 200px; | ||
| 70 | |||
| 71 | /* cacher petit logo */ | ||
| 72 | display: none; | ||
| 73 | } | ||
| 74 | |||
| 75 | #logotitre | ||
| 76 | { | ||
| 77 | height: 90px; | ||
| 78 | } | ||
| 79 | |||
| 80 | /* Menu de navigation. */ | ||
| 81 | nav | ||
| 82 | { | ||
| 83 | position: fixed; | ||
| 84 | z-index: 2; /* pour être dessus des prestations */ | ||
| 85 | text-align: center; | ||
| 86 | } | ||
| 87 | |||
| 88 | nav a | ||
| 89 | { | ||
| 90 | display: inline-block; /* menu horizontal */ | ||
| 91 | border: 2px #008100 solid; | ||
| 92 | border-radius: 12px; | ||
| 93 | padding: 3px; | ||
| 94 | margin: 2px; | ||
| 95 | background-color: #F4F02D; | ||
| 96 | font-size: 110%; | ||
| 97 | text-decoration: none; | ||
| 98 | } | ||
| 99 | |||
| 100 | /* "vous êtes ici" */ | ||
| 101 | #actuelle | ||
| 102 | { | ||
| 103 | color: #004F00; | ||
| 104 | border: 3px #004F00 solid; | ||
| 105 | } | ||
| 106 | |||
| 107 | /* Corps de page. */ | ||
| 108 | article | ||
| 109 | { | ||
| 110 | margin-left: 20px; | ||
| 111 | } | ||
| 112 | |||
| 113 | .photo | ||
| 114 | { | ||
| 115 | border: 2px #008100 solid; | ||
| 116 | border-radius: 10px; | ||
| 117 | } | ||
| 118 | |||
| 119 | h3 | ||
| 120 | { | ||
| 121 | margin: 10px; | ||
| 122 | border: 2px #008100 solid; | ||
| 123 | border-radius: 12px; | ||
| 124 | padding: 3px; | ||
| 125 | text-align: center; | ||
| 126 | font-size: 100%; | ||
| 127 | background-color: white; | ||
| 128 | } | ||
| 129 | |||
| 130 | h3 a | ||
| 131 | { | ||
| 132 | text-decoration: none; | ||
| 133 | } | ||
| 134 | |||
| 135 | |||
| 136 | caption span | ||
| 137 | { | ||
| 138 | font-size: 110%; | ||
| 139 | text-decoration: underline; | ||
| 140 | } | ||
| 141 | |||
| 142 | caption i | ||
| 143 | { | ||
| 144 | font-size: 90%; | ||
| 145 | } | ||
| 146 | |||
| 147 | pre | ||
| 148 | { | ||
| 149 | font-family: sans-serif; | ||
| 150 | font-size: 90%; | ||
| 151 | white-space: pre-wrap; | ||
| 152 | margin: 0 10px 10px 10px; | ||
| 153 | padding: 4px; | ||
| 154 | background-color: #f0f0f0; | ||
| 155 | } | ||
| 156 | |||
| 157 | a img | ||
| 158 | { | ||
| 159 | border: none; | ||
| 160 | /* retire la bordure bleue sur certains navigateurs */ | ||
| 161 | } | ||
| 162 | |||
| 163 | /* lien fixe en bas */ | ||
| 164 | footer | ||
| 165 | { | ||
| 166 | display: flex; | ||
| 167 | flex-direction: column; | ||
| 168 | align-items: center; | ||
| 169 | } | ||
| 170 | |||
| 171 | footer h1 | ||
| 172 | { | ||
| 173 | position: fixed; | ||
| 174 | bottom: 0; | ||
| 175 | margin: 2px; /* de 5 par défaut */ | ||
| 176 | text-align: center; | ||
| 177 | } | ||
| 178 | footer a | ||
| 179 | { | ||
| 180 | text-decoration: none; | ||
| 181 | } | ||
| 182 | |||
| 183 | /* design responsive */ | ||
| 184 | @media screen and (max-width: 710px) | ||
| 185 | { | ||
| 186 | nav a | ||
| 187 | { | ||
| 188 | font-size: 100%; | ||
| 189 | } | ||
| 190 | |||
| 191 | h1 | ||
| 192 | { | ||
| 193 | font-size: 110%; | ||
| 194 | } | ||
| 195 | |||
| 196 | textarea | ||
| 197 | { | ||
| 198 | width: 400px; | ||
| 199 | height: 150px; | ||
| 200 | } | ||
| 201 | } | ||
| 202 | |||
| 203 | @media screen and (max-width: 500px) | ||
| 204 | { | ||
| 205 | #logohaut | ||
| 206 | { | ||
| 207 | /* afficher petit logo */ | ||
| 208 | display: inline; | ||
| 209 | } | ||
| 210 | #logotitre | ||
| 211 | { | ||
| 212 | /* cacher grand logo */ | ||
| 213 | display: none; | ||
| 214 | } | ||
| 215 | |||
| 216 | textarea | ||
| 217 | { | ||
| 218 | width: 270px; | ||
| 219 | height: 100px; | ||
| 220 | } | ||
| 221 | } | ||
diff --git a/matomo.php b/matomo.php new file mode 100644 index 0000000..5142cbe --- /dev/null +++ b/matomo.php | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <!-- Matomo Tag Manager --> | ||
| 2 | <script> | ||
| 3 | var _mtm = window._mtm = window._mtm || []; | ||
| 4 | _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); | ||
| 5 | (function() { | ||
| 6 | var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; | ||
| 7 | g.async=true; g.src='https://<?= $domain ?>/js/container_Vp5U4APR.js'; s.parentNode.insertBefore(g,s); | ||
| 8 | })(); | ||
| 9 | </script> | ||
| 10 | <noscript><p><img referrerpolicy="no-referrer-when-downgrade" src="//<?= $domain ?>/matomo.php?idsite=1&rec=1" style="border:0;" alt="" /></p></noscript> | ||
diff --git a/rustdesk.txt b/rustdesk.txt new file mode 100644 index 0000000..06b2a1b --- /dev/null +++ b/rustdesk.txt | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | remote.ordipolo.fr | ||
| 2 | R7CHxukdXNeeuV0A5r9n6lDVoIFTvdc050JFtucO7UM= | ||
| 3 | |||
| 4 | rustdesk.msi --config 9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye | ||
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 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # version archlinux | ||
| 3 | |||
| 4 | url=https://remote.ordipolo.fr/client/rustdesk.tar.zst | ||
| 5 | file=/tmp/rustdesk.tar.zst | ||
| 6 | config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye | ||
| 7 | |||
| 8 | if [ ! -f $file ]; then | ||
| 9 | wget -O $file $url || exit 1 | ||
| 10 | fi | ||
| 11 | |||
| 12 | sudo pacman -U $file --noconfirm || exit 1 | ||
| 13 | sudo rustdesk --config $config || exit 1 | ||
| 14 | |||
| 15 | 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 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # version debian | ||
| 3 | |||
| 4 | url=https://remote.ordipolo.fr/client/rustdesk.deb | ||
| 5 | file=/tmp/rustdesk.deb | ||
| 6 | config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye | ||
| 7 | |||
| 8 | |||
| 9 | if [ ! -f $file ]; then | ||
| 10 | wget -O $file $url || exit 1 | ||
| 11 | fi | ||
| 12 | |||
| 13 | |||
| 14 | new_version=$(dpkg-deb -f "$file" Version) | ||
| 15 | installed_version=$(dpkg-query -W -f='${Version}' rustdesk 2>/dev/null || true) | ||
| 16 | echo "Version installée : ${installed_version:-aucune}" | ||
| 17 | echo "Version disponible : $new_version" | ||
| 18 | |||
| 19 | if [ -z "$installed_version" ]; then | ||
| 20 | echo "RustDesk n'est pas installé. Installation..." | ||
| 21 | sudo apt install -y "$file" | ||
| 22 | elif dpkg --compare-versions "$new_version" gt "$installed_version"; then | ||
| 23 | echo "Nouvelle version détectée. Mise à jour..." | ||
| 24 | sudo apt install -y "$file" | ||
| 25 | else | ||
| 26 | echo "RustDesk est déjà à jour." | ||
| 27 | fi | ||
| 28 | |||
| 29 | |||
| 30 | sudo rustdesk --config $config | ||
| 31 | mkdir -p ~/.config/rustdesk | ||
| 32 | sudo cp /root/.config/rustdesk/RustDesk2.toml "$HOME/.config/rustdesk/RustDesk2.toml" | ||
| 33 | sudo chown "$USER:$USER" "$HOME/.config/rustdesk/RustDesk2.toml" | ||
| 34 | |||
| 35 | 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 @@ | |||
| 1 | @echo off | ||
| 2 | setlocal | ||
| 3 | title Desinstallation de RustDesk | ||
| 4 | |||
| 5 | :: Verifier les droits administrateur et demander l'elevation si necessaire | ||
| 6 | net session >nul 2>&1 | ||
| 7 | if %errorlevel% neq 0 ( | ||
| 8 | echo Demande des droits administrateur... | ||
| 9 | powershell.exe -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs" | ||
| 10 | exit /b | ||
| 11 | ) | ||
| 12 | |||
| 13 | cls | ||
| 14 | echo ========================================== | ||
| 15 | echo DESINSTALLATION DE RUSTDESK | ||
| 16 | echo ========================================== | ||
| 17 | echo. | ||
| 18 | echo Nettoyage en cours... | ||
| 19 | echo Veuillez patienter. | ||
| 20 | echo. | ||
| 21 | |||
| 22 | :: Executer le nettoyage avec PowerShell | ||
| 23 | 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" | ||
| 24 | |||
| 25 | REM powershell.exe -NoProfile -ExecutionPolicy Bypass -Command ^ | ||
| 26 | REM "& { | ||
| 27 | REM $ErrorActionPreference = 'SilentlyContinue' | ||
| 28 | |||
| 29 | REM Write-Host '[1/5] Fermeture de RustDesk...' | ||
| 30 | REM Get-Process -Name 'rustdesk' | Stop-Process -Force | ||
| 31 | REM Start-Sleep -Seconds 2 | ||
| 32 | |||
| 33 | REM Write-Host '[2/5] Arret du service...' | ||
| 34 | REM $svcs = Get-CimInstance Win32_Service | Where-Object { | ||
| 35 | REM $_.Name -like '*RustDesk*' -or $_.DisplayName -like '*RustDesk*' | ||
| 36 | REM } | ||
| 37 | |||
| 38 | REM foreach ($s in $svcs) { | ||
| 39 | REM Stop-Service -Name $s.Name -Force | ||
| 40 | REM sc.exe delete $s.Name | Out-Null | ||
| 41 | REM } | ||
| 42 | |||
| 43 | REM Write-Host '[3/5] Desinstallation du logiciel...' | ||
| 44 | REM $keys = @( | ||
| 45 | REM 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*', | ||
| 46 | REM 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | ||
| 47 | REM ) | ||
| 48 | |||
| 49 | REM $apps = Get-ItemProperty $keys | Where-Object { | ||
| 50 | REM $_.DisplayName -like '*RustDesk*' | ||
| 51 | REM } | ||
| 52 | |||
| 53 | REM foreach ($app in $apps) { | ||
| 54 | REM if ($app.PSChildName -match '^\{[A-Fa-f0-9-]{36}\}$') { | ||
| 55 | REM Start-Process msiexec.exe -ArgumentList ( | ||
| 56 | REM '/x ' + $app.PSChildName + ' /qn /norestart' | ||
| 57 | REM ) -Wait | ||
| 58 | REM } | ||
| 59 | REM } | ||
| 60 | |||
| 61 | REM Start-Sleep -Seconds 3 | ||
| 62 | |||
| 63 | REM Write-Host '[4/5] Suppression des fichiers et configurations...' | ||
| 64 | REM $paths = @( | ||
| 65 | REM 'C:\Program Files\RustDesk', | ||
| 66 | REM 'C:\Program Files (x86)\RustDesk', | ||
| 67 | REM 'C:\ProgramData\RustDesk' | ||
| 68 | REM ) | ||
| 69 | |||
| 70 | REM foreach ($p in $paths) { | ||
| 71 | REM if (Test-Path $p) { | ||
| 72 | REM Remove-Item $p -Recurse -Force | ||
| 73 | REM } | ||
| 74 | REM } | ||
| 75 | |||
| 76 | REM $profiles = Get-CimInstance Win32_UserProfile | Where-Object { | ||
| 77 | REM !$_.Special -and $_.LocalPath -like 'C:\Users\*' | ||
| 78 | REM } | ||
| 79 | |||
| 80 | REM foreach ($profile in $profiles) { | ||
| 81 | REM foreach ($folder in @( | ||
| 82 | REM 'AppData\Roaming\RustDesk', | ||
| 83 | REM 'AppData\Local\RustDesk' | ||
| 84 | REM )) { | ||
| 85 | REM $p = Join-Path $profile.LocalPath $folder | ||
| 86 | REM if (Test-Path $p) { | ||
| 87 | REM Remove-Item $p -Recurse -Force | ||
| 88 | REM } | ||
| 89 | REM } | ||
| 90 | REM } | ||
| 91 | |||
| 92 | REM Write-Host '[5/5] Verification et nettoyage final...' | ||
| 93 | REM Get-Process -Name 'rustdesk' | Stop-Process -Force | ||
| 94 | |||
| 95 | REM Get-CimInstance Win32_Service | Where-Object { | ||
| 96 | REM $_.Name -like '*RustDesk*' | ||
| 97 | REM } | ForEach-Object { | ||
| 98 | REM sc.exe delete $_.Name | Out-Null | ||
| 99 | REM } | ||
| 100 | |||
| 101 | REM Write-Host '' | ||
| 102 | REM Write-Host 'Nettoyage termine.' -ForegroundColor Green | ||
| 103 | REM }" | ||
| 104 | |||
| 105 | echo. | ||
| 106 | echo ========================================== | ||
| 107 | echo OPERATION TERMINEE | ||
| 108 | echo ========================================== | ||
| 109 | echo. | ||
| 110 | echo RustDesk a ete desinstalle et ses fichiers | ||
| 111 | echo de configuration ont ete supprimes. | ||
| 112 | echo. | ||
| 113 | echo Vous pouvez fermer cette fenetre. | ||
| 114 | echo. | ||
| 115 | 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 @@ | |||
| 1 | rem version windows | ||
| 2 | |||
| 3 | @echo off | ||
| 4 | setlocal | ||
| 5 | |||
| 6 | net session >nul 2>&1 | ||
| 7 | if %errorlevel% neq 0 ( | ||
| 8 | echo les droits administrateur sont necessaires | ||
| 9 | powershell -Command "Start-Process '%~f0' -Verb RunAs" | ||
| 10 | exit /b | ||
| 11 | ) | ||
| 12 | |||
| 13 | set config=9JSPNV1NPNWd0ZkSwUDMjRmdUZUSvZFRsZjb5IXNBBjV1VWZOhFZrVHeIN0NSJiOikXZrJCLiIiOikGchJCLiInZu8GbvBXakJ3buUGdv1WZyJiOikXYsVmciwiIyZmLvx2bwlGZy9mLlR3btVmciojI0N3boJye | ||
| 14 | |||
| 15 | if defined PROCESSOR_ARCHITEW6432 ( | ||
| 16 | set "ARCH=64" | ||
| 17 | ) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( | ||
| 18 | set "ARCH=64" | ||
| 19 | ) else ( | ||
| 20 | set "ARCH=32" | ||
| 21 | ) | ||
| 22 | if "%ARCH%"=="64" ( | ||
| 23 | set "URL=https://remote.ordipolo.fr/client/rustdesk-x64.msi" | ||
| 24 | set "INSTALLER=C:\Temp\rustdesk.msi" | ||
| 25 | ) else ( | ||
| 26 | set "URL=https://remote.ordipolo.fr/client/rustdesk-x86.exe" | ||
| 27 | set "INSTALLER=C:\Temp\rustdesk.exe" | ||
| 28 | ) | ||
| 29 | echo Architecture : %ARCH% bits | ||
| 30 | echo URL : %URL% | ||
| 31 | echo Installateur : %INSTALLER% | ||
| 32 | |||
| 33 | if not exist "C:\Temp" mkdir "C:\Temp" | ||
| 34 | |||
| 35 | if exist "C:\Program Files\RustDesk\rustdesk.exe" ( | ||
| 36 | echo RustDesk est deja installe | ||
| 37 | "C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" | ||
| 38 | timeout /t 2 /nobreak >nul | ||
| 39 | start "" "C:\Program Files\RustDesk\rustdesk.exe" | ||
| 40 | exit /b | ||
| 41 | ) | ||
| 42 | |||
| 43 | |||
| 44 | @where curl.exe >nul 2>&1 | ||
| 45 | |||
| 46 | @if %errorlevel%==0 ( | ||
| 47 | echo Telechargement de RustDesk via cURL | ||
| 48 | curl.exe -fL -z "%INSTALLER%" -o "%INSTALLER%" "%URL%" || exit /b 1 | ||
| 49 | |||
| 50 | ) else ( | ||
| 51 | if not exist "%INSTALLER%" ( | ||
| 52 | echo Telechargement de RustDesk via PowerShell | ||
| 53 | powershell -NoProfile -ExecutionPolicy Bypass -Command ^ | ||
| 54 | "$web_client = New-Object Net.WebClient; $web_client.DownloadFile('%URL%', '%INSTALLER%')" ^ | ||
| 55 | || exit /b 1 | ||
| 56 | ) else ( | ||
| 57 | echo RustDesk deja telecharge | ||
| 58 | ) | ||
| 59 | ) | ||
| 60 | |||
| 61 | |||
| 62 | echo Installation de RustDesk | ||
| 63 | if "%ARCH%"=="64" ( | ||
| 64 | msiexec /i "%INSTALLER%" /qn INSTALLPRINTER=N | ||
| 65 | goto INSTALL_OK | ||
| 66 | ) | ||
| 67 | |||
| 68 | rem évite de mettre :WAIT_INSTALL dans un bloc if, else, etc | ||
| 69 | start "" /wait "%INSTALLER%" --silent-install | ||
| 70 | if errorlevel 1 ( | ||
| 71 | echo "erreur de l'installation de RustDesk" | ||
| 72 | exit /b 1 | ||
| 73 | ) | ||
| 74 | |||
| 75 | rem parce que start "" /wait peut ne pas avoir le comportement attendu | ||
| 76 | set /a COUNT=0 | ||
| 77 | :WAIT_INSTALL | ||
| 78 | if exist "C:\Program Files\RustDesk\rustdesk.exe" ( | ||
| 79 | echo installation terminee | ||
| 80 | goto INSTALL_OK | ||
| 81 | ) | ||
| 82 | set /a COUNT+=1 | ||
| 83 | if %COUNT% GEQ 60 ( | ||
| 84 | echo erreur installation non reussie apres 60s | ||
| 85 | exit /b 1 | ||
| 86 | ) | ||
| 87 | timeout /t 1 /nobreak >nul | ||
| 88 | goto WAIT_INSTALL | ||
| 89 | |||
| 90 | :INSTALL_OK | ||
| 91 | |||
| 92 | |||
| 93 | echo Installation du service | ||
| 94 | "C:\Program Files\RustDesk\rustdesk.exe" --install-service | ||
| 95 | timeout /t 3 /nobreak >nul | ||
| 96 | |||
| 97 | echo Application de la configuration | ||
| 98 | "C:\Program Files\RustDesk\rustdesk.exe" --config "%config%" | ||
| 99 | timeout /t 2 /nobreak >nul | ||
| 100 | |||
| 101 | start "" "C:\Program Files\RustDesk\rustdesk.exe" | ||
diff --git a/template.php b/template.php new file mode 100644 index 0000000..6283274 --- /dev/null +++ b/template.php | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang="fr"> | ||
| 3 | <head> | ||
| 4 | <meta charset="utf-8"> | ||
| 5 | <title>ORDIPOLO rustdesk scripts</title> | ||
| 6 | <link rel="icon" type="image/png" href="assets/favicon.png"> | ||
| 7 | <link rel="stylesheet" href="main.css"> | ||
| 8 | <meta name="viewport" content="width=device-width"> | ||
| 9 | <?php include("matomo.php"); ?> | ||
| 10 | </head> | ||
| 11 | <body> | ||
| 12 | <div id="bloc_page"> | ||
| 13 | <header> | ||
| 14 | <div> | ||
| 15 | <img id="logohaut" src="assets/logo.png" alt="ordipolo dépannage informatique Quimper"> | ||
| 16 | <img id="logotitre" src="assets/ordipolo.png" alt="ordipolo dépannage informatique Quimper"> | ||
| 17 | </div> | ||
| 18 | </header> | ||
| 19 | |||
| 20 | <section> | ||
| 21 | <h1>Scripts d'installation du logiciel Rustdesk</h1> | ||
| 22 | <p>Rustdesk permet de donner au dépanneur le contrôle à distance de votre ordinateur. Il vous faut télécharger un petit installateur et l'exécuter.</p> | ||
| 23 | <p style="color: red;">Attention, si vous ne connaissez pas votre interlocuteur au téléphone, ne faîtes rien et raccrochez!</p> | ||
| 24 | <p>Une fois la réparation terminée, exécutez le script de désinstallation pour "refermer la porte".</p> | ||
| 25 | </section> | ||
| 26 | |||
| 27 | <section> | ||
| 28 | <h1>Windows</h1> | ||
| 29 | <p>Ce script doit être exécuté en tant qu'administrateur.<br> | ||
| 30 | Si une fenêtre surgit pour vous demander si vous souhaitez faire confiance à ce logiciel, répondez oui.</p> | ||
| 31 | <p><?= $win_link ?></p> | ||
| 32 | <p><?= $win_uninstall ?></p> | ||
| 33 | </section> | ||
| 34 | <section> | ||
| 35 | <h1>Linux</h1> | ||
| 36 | <p>Vous devez rendre ce script exécutable, vous pouvez le faire en copiant ces commandes dans le terminal.<br>La dernière commande implique de saisir le mot de passe du système "à l'aveugle" puis de valider avec la touche Entrée.</p> | ||
| 37 | <pre><code># Se déplacer dans le dossier des téléchargements | ||
| 38 | cd ~/Téléchargements | ||
| 39 | # Rendre le script exécutable | ||
| 40 | chmod +x rustdesk.sh | ||
| 41 | # L'exécuter | ||
| 42 | sudo ./rustdesk.sh</code></pre> | ||
| 43 | <p>Téléchargements:</p> | ||
| 44 | <?= $lin_links ?> | ||
| 45 | </section> | ||
| 46 | </div> | ||
| 47 | </body> | ||
| 48 | </html> | ||
