> 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/it/knowledge-base/how-to-articles/use-the-custom-installer-in-unattended-setups.md).

# Usare il programma di installazione personalizzato nelle installazioni non presidiate

Genera un pacchetto di installazione personalizzato di Remote Desktop Manager e lo distribuisca in modo silenzioso utilizzando uno script PowerShell di installazione automatica.

La funzionalità del programma di installazione personalizzato supporta la modalità di installazione automatica, che consente l'installazione e la configurazione automatiche. Ecco come utilizzare questa funzionalità:

### Generazione di un pacchetto di installazione personalizzato

1. Si connetta al suo ***Devolutions Account*** in ***File*** – ***Devolutions Account***.
2. Clicchi su ***gestore del programma di installazione personalizzato***, selezioni la versione corrente di Remote Desktop Manager e selezioni la casella ***Cifra la configurazione con una password nel pacchetto di installazione***.
3. Clicchi su **Crea**.

### Installazione del pacchetto di installazione personalizzato

Il seguente script PowerShell installa automaticamente il pacchetto generato in precedenza e inserisce la password. Si noti che l'inserimento della password avviene solo se ha selezionato la casella ***Cifra la configurazione con una password nel pacchetto di installazione*** nel passaggio 2.

{% hint style="info" %}
Lo script deve essere eseguito come amministratore, altrimenti il prompt UAC non può apparire.
{% endhint %}

Ecco lo script completo da salvare in formato .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()
    }
}
```

Durante l'installazione del pacchetto, è importante fornire la password in modo sicuro. Per ottenere questo risultato, utilizzi una named pipe per evitare che la password venga scritta sul disco o registrata nei log.

Per eseguire lo script:

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

Per inviare la password tramite pipe da una variabile d'ambiente:

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

#### Vedere anche

* [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/it/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.
