[wpkg-users] failing check condition with a variable

Jens Kalinowsky mailinglisten at kalinowsky.de
Wed Apr 24 20:06:29 CEST 2024


Hi,

I'm desperate with a simple check condition that is supposed to check a 
registry value but fails. The log file indicates that the variable may 
not have been expanded. I'm using wpkg 1.3.1.

The shortend test package content is:

     <package id="PrinterDrv-Test" name="Printer driver (Test)"
         revision="%PKG_VERSION%_%timestamp%" reboot="postponed" priority="84">
         
         <variable name="PKG_VERSION" value="3.00" />
         <variable name="TIMESTAMP"   value="202404241556"/>
         <variable name="PKG_SOURCE"  value="%SOFTWARE%\Canon\Canon Generic Plus PCL6 (v%PKG_VERSION%, 32- & 64-Bit)\x64\Driver" architecture="x64" />
         <variable name="PKG_DRVENV"  value="Windows x64" architecture="x64" />
         <variable name="PKG_DRVNAME" value="Canon Generic Plus PCL6" />
         
         <check type="registry" condition="equals" path="HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\%PKG_DRVENV%\Drivers\Version-3\Canon Generic Plus PCL6\DriverVersion" value="%PKG_VERSION%" architecture="x64" />
         
         <commands>
             <command type="install" cmd='"%comspec%" /C reg query "HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\%PKG_DRVENV%\Drivers\Version-3\Canon Generic Plus PCL6" /V DriverVersion >"%Temp%\DrvVer.txt"' />
         </commands>
     </package>

Output of the created test file with the registry content:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\Canon Generic Plus PCL6
        DriverVersion    REG_SZ    3.0.0.0

And the wpkg.log:

     [...]
     2024-04-24 17:18:42, DEBUG   : Got variable 'PKG_VERSION' of value '3.00'
     2024-04-24 17:18:42, DEBUG   : Got variable 'TIMESTAMP' of value '202404241556'
     2024-04-24 17:18:42, DEBUG   : Got variable 'PKG_SOURCE' of value '%SOFTWARE%\Canon\Canon Generic Plus PCL6
(v%PKG_VERSION%, 32- & 64-Bit)\x64\Driver'
     2024-04-24 17:18:42, DEBUG   : Got variable 'PKG_DRVENV' of value 'Windows x64'
     2024-04-24 17:18:42, DEBUG   : Got variable 'PKG_DRVNAME' of value 'Canon Generic Plus PCL6'
     2024-04-24 17:18:42, DEBUG   : Reading variables from profile[s]
     2024-04-24 17:18:42, DEBUG   : Reading variables from hosts[s]
     2024-04-24 17:18:42, DEBUG   : The expanded registry path
'HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows x64\Drivers\Version-3\Canon Generic Plus
PCL6\DriverVersion' could be read.
     2024-04-24 17:18:42, DEBUG   : The registry value received is a scalar value.
     2024-04-24 17:18:42, DEBUG   : The registry path
'HKLM\SYSTEM\CurrentControlSet\Control\Print\Environments\%PKG_DRVENV%\Drivers\Version-3\Canon Generic Plus
PCL6\DriverVersion' did not contain the value: '%PKG_VERSION%'. Instead it contained '3.0.0.0'. the check failed.
     2024-04-24 17:18:42, DEBUG   : Saving unsorted settings to 'C:\Windows\System32\wpkg.xml'.

The error about the possibly unexpanded variable is in the the second 
last line of the log. I would be grateful for a quick tip on what I am 
missing.

Jens



More information about the wpkg-users mailing list