exit installer if agent is installed
This commit is contained in:
@@ -1,6 +1,21 @@
|
|||||||
# Path to the MSI installer
|
# Path to the MSI installer
|
||||||
$MSIURL = 'https://lfupdate.s3.amazonaws.com/clients/outlook/admin_msi/LiquidFiles_Admin_2.1.10.msi'
|
$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 ( Test-Path $PathToAgentExe ) {
|
||||||
|
LogMsg "LiquidFiles agent is already installed. This installer will exit."
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
|
||||||
# Set installer args
|
# Set installer args
|
||||||
If (-not [string]::IsNullOrEmpty($LFHost) ) {
|
If (-not [string]::IsNullOrEmpty($LFHost) ) {
|
||||||
LogMsg "LiquidFiles target server: ${LFHost}"
|
LogMsg "LiquidFiles target server: ${LFHost}"
|
||||||
@@ -29,13 +44,6 @@ Try {
|
|||||||
Catch { LogErr $_.Exception.Message }
|
Catch { LogErr $_.Exception.Message }
|
||||||
|
|
||||||
# Start the agent
|
# 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) {
|
If ($PathToAgentExe) {
|
||||||
LogMsg "Starting LiquidFiles agent"
|
LogMsg "Starting LiquidFiles agent"
|
||||||
Try { Start-Process $PathToAgentExe }
|
Try { Start-Process $PathToAgentExe }
|
||||||
|
|||||||
Reference in New Issue
Block a user