From 3f36b915704f5b33c153b31e1c6da8cc4e07885f Mon Sep 17 00:00:00 2001 From: David Yoder Date: Tue, 22 Aug 2023 11:53:57 -0400 Subject: [PATCH] don't exit script if already installed --- Install-LiquidFilesOutlookAgent.ps1 | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Install-LiquidFilesOutlookAgent.ps1 b/Install-LiquidFilesOutlookAgent.ps1 index 913d5d1..afe36f3 100644 --- a/Install-LiquidFilesOutlookAgent.ps1 +++ b/Install-LiquidFilesOutlookAgent.ps1 @@ -1,21 +1,6 @@ # Path to the MSI installer $MSIURL = 'https://lfupdate.s3.amazonaws.com/clients/outlook/admin_msi/LiquidFiles_Admin_2.1.10.msi' -# Get path to the installed 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 -} - -# Exit this script if the agent is already installed -If ( $PathToAgentExe ) { - LogMsg "LiquidFiles agent is already installed. This installer will exit." - Exit -} - # Set installer args If (-not [string]::IsNullOrEmpty($LFHost) ) { LogMsg "LiquidFiles target server: ${LFHost}" @@ -44,6 +29,8 @@ Try { 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 ) {