2 Replies Latest reply on Feb 29, 2016 3:59 AM by duberyy_wotsit

    Packaging and Deploying AppSense Agents

    Roger1 Apprentice
      Due to our unique environment, we use config manager to deploy agent updates to our physical workstations.  We deploy the full suite and do one reboot at a scheduled time.  With DesktopNow (AM 8.8), we had no problems packaging up the MSIs and MSPs in this manner.  With the latest DesktopNow (AM 8.9), we ran into a roadblock.  The MSI installer for AM tries to kill and restart processes that it is hooked into.  We all know to bring up task manager and run explorer.exe but this isnt' an option for our regular users.  And this is only a problem for laptop users who miss the maintenance window.  Since SCCM uses the System account, it can't restart explorer as the logged on user.  After quite a bit of digging, our SCCM admin figured out how to get explorer back as the logged on user. 

      If anyone else is looking to upgrade to the latest and greatest with a similar deployment method, maybe this can be of assistance.  If you're considering the upgrade - do it.  It is extremely polished. 

      In config man, an application is created for each agent with patches/hotfixes.  Dependencies are created between the four to make sure they all install.  Each deployment type calls a batch file which kicks off the installers. 

      CCA:
      @echo off rem client comm agent installer:  msiexec /i "%~dp0ClientCommunicationsAgent64.msi" /quiet /norestart /l*v c:\temp\logs\AppSense-ClientComAgent8.7.log WEB_SITE="http://APPSENSE_SERVER" GROUP_NAME="YOUR_GROUP"  ALLUSERS=1 PATCH="%~dp0ClientCommunicationsAgent64.msp"

      EM:
      @echo off rem environment manager agent installer:  msiexec /i "%~dp0EnvironmentManagerAgent64.msi" /quiet /norestart /l*v c:\temp\logs\AppSense-EnvManagerAgent8.9.log PATCH="%~dp0EnvironmentManagerAgent64.msp" msiexec /p "%~dp0EM86SP1HF1\EnvironmentManagerAgent64.msp" /quiet /norestart /l*v c:\temp\logs\AppSense-EnvManagerAgent8.9-HF1.log


      PM:
      @echo off rem environment manager agent installer:  msiexec /i "%~dp0PerformanceManagerAgent64.msi" /quiet /norestart /l*v c:\temp\logs\AppSense-PerfManagerAgent8.3.log PATCH="%~dp0PerformanceManagerAgent64.msp"


      AM:  This uses different batch files and the Powershell App Deployment Toolkit.  You'll need to download it from codeplex or github. 
      AM Batch file 1
      @echo off rem application manager agent installer:  copy /y "%~dp0checkforexplorer.bat" c:\temp net stop "AppSense Application Manager Agent" timeout /t 15 "%~dp0PSToolkit\Deploy-Application.exe" -DeployMode "Interactive" rem msiexec /i "%~dp0ApplicationManagerAgent64.msi" /quiet /norestart /l*v c:\temp\logs\AppSense-AppMangerAgent8.9.log msiexec /p "%~dp0ApplicationManagerAgent64.msp" /quiet /norestart /l*v c:\temp\logs\AppSense-AppManagerAgent8.9-SP1.log msiexec /p "%~dp0AM89SP1HF6\ApplicationManagerAgent64.msp" /quiet /norestart /l*v c:\temp\logs\AppSense-AppMangerAgent8.9-SP1HF6.log del C:\temp\checkforexplorer.bat net start "AppSense Application Manager Agent" timeout /t 15 


      AM Batch File 2 - checkforexplorer.bat
      @echo off tasklist | find /i "explorer.exe" > nul if errorlevel 1 goto runit if errorlevel 0 goto end  :runit start explorer.exe  :end


      Powershell snippet - part of the PS script that comes with the toolkit.  Notice the checkforexplorer.bat:
      ##*===============================================   ##* POST-INSTALLATION   ##*===============================================   [string]$installPhase = 'Post-Installation'      ## <Perform Post-Installation tasks here>         Execute-ProcessAsUser -path "C:\temp\checkforexplorer.bat" -wait 


      Standard AM batch file if explorer.exe isn't a concern:
      @echo off rem application manager agent installer:  msiexec /i "%~dp0ApplicationManagerAgent64.msi" /quiet /norestart /l*v c:\temp\logs\AppSense-AppMangerAgent8.9.log msiexec /p "%~dp0ApplicationManagerAgent64.msp" /quiet /norestart /l*v c:\temp\logs\AppSense-AppManagerAgent8.9-SP1.log msiexec /p "%~dp0AM89SP1HF6\ApplicationManagerAgent64.msp" /quiet /norestart /l*v c:\temp\logs\AppSense-AppMangerAgent8.9-SP1HF6.log 


      Attached a screenshot of the folder structure.  Crossed out non-referenced files.  I'll probably be making some edits to this but hopefully it can offer a little guidance (it's rough I know).  Let me know if you have any questions/corrections.