From 879c325a22b4a113925b55116e001ab0da0f91f9 Mon Sep 17 00:00:00 2001 From: nicholxs <41819863+nichxlxs@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:35:38 +1000 Subject: [PATCH 1/3] Detect agent installer file, not Agent Folder. This will cause an early exit as the failed installer logs are stored in this folder. Instead, we should check if the executable exists. --- Powershell/InstallHuntress.powershellv2.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Powershell/InstallHuntress.powershellv2.ps1 b/Powershell/InstallHuntress.powershellv2.ps1 index 84ede1f..fe77640 100644 --- a/Powershell/InstallHuntress.powershellv2.ps1 +++ b/Powershell/InstallHuntress.powershellv2.ps1 @@ -1053,7 +1053,7 @@ function main () { StopHuntressServices } else { LogMessage "Checking for HuntressAgent install..." - $agentPath = getAgentPath + $agentExe = Join-Path $agentPath "HuntressAgent.exe" if ( (Test-Path $agentPath) -eq $true) { LogMessage "The Huntress Agent is already installed in $agentPath. Exiting with no changes. Suggest using -reregister or -reinstall flags" copyLogAndExit From 1763302dcbd7ea175b2400d80ec0af2a8dcfe7f4 Mon Sep 17 00:00:00 2001 From: nicholxs <41819863+nichxlxs@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:38:48 +1000 Subject: [PATCH 2/3] Fix agentExe variable --- Powershell/InstallHuntress.powershellv2.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Powershell/InstallHuntress.powershellv2.ps1 b/Powershell/InstallHuntress.powershellv2.ps1 index fe77640..6d78602 100644 --- a/Powershell/InstallHuntress.powershellv2.ps1 +++ b/Powershell/InstallHuntress.powershellv2.ps1 @@ -1053,8 +1053,9 @@ function main () { StopHuntressServices } else { LogMessage "Checking for HuntressAgent install..." + $agentPath = getAgentPath $agentExe = Join-Path $agentPath "HuntressAgent.exe" - if ( (Test-Path $agentPath) -eq $true) { + if ( (Test-Path $agentExe) -eq $true) { LogMessage "The Huntress Agent is already installed in $agentPath. Exiting with no changes. Suggest using -reregister or -reinstall flags" copyLogAndExit } From 9cfa394174fa612025dfd640a71d6d601b496577 Mon Sep 17 00:00:00 2001 From: nicholxs <41819863+nichxlxs@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:40:25 +1000 Subject: [PATCH 3/3] Detect agent installer file, not Agent Folder This will cause an early exit as the failed installer logs are stored in this folder. Instead, we should check if the executable exists. --- Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 b/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 index 328260a..f781946 100644 --- a/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 +++ b/Datto-RMM/scripts/InstallHuntress.dattormm.comstore.ps1 @@ -1065,7 +1065,8 @@ function main () { } else { LogMessage "Checking for HuntressAgent install..." $agentPath = getAgentPath - if ( (Test-Path $agentPath) -eq $true) { + $agentExe = Join-Path $agentPath "HuntressAgent.exe" + if ( (Test-Path $agentExe) -eq $true) { LogMessage "The Huntress Agent is already installed in $agentPath. Exiting with no changes. Suggest using -reregister or -reinstall flags" copyLogAndExit }