6 Replies Latest reply on Sep 15, 2012 4:09 PM by rmetzger

    porblem with agent installation login script

    alhaawi

      hello all

      I have created agent installation login script similar  to the one in the Product Guide

      McAfee® Agent 4.6.0

       

      IF EXIST “C:\Program Files\McAfee\Common Framework\FRAMEWORKSERVICE.EXE” GOTO

      END_BATCH

      \\MyServer\Agent\UPDATE$\FRAMEPKG.EXE /INSTALL=AGENT

      :END_BATCH

      The script works fine for systems that had not installed the agent before. However If I remove the agent from a machine via Epo server for  Troubleshooting Purpose, the path C:\Program Files\McAfee\Common Framework\FRAMEWORKSERVICE.EXE will stay there and not deleted. In this case the script will not install the agent on computers that had the agent before.

      Any idea to solve this problem? Or what things to look for other than the mentioned path above?

      I appreciate your help

       

        • 1. Re: porblem with agent installation login script
          andrep1

          You might want to check for the version reported in the registry for the agent

           

          objShell.RegRead("HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework\Version")

          It will also enable you to compare the version to do an upgrade.

          • 2. Re: porblem with agent installation login script

            Can you open the FRAMEPKG.EXE from that share? Try running the batchfile locally from a CMD.exe and check for errors.

            • 3. Re: porblem with agent installation login script
              alhaawi

              Andre Parent , the follwoing line looks good

              objShell.RegRead("HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework\Version")

               

              but where i can run it? i do not think i can run it inside the batch login script!

               

              thanks for your help , waiting for your answer

               

              Message was edited by: alhaawi on 9/15/12 8:06:46 PM GMT+03:00
              • 4. Re: porblem with agent installation login script
                rmetzger

                alhaawi wrote:

                 

                Andre Parent , the follwoing line looks good

                objShell.RegRead("HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework\Version")

                 

                but where i can run it? i do not think i can run it inside the batch login script!

                 

                thanks for your help , waiting for your answer

                 

                Basic command from a batch file or command line:

                 

                "Reg" QUERY "HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework" /v "Version"

                 

                 

                More Advanced command to take Version and place it into a set environment variable _Version (from a Batch File)

                 

                for /F "usebackq skip=2 tokens=2*" %%a in (`Reg QUERY "HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework" /v "Version" 2^>NUL`) do set _Version=%%b

                 

                If you want to issue this from the command line, replace %%a and %%b with %a and %b.

                 

                 

                Both of these commands should work on Windows XP and up.

                 

                You will have to convert the values as needed, as it is returned with values, like 4.0.0.1345. This means that you will need to parse it to determine what major, minor, sub-minor, etc. you need.

                 

                Hope this is helpful, and good luck.

                Ron Metzger

                • 5. Re: porblem with agent installation login script
                  alhaawi

                  hello rmetzger

                   

                  i got the first one working from dos command

                  "Reg" QUERY "HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework" /v "Version"

                  it gives me "Version    REG_SZ    4.6.0.2292"

                   

                  but how can i deal with this in the batch file?

                  can i say for example " if reg_sz" ne 4.6.0.2292 the goto install agent"

                  i no nothing about this

                  thanks for the help

                  • 6. Re: porblem with agent installation login script
                    rmetzger

                    alhaawi wrote:

                     

                    hello rmetzger

                     

                    i got the first one working from dos command

                    "Reg" QUERY "HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework" /v "Version"

                    it gives me "Version    REG_SZ    4.6.0.2292"

                     

                    but how can i deal with this in the batch file?

                    can i say for example " if reg_sz" ne 4.6.0.2292 the goto install agent"

                    i no nothing about this

                    thanks for the help

                     

                    set  _Version=

                    for /F "usebackq skip=2 tokens=2*" %%a in (`Reg QUERY "HKLM\SOFTWARE\Network Associates\TVD\Shared Components\Framework" /v "Version" 2^>NUL`) do set _Version=%%b

                    echo Agent Version=%_Version%

                     

                    will output something like (given your example):

                    Agent Version=4.6.0.2292

                     

                    so (again using your example), the next line of the batch file would be:

                     

                    if /i NOT "%_Version%"=="4.6.0.2292" goto InstallAgent

                     

                    This is really basic batch code, so you may want enhance it a bit to do more to break down the values.

                     

                    For instance:

                     

                    for /F "tokens=1-3* delims=." %%a in ('echo %_Version%') do (

                        set _VMaj=%%a

                        set _VMin=%%b

                        set _VSub=%%c

                        set _VSubSub=%%d

                    )

                     

                    would parse the _Version down to it's independent sub-versions for use within the batch file if /i commands later.

                    _VMaj=4

                    _VMin=6

                    _VSub=0

                    _VSubSub=2292

                     

                    All of this would be done Inside a Batch file, not from the command line.

                     

                    Not sure you need this though. This all depends on your batch code.

                     

                    However, this may be getting into Off Topic areas of batch programming which might be better handled elsewhere.

                     

                    Good luck.

                    Ron Metzger