scripting@wanadoo.nl




GetSoftwareList()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
25 March 2002 GetSoftwareList()
AuthorScriptLogic Corporation
Action Return and array consisting of the software programs installed on the client.
SyntaxGetSoftwareList (sort) 
Parameters
  • sort (Optional / Numeric) Optional parameter. If supplied, the software list is sorted in ascending alphabetical order. If 0 (or no parameter is supplied), the list will be in 'natural' order as it is retrieved from the registry. 
  • RemarksGood tool for performing a software inventory during logon. 
    ReturnsReturns an array of the software programs installed on the client. 
    DependenciesAsort() 
    Examples
    ?'The following applications are installed on this computer:'
    
    $InstalledSoftwareArray=GetSoftwareList(1)
    FOR EACH $element IN $InstalledSoftwareArray
      ?$element
    NEXT
    
     
    Source
    FUNCTION GetSoftwareList (OPTIONAL $sort)
      ; Author: ScriptLogic Corporation
      ; Last revised: 16-nov-2001
      ; Optional parameter: sort
      ;   if 0 (or not supplied), no sorting of list is done.
      ;   if 1, results are sorted alphabetically, ascending order
      ;
      ;   Note: If sorting is requested, this function then has a dependency on the Asort() UDF.
    
      DIM $arrayindex, $enumindex, $component, $dn, $regkey, $swarray[200]
      $regkey='HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'
      $enumindex=0
      $arrayindex=0
     :gisloop
      $component=EnumKey($regkey, $enumindex)
      IF NOT @error
        IF NOT (Len($component)=7 AND Left($component,1)='Q')
          ; above line excludes hotfixes from listing
          IF NOT (0+ReadValue($regkey+'\'+$component,'SystemComponent'))
            $dn=ReadValue($regkey+'\'+$component,'DisplayName')
            IF $dn
              $swarray[$arrayindex]=$dn
              $arrayindex=$arrayindex+1
            ENDIF
          ENDIF
          $enumindex=$enumindex+1
          GOTO gisloop
        ENDIF
      ENDIF
      REDIM PRESERVE $swarray[$arrayindex]
      IF $sort
        $getsoftwarelist=asort($swarray)
      ELSE
        $getsoftwarelist=$swarray
      ENDIF
    ENDFUNCTION ; - GetSoftwareList -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter