1 Reply Latest reply on Jun 28, 2010 3:21 PM by rmetzger

    DAT file version Script

      This is way off the wall, but I thought I would post it anyway.  Does anyone know a good way to read the DAT file version and date from either the ePO server or from McAfee's website, so it can be displayed in a web page for my end users?  Just curious if anyone else is doing this.

        • 1. Re: DAT file version Script
          rmetzger

          tdmomega wrote:

           

          This is way off the wall, but I thought I would post it anyway.  Does anyone know a good way to read the DAT file version and date from either the ePO server or from McAfee's website, so it can be displayed in a web page for my end users?  Just curious if anyone else is doing this.

          I have answered this question in the recent past.

          see: http://community.mcafee.com/message/116179#116179

          This method uses McAfee's download center to get the 'current' DAT version information from the file gdeltaavv.ini.

           

          @echo off

           

          ::  Basic Batch file for downloading the latest sdat
          ::  This   script requires Windows 2000 or above.
          ::  Also, cURL.exe in 32 bit  or 64 bit, depending on your system
          ::  see http://curl.haxx.se/ for more  information.
          ::  see http://curl.haxx.se/docs/manpage.html
          ::      for command line parameter use.
          ::  see http://curl.haxx.se/docs/adv_20100209.html for
          ::    a security advisory.
          ::
          ::  This script is   not intended to be complete or without flaws.
          ::  Use at Your Own   Risk. No error recovery or checking is placed
          ::  within this script   and any problems are your responsibility.
          ::
          ::  I ACCEPT NO  RESPONSIBILITY OR LIABILTY OF ANY KIND.
          ::
          ::  This script is  intended to be a starting point for those who
          ::  would like to   expand on the idea of automating the download
          ::  of files where  only  a manual process already exists.
          ::
          ::  If McAfee does not  wish  this code to be disclosed,
          ::  Please remove.
          ::
          ::   Please  note, this in Not intended to be run more than once
          ::  per  day, as  these files are large, and this costs McAfee
          ::  substantially for  misuse. Also, the SDAT files are not
          ::  intended for every day use,  as McAfee supports ePO to handle
          ::  daily  administration tasks.
          ::
          ::   Additionally, your rights to  download files from McAfee's
          ::  sites  are your responsibility and  in no way do I condone or
          ::  suggest or  even hint that these  downloads are legal.
          ::  Please seek legal  counsel.

           


          ::  Basic Strategy:
          ::  1. download gdeltaavv.ini
          ::  2.  parse gdeltaavv.ini for current sdat version
          ::  3. download current   sdat file.

           

          :1 Download gdeltaavv.ini
              echo  cURL.exe -K cURL.cfg http://update.nai.com/products/commonupdater/gdeltaavv.ini -o gdeltaavv.ini
              cURL.exe -K cURL.cfg http://update.nai.com/products/commonupdater/gdeltaavv.ini -o gdeltaavv.ini
              echo.

           

          :2 Parse gdeltaavv.ini
              for /F "usebackq skip=2 delims==  tokens=1,2*" %%m in (`Find /I "CurrentVersion" gdeltaavv.ini`) do set  Curr=%%n
              echo  CurrentVersion=%Curr%
              echo.

           

          :3 Download current sdat executable
              echo  cURL.exe -K  cURL.cfg -C - http://download.nai.com/products/licensed/superdat/english/intel/sdat%Curr%.exe -o sdat%Curr%.exe
              cURL.exe -K cURL.cfg -C - http://download.nai.com/products/licensed/superdat/english/intel/sdat%Curr%.exe -o sdat%Curr%.exe

           

          goto Exit

           

          ::
          ::  cURL statements above reference cURL.cfg.
          :: 
          ::   Create a file called cURL.cfg using the the text below,
          ::  or add  the single dash parameters to the cURL commands above.

          :

          :Exit

           

          # -L/--location
          #      (HTTP/HTTPS) If the  server reports that  the  requested
          #      page  has  a  different   location  (indicated  with the
          #      header line Location:) this  flag will let curl  attempt
          #      to reattempt the get on the new place. If used together
          #      with -i or -I, headers from all  requested pages will be
          #      shown.  If  this  flag is used when  making a HTTP POST,
          #      curl will automatically switch to GET  after the initial
          #      POST has been done.
          #        ex. (First URL is reporting to second URL)
          #          http://download.nai.com/products/DatFiles/4.x/NAI/epo4540dat
          #          http://speedownload.nai.com/products/DatFiles/4.x/NAI/epo4540dat
          --location

           

          # --remote-time recover Date and Timestamp from remote site if  available
          # --remote-time writes the time to the file specified in -o parm
          --remote-time

           

          # --retry <num>   Retry request <num> times if transient problems occur
          # --retry-delay <seconds> When retrying, wait  this many seconds between each
          # --retry-max-time <seconds>  Retry only within this period
          --retry 3
          --retry-delay 3

           

          This technique uses cURL but wget could be used as well. The choice is yours.

           

          Hope this helps.

          Ron Metzger