From 8b6c4809d7ea544e4fb62c9ea77a0654c25cd468 Mon Sep 17 00:00:00 2001 From: Mark Mihevc Date: Mon, 30 Sep 2024 08:44:51 -0600 Subject: [PATCH 1/3] fixing the msiexec command --- scripts/windows/InstallWindowsAgent.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/windows/InstallWindowsAgent.ps1 b/scripts/windows/InstallWindowsAgent.ps1 index fcc589f8e..197ee9c67 100644 --- a/scripts/windows/InstallWindowsAgent.ps1 +++ b/scripts/windows/InstallWindowsAgent.ps1 @@ -17,7 +17,10 @@ $AGENT_INSTALLER_URL = "https://cdn02.jumpcloud.com/production/jcagent-msi-signe $AGENT_INSTALLER_PATH = "C:\windows\Temp\jcagent-msi-signed.msi" # JumpCloud Agent Installation Functions Function InstallAgent() { - msiexec /i $AGENT_INSTALLER_PATH /quiet JCINSTALLERARGUMENTS=`"-k $JumpCloudConnectKey /VERYSILENT /NORESTART /NOCLOSEAPPLICATIONS /L*V "C:\Windows\Temp\jcUpdate.log"`" + if (!(Test-Path "C:\ProgramData\JumpCloud\Agent")) { + New-Item -ItemType Directory -Path "C:\ProgramData\JumpCloud\Agent" -Force + } + msiexec /i $AGENT_INSTALLER_PATH /quiet /norestart JCINSTALLERARGUMENTS=`"-k $JumpCloudConnectKey`" /L*V "C:\ProgramData\JumpCloud\Agent\jcUpdate.log" } Function DownloadAgentInstaller() { (New-Object System.Net.WebClient).DownloadFile("${AGENT_INSTALLER_URL}", "${AGENT_INSTALLER_PATH}") From e95ac6ad8e62cd1fbab21597ab190b6581c47c02 Mon Sep 17 00:00:00 2001 From: Mark Mihevc Date: Mon, 30 Sep 2024 08:49:20 -0600 Subject: [PATCH 2/3] resetting log location path --- scripts/windows/InstallWindowsAgent.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/windows/InstallWindowsAgent.ps1 b/scripts/windows/InstallWindowsAgent.ps1 index 197ee9c67..018c9b7f4 100644 --- a/scripts/windows/InstallWindowsAgent.ps1 +++ b/scripts/windows/InstallWindowsAgent.ps1 @@ -20,7 +20,7 @@ Function InstallAgent() { if (!(Test-Path "C:\ProgramData\JumpCloud\Agent")) { New-Item -ItemType Directory -Path "C:\ProgramData\JumpCloud\Agent" -Force } - msiexec /i $AGENT_INSTALLER_PATH /quiet /norestart JCINSTALLERARGUMENTS=`"-k $JumpCloudConnectKey`" /L*V "C:\ProgramData\JumpCloud\Agent\jcUpdate.log" + msiexec /i $AGENT_INSTALLER_PATH /quiet /norestart JCINSTALLERARGUMENTS=`"-k $JumpCloudConnectKey`" /L*V "$TempPath\jcUpdate.log" } Function DownloadAgentInstaller() { (New-Object System.Net.WebClient).DownloadFile("${AGENT_INSTALLER_URL}", "${AGENT_INSTALLER_PATH}") From c5d5fc29c28d1f884e9d68e173f60c955f231b13 Mon Sep 17 00:00:00 2001 From: Mark Mihevc Date: Mon, 30 Sep 2024 09:11:43 -0600 Subject: [PATCH 3/3] resetting log location path --- scripts/windows/InstallWindowsAgent.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/windows/InstallWindowsAgent.ps1 b/scripts/windows/InstallWindowsAgent.ps1 index 018c9b7f4..363355114 100644 --- a/scripts/windows/InstallWindowsAgent.ps1 +++ b/scripts/windows/InstallWindowsAgent.ps1 @@ -17,9 +17,6 @@ $AGENT_INSTALLER_URL = "https://cdn02.jumpcloud.com/production/jcagent-msi-signe $AGENT_INSTALLER_PATH = "C:\windows\Temp\jcagent-msi-signed.msi" # JumpCloud Agent Installation Functions Function InstallAgent() { - if (!(Test-Path "C:\ProgramData\JumpCloud\Agent")) { - New-Item -ItemType Directory -Path "C:\ProgramData\JumpCloud\Agent" -Force - } msiexec /i $AGENT_INSTALLER_PATH /quiet /norestart JCINSTALLERARGUMENTS=`"-k $JumpCloudConnectKey`" /L*V "$TempPath\jcUpdate.log" } Function DownloadAgentInstaller() {