> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/rdm/fr/knowledge-base/how-to-articles/use-the-custom-installer-in-unattended-setups.md).

# Utiliser l'installateur personnalisé dans les installations sans surveillance

Générez un paquet d'installation personnalisé de Remote Desktop Manager et déployez-le silencieusement à l'aide d'un script PowerShell d'installation sans assistance.

La fonctionnalité d'installateur personnalisé prend en charge le mode d'installation sans assistance, qui permet l'installation et la configuration automatiques. Voici comment utiliser cette fonctionnalité :

### Générer un paquet d'installation personnalisé

1. Connectez-vous à votre ***Devolutions Account*** dans ***Fichier*** – ***Devolutions Account***.
2. Cliquez sur ***gestionnaire d'installateur personnalisé***, sélectionnez la version actuelle de Remote Desktop Manager, puis cochez la case ***Chiffrer la configuration avec un mot de passe dans le paquet d'installation***.
3. Cliquez sur **Créer**.

### Installer le paquet d'installation personnalisé

Le script PowerShell suivant installe automatiquement le paquet généré précédemment et injecte le mot de passe. Notez que l'injection du mot de passe ne se produit que si vous avez coché la case ***Chiffrer la configuration avec un mot de passe dans le paquet d'installation*** à l'étape 2.

{% hint style="info" %}
Le script doit être exécuté en tant qu'administrateur, sinon l'invite UAC ne peut pas apparaître.
{% endhint %}

Voici le script complet à enregistrer en format .ps1 :

```
param (
    [Parameter(Mandatory = $true, Position = 0, HelpMessage = "Path to MSI for Remote Desktop Manager")]
    [ValidateNotNullOrEmpty()]
    [string]
    $MsiPath,
    [switch]
    $AskPassword,
    [parameter(ValueFromPipeline)][string]$password
)
function Read-Password {
    param (
        [string]$Prompt = "Enter Password"
    )
    if ($password) {
        $securePassword = ConvertTo-SecureString -AsPlainText -Force $password
    }
    else {
        $securePassword = Read-Host -AsSecureString -Prompt $Prompt
    }
    $password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto(
        [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePassword)
    )
    return $password
}
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (!$currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning "Not running as administrator. You may run into issues"
}
& 'msiexec.exe' /i "${MsiPath}" /qn
if ($AskPassword) {
    $password = Read-Password
    $pipeHandle = [System.IO.Pipes.NamedPipeClientStream]::new('.', 'DevolutionsUpdater', [System.IO.Pipes.PipeDirection]::Out)
    try {
        $pipeHandle.Connect(15000)
        $passwordBytes = [System.Text.Encoding]::UTF8.GetBytes($password)
        $pipeHandle.Write($passwordBytes, 0, $passwordBytes.Length)
        $pipeHandle.Flush()
    }
    catch {
        Write-Error "Failed to connect to installer instance. Is the installer running with administrator or is RDM already installed?"
    }
    finally {
        $pipeHandle.Close()
    }
}
```

Lors de l'installation du paquet, il est important de fournir le mot de passe de manière sécurisée. Pour ce faire, utilisez un canal nommé afin d'éviter que le mot de passe soit écrit sur le disque ou journalisé.

Pour exécuter le script :

```
PS C:\WINDOWS\system32> . '<Path to above shown .ps1 script>' '<Path to RDM msi>' -AskPassword
```

Pour transmettre le mot de passe à partir d'une variable d'environnement :

```
PS C:\WINDOWS\system32> echo $env:MY_PASSWORD | & 'C:\Temp\RdmInstall.ps1' 'C:\Temp\Setup.RemoteDesktopManager.2024.3.0.0.msi' -AskPassword
```

#### Voir aussi

* [Devolutions Academy - How to Use the Custom Installer](https://academy.devolutions.net/student/page/2397676-how-to-use-the-custom-installer?sid=2202ce15-ae72-4051-b6d9-0a203c58d229\&sid_i=0)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/rdm/fr/knowledge-base/how-to-articles/use-the-custom-installer-in-unattended-setups.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
