added a few safety checks before install
This commit is contained in:
@@ -20,6 +20,13 @@ If (-not [string]::IsNullOrEmpty($LFHost) ) {
|
|||||||
}
|
}
|
||||||
Else { $INSTALLER_ARGS = '' }
|
Else { $INSTALLER_ARGS = '' }
|
||||||
|
|
||||||
|
## Stop any running LiquidFilesWindowsAgent process
|
||||||
|
$RunningProcess = Get-Process -Name "LiquidFilesWindowsAgent"
|
||||||
|
If ($RunningProcess) {
|
||||||
|
LogMsg "Stopping the LiquidFiles agent"
|
||||||
|
$RunningProcess | Stop-Process -Force
|
||||||
|
}
|
||||||
|
|
||||||
## Run the installer
|
## Run the installer
|
||||||
$INSTALLER = Download-File -URL $MSIURL
|
$INSTALLER = Download-File -URL $MSIURL
|
||||||
LogMsg "Installing Liquid Files Outlook Agent from ""${INSTALLER}"""
|
LogMsg "Installing Liquid Files Outlook Agent from ""${INSTALLER}"""
|
||||||
@@ -32,3 +39,17 @@ Try {
|
|||||||
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
|
Remove-Item $INSTALLER -Force -ErrorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
|
||||||
|
## Start the agent
|
||||||
|
$PathToAgentExe64 = "${Env:ProgramFiles(x86)}\LiquidFiles Windows Agent\LiquidFilesWindowsAgent.exe"
|
||||||
|
$PathToAgentExe32 = "${Env:ProgramFiles}\LiquidFiles Windows Agent\LiquidFilesWindowsAgent.exe"
|
||||||
|
If ( Test-Path $PathToAgentExe64 ) {
|
||||||
|
$PathToAgentExe = $PathToAgentExe64
|
||||||
|
} ElseIf ( Test-Path $PathToAgentExe32 ) {
|
||||||
|
$PathToAgentExe = $PathToAgentExe32
|
||||||
|
}
|
||||||
|
If ($PathToAgentExe) {
|
||||||
|
LogMsg "Starting LiquidFiles agent"
|
||||||
|
Try { Start-Process $PathToAgentExe }
|
||||||
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user