diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 index e6ecaf0..fba141c 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 @@ -10,6 +10,7 @@ function Start-IcingaAgentInstallWizard() $AddGlobalTemplates = $null, [string]$PackageSource, [string]$AgentVersion, + [string]$InstallDir, $AllowVersionChanges, $UpdateAgent = $null, $AddFirewallRule = $null, @@ -79,6 +80,9 @@ function Start-IcingaAgentInstallWizard() $Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AgentVersion' -Value $AgentVersion -InstallerArguments $InstallerArguments; $AgentVersion = $Result.Value; $InstallerArguments = $Result.Args; + $Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'InstallDir' -Value $InstallDir -InstallerArguments $InstallerArguments; + $InstallDir = $Result.Value; + $InstallerArguments = $Result.Args; $Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'CAPort' -Value $CAPort -InstallerArguments $InstallerArguments; $CAPort = $Result.Value; $InstallerArguments = $Result.Args; @@ -540,7 +544,7 @@ function Start-IcingaAgentInstallWizard() } if ($RunInstaller) { - if ((Install-IcingaAgent -Version $AgentVersion -Source $PackageSource -AllowUpdates $AllowVersionChanges) -Or $Reconfigure) { + if ((Install-IcingaAgent -Version $AgentVersion -Source $PackageSource -AllowUpdates $AllowVersionChanges -InstallDir $InstallDir) -Or $Reconfigure) { Reset-IcingaAgentConfigFile; Move-IcingaAgentDefaultConfig; Set-IcingaAgentNodeName -Hostname $Hostname;