> 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 configurations sans assistance

La fonctionnalité de programme d'installation personnalisé prend en charge le mode d'installation sans surveillance, qui permet une installation et une configuration automatiques. Voici comment utiliser cette fonctionnalité :

### Générer un package de programme d'installation personnalisé

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

### Installer le package du programme d'installation personnalisé

Le script PowerShell suivant installe automatiquement le package précédemment généré 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 package 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 au 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 package, 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 consigné dans les journaux.

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 depuis 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
