download installer locally instead of running online install
This commit is contained in:
+10
-5
@@ -11,7 +11,7 @@ Function SourceTools
|
|||||||
. SourceTools
|
. SourceTools
|
||||||
|
|
||||||
## Build the path for $AGENT_INSTALLER
|
## Build the path for $AGENT_INSTALLER
|
||||||
#$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
$AGENT_INSTALLER = '{0}{1}' -f (GetTempPath), $AGENT_FILENAME
|
||||||
|
|
||||||
## Make sure we need to install the agent
|
## Make sure we need to install the agent
|
||||||
If ( (Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe") -or (Test-Path "${Env:ProgramFiles(x86)}\ATERA Networks\AteraAgent\AteraAgent.exe") )
|
If ( (Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe") -or (Test-Path "${Env:ProgramFiles(x86)}\ATERA Networks\AteraAgent\AteraAgent.exe") )
|
||||||
@@ -31,12 +31,17 @@ If ( $INSTALL ) {
|
|||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
}
|
}
|
||||||
|
|
||||||
## Set agent URL
|
## Download agent installer
|
||||||
$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AteraAgentSetup.msi'
|
Download-File -URL 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AteraAgentSetup.msi' -File "${AGENT_INSTALLER}"
|
||||||
|
|
||||||
## Install the agent
|
## Install the agent
|
||||||
LogMsg "Installing Atera agent from: ${URL}"
|
LogMsg "Installing Atera agent"
|
||||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ${URL} /qn /norestart INTEGRATORLOGIN=${INTEGRATOR_ID} COMPANYID=${CUSTOMER_ID}" -Wait }
|
Try { Start-Process "msiexec.exe" -ArgumentList "/i ""${AGENT_INSTALLER}"" /qn /norestart INTEGRATORLOGIN=${INTEGRATOR_ID} COMPANYID=${CUSTOMER_ID}" -Wait }
|
||||||
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
|
||||||
|
## Delete the agent installer
|
||||||
|
LogMsg "Deleting ""${AGENT_INSTALLER}"""
|
||||||
|
Try { Remove-Item $AGENT_INSTALLER -Force }
|
||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
|
||||||
} Else { LogMsg "Atera agent is already installed on this endpoint." }
|
} Else { LogMsg "Atera agent is already installed on this endpoint." }
|
||||||
|
|||||||
Reference in New Issue
Block a user