This blog describes a script that can modify HP Softpaq recommendations of a reference file to accommodate unique IT needs. In essence, a Reference File editor. HP Image Assistant (HPIA) is an IT tool designed to intelligently analyze and update HP commercial PCs. HPIA uses daily updated reference files that contain current information for the platform being analyzed. If a need arises for the analysis to occur with a slightly different set of component versions, a modified reference file might be of use.
NOTE: The script is designed to work with reference files based on how HPIA analyzes systems and written with understanding of its behavior. However, it is not an HP official tool and may err. If there are any issues with the resulting files, you may use HP Forums to ask about them.
The Reference File
An HPIA reference file for supported HP commercial systems is updated daily with a process that gathers the latest information for the device and Operating System version and collects that data in an XML formatted file.
The XML file has a specific construct with <ImagePal> at the root and different sections/groupings that HPIA uses during Analyze, or to search for a platforms Softpaqs. Note that Image Assistant requires additional data beyond what the reference file contains, including a knowledge base of advisories and bulletins that either come directly from hp.com or available in a local offline repository during a (HP CMSL) Sync.
The Script
The editor is written in PowerShell and utilizes the HP Client Management Script Library (CMSL), which must be available during execution. The script edits the XML reference file and adjust elements as needed. The script is also capable of creating custom offline, local repositories and populating it with selected Softpaqs. It does not require Admin privileges to run. The script is available on GitHub.
Once the application starts, the reference file is selected by first choosing/confirming the desired OS and OS version and then clicking the ‘Select Platform’ button.
After clicking on ‘Select Platform’, a search dialog opens where you can choose to search for a specific model or load a reference file previously downloaded by pressing ‘Load File’. The ‘Search’ will do a platform name match and list all possible matching products. For example, entering g6 and pressing ‘Search’ will find all HP models having ‘g6’ in the name.
Selecting an entry from the list will return that to the main form. The SysID and model of the selected device will be displayed along with a list of the latest Softpaqs. The local working copy of the reference file is displayed at the bottom of the window. This is the file to be used with HPIA /ReferenceFile:<file.xml> option.
Checkmarks can be used to filter the display of Softpaqs by category.
Selecting a Softpaq from the Current Solutions list will display its superseded versions (if any exist). Right-clicking on a selected entry in the Current Solutions or Supersedes lists provides easy access to both the Softpaq CVA and (release notes) HTML files.
Action: Removing Softpaqs
Selecting a Softpaq from the Current Solutions list will show that entry in the ‘Manage Softpaq Entry’ block’s Softpaq field. The disabled, gray button below will then enable as ‘Remove’. Pressing 'Remove' will remove the Softpaq from the Solutions list and update the reference file.
Action: Replacing Softpaqs
Selecting a Softpaq and then a desired superseded entry will populate both fields in the ‘Manage Softpaq Entry’ group. The button will then change to ‘Replace’. Clicking on the button will modify the reference file to use the superseded Softpaq information as the ‘latest’ available for the platform. The reference file gets updated immediately.
NOTE: With the modified reference file and using a local offline repository, HPIA will analyze against the updated versions. If a previous (superseded) Softpaq is set to current, that Softpaq will need to be downloaded to the repository along with, at least, the corresponding CVA file. The release Notes HTML file is optional. Some curation of the repository may be required in this case.
If manually curating a repository, use the Get-Softpaq <sp#> and Get-SoftpaqMetadaFile <sp#> CMSL commands to add the needed Softpaq
Custom HPIA repository
Another feature of the script is the ability create, initialize, and populate a specific list of Softpaqs that HPIA will use and install as needed. This UI grouping will allow you to find or create a repository and populate it with required Softpaqs.
Pressing ‘Locate’ will open a Folder dialog where you can chose an existing or create a new folder to be used as a Softpaq repository. If the folder exists and has a valid and initialized repository, it will ask if you want to maintain its current filters (Platform and OS associations + categories) or clear it to start new.
Pressing OK will clear the repository and will be made ready for syncing Softpaqs and other needed content.
Once a repository folder has been selected, the ‘Sync’ button will populate all selected Softpaqs from the ‘Current Solutions’ list box. The selection of Softpaqs to maintain in the repository must be done prior to doing a 'Sync'. The downloads will include the Softpaq.exe, cva, and html files. All other HPIA required content will be downloaded as well.
Use HPIA /ReferenceFile:<file.xml> and the /offlinemode:<repo folder> options with the curated repository.
Logging
For script troubleshooting purposes, a 'Actions log' checkmark enables the script to output what it does to a log file, named ReferenceFile.log
V1.02.02 Update
This new version includes better search of Softpaqs with Category and Driver type filters, as well as a code fix and includes a new field to show what category is a selected Softpaq