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

# Brug det brugerdefinerede installationsprogram i uovervågede installationer

Generer en brugerdefineret installationspakke til Remote Desktop Manager, og udrul den uovervåget med et PowerShell-script til uovervåget opsætning.

Funktionen til brugerdefineret installationsprogram understøtter tilstanden uovervåget installation, som giver mulighed for automatisk installation og konfiguration. Sådan bruger De denne funktion:

### Generering af en brugerdefineret installationspakke

1. Opret forbindelse til Deres ***Devolutions Account*** under ***Fil*** – ***Devolutions Account***.
2. Klik på ***styring af brugerdefineret installationsprogram***, vælg den aktuelle version af Remote Desktop Manager, og markér feltet ***Kryptér konfiguration med adgangskode i installationspakken***.
3. Klik på **Opret**.

### Installation af den brugerdefinerede installationspakke

Følgende PowerShell-script installerer automatisk den tidligere genererede pakke og indsætter adgangskoden. Bemærk, at indsættelse af adgangskoden kun sker, hvis De har markeret feltet ***Kryptér konfiguration med adgangskode i installationspakken*** i trin 2.

{% hint style="info" %}
Scriptet skal køres som administrator, ellers kan UAC-prompten ikke vises.
{% endhint %}

Her er det fulde script, som skal gemmes i formatet .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()
    }
}
```

Når pakken installeres, er det vigtigt at angive adgangskoden sikkert. Det gør De ved at bruge en navngiven pipe, så adgangskoden ikke skrives til disken eller logges.

Sådan køres scriptet:

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

Sådan sendes adgangskoden fra en miljøvariabel via en pipe:

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

#### Se også

* [Devolutions Academy - Sådan bruges det brugerdefinerede installationsprogram](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/da/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.
