don't exit script if already installed

This commit is contained in:
2023-08-22 11:53:57 -04:00
parent 20fb02e026
commit 3f36b91570
+2 -15
View File
@@ -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 ) {