LMA – Installing via Boot Script

Installing via Boot Script

You can migrate from the User Agent to the LMA. There are a number of ways this can be achieved. The cleanest is to reimage workstations and installing LMA after during the image process but this is not always an available option. Most customers have a software deployment solution that can be leveraged to complete these tasks in a controlled trackable manner. Nearly everyone these days has Active Directory which has Group Policy. Instructions on deploying LMA alone with GPO can be found here. Below are some examples of AD logon scripts that can be used to install LMA on fresh machines or replace UA with LMA. You just have to edit a few variables to match your environment.

@ECHO OFF

 

:: Test for existing installation

 

if exist "%PROGRAMFILES%\Lightspeed Systems\LMA\Bin\LMA.EXE" GOTO END

if exist "%PROGRAMFILES(x86)%\Lightspeed Systems\LMA\Bin\LMA.EXE" GOTO END

 

:: Test Operating System Architecture

 

:CheckOS

IF EXIST "%PROGRAMFILES(X86)%" (GOTO 64BIT) ELSE (GOTO 32BIT)

 

:: Install Routines

 

:64BIT

echo Found 64-Bit Operating System.

echo Installing the "LMA_Setupx64.msi" package from %~dp0

msiexec /i "%~dp0LMA_Setupx64.msi" MM=0 CO=0 UA=1 ID_SERVER="IP_ADDRESS" /qn

GOTO END

 

:32BIT

echo Found 32-Bit Operating System.

echo Installing the "LMA_Setupx86.msi" package from %~dp0

msiexec /i "%~dp0LMA_Setupx86.msi" MM=0 CO=0 UA=1 ID_SERVER="IP_ADDRESS" /qn

GOTO END

 

:END

Replace UA with LMA on boot script:

@ECHO OFF

:: ================================================================================

:: #title                          :LMA_Install.bat

:: #description              :This script will uninstall UA (if necessary) and install LMA.

:: #author                                 :Lightspeed Systems 
:: #date                                    :08-18-2016

:: #version                               :3.0

:: #requirements          :Place LMA_Install.bat in same folder as all 4 MSI packages.

:: #recommendation    :Execute from network share, e.g. \\mydomain.org\NETLOGON\LMA\

:: #usage                                 :Execute from same folder as MSI package files.

:: #notes                                  :Does not account for .NET 4.5.2 Framework requirements.

:: ================================================================================

 

:: =======================================================

:: User-Defined Variables - Please set the variables below

:: Please do not modify quotes.

:: =======================================================

 

set idServer="myfilter.mydomain.org"

set UA64Package=UserAgentx64 V2.1.14.msi

set UA32Package=UserAgentx32 V2.1.14.msi

set LMA64Package=LMA_Setupx64.msi

set LMA32Package=LMA_Setupx86.msi

 

:: ====================================================

:: Script Variables - DO NOT change the variables below

:: ====================================================

 

set serviceInitialStatus=0

 

:: ===============================================

:: Test for existing install before making changes

:: ===============================================

 

:AlreadyInstalled

 

IF exist "%PROGRAMFILES%\Lightspeed Systems\LMA\Bin\LMA.EXE" (

echo LMA INSTALLER: The Lightspeed Managment Agent is Already Installed.

echo LMA INSTALLER: Exiting...

echo .

GOTO EXIT

)

IF exist "%PROGRAMFILES(x86)%\Lightspeed Systems\LMA\Bin\LMA.EXE" (

echo LMA INSTALLER: The Lightspeed Managment Agent is Already Installed.

echo LMA INSTALLER: Exiting...

echo .

GOTO EXIT

)

 

:: ================================

:: Remove existing UA installations

:: ================================

 

:RemoveUA

 

IF exist "%PROGRAMFILES(X86)%" (GOTO 64BITUA) ELSE (GOTO 32BITUA)

 

:64BITUA

 

IF exist "%PROGRAMFILES%\Lightspeed Systems\User Agent\UAService.EXE" (

echo LMA INSTALLER: Found 64-Bit User Agent.

echo LMA INSTALLER: Uninstalling...

msiexec /x "%~dp0%UA64Package%" /qn

echo .

)

GOTO TestFirewall

 

:32BITUA

 

IF exist "%PROGRAMFILES%\Lightspeed Systems\User Agent\UAService.EXE" (

echo LMA INSTALLER: Found 32-Bit User Agent.

echo LMA INSTALLER: Uninstalling...

msiexec /x "%~dp0%UA32Package%" /qn

echo .

)

GOTO TestFirewall

 

:: =========================================

:: Does Windows Firewall need to be started?

:: =========================================

 

:TestFirewall

 

sc query MpsSvc | find /I "running">nul && set serviceInitialStatus=1

IF %serviceInitialStatus% == 1 (GOTO InstallLMA) ELSE (GOTO StartFirewall)

 

:: ======================

:: Start Windows Firewall

:: ======================

 

:StartFirewall

 

echo LMA INSTALLER: Windows Firewall must be enabled to complete installation.

echo LMA INSTALLER: Enabling Windows Firewall...

echo .

net start MpsSvc

GOTO InstallLMA

 

:: ===================================

:: Install Lightspeed Management Agent

:: ===================================

 

:InstallLMA

 

IF exist "%PROGRAMFILES(X86)%" (GOTO 64BITLMA) ELSE (GOTO 32BITLMA)

 

:64BITLMA

 

echo LMA INSTALLER: Found 64-Bit Operating System.

echo LMA INSTALLER: Installing the %LMA64Package% package from %~dp0

echo .

msiexec /i "%~dp0%LMA64Package%" MM=0 CO=0 UA=1 ID_SERVER=%idServer% /qn

GOTO END

 

:32BITLMA

 

echo LMA INSTALLER: Found 32-Bit Operating System.

echo LMA INSTALLER: Installing the %LMA32Package% package from %~dp0

echo .

msiexec /i "%~dp0%LMA32Package%" MM=0 CO=0 UA=1 ID_SERVER=%idServer% /qn

GOTO END

 

:: =======================================================

:: If Windows Firewall was initially off, turn it back off

:: =======================================================

 

:END

 

IF %serviceInitialStatus% == 0 (GOTO StopFirewall) ELSE (GOTO EXIT)

 

:StopFirewall

 

echo LMA INSTALLER: Verifying Windows Firewall set back to original state...

echo .

net stop MpsSvc

GOTO EXIT

 

:EXIT

 

:: CLEANUP VARIABLES

 

set serviceInitialStatus=

set idServer=

set idServer=

set UA64Package=

set UA32Package=

set LMA64Package=

set LMA32Package=