Changes

Packages.xml

4,385 bytes added, 09:57, 18 August 2009
Check conditions / check type: Added Execute method, updated Uninstall method
Of course it would be unwise to launch the installer if the software is already installed. That's why there are "check conditions".
Check conditions are broken down into 3 4 categories:
<li>'''File''' - Verifies various information about files within the filesystem</li>
<li>'''Uninstall''' - Checks the software installation registry key (as displayed in Windows' Add/Remove Programs section) for the existence of an existing package</li>
<li>'''Execute''' - Executes a script and checks the returning errorlevel (since WPKG 1.1.0)
</ul>
Registry checks allow you to check for the existence of or a specific value in a registry key ('''Note''': for pre-1.0 versions,
it works on a registry value only, not a registry key!). Be ware, there is a limitation of the RegRead method used by WPKG's Registry checks to query registry values which contain backslashes '\'. See the [[Execute]] method below to address this issue when needed.There are two possible conditions available for registry checks: ''exists'' and ''equals''.
<div style="margin-left: 30px">
Uninstall checks allow you to check the Microsoft software installation registry keys (as displayed in Windows' Add/Remove Programs section) for the existence of a particular package. Microsoft maintains the list
of applications installed and available for uninstallation in the ''HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'' registry key. The value in the DisplayName key of aparticular package is what's matched by this check. The pre-1.1.0 versions of WPKG have only one condition available for this option is : ''exists''.
<div style="margin-left: 30px">
'''exists''' - This checks for the existence of the particular software package in the installation database. If the package is found, the condition returns true.
</div>
 
Since version 1.1.0 this check is extended with several other conditions:
 
<div style="margin-left: 30px">
'''versionsmallerthan''' - This checks for the existence of a particular software package in the installation database and also checks the version of that software package. If the package is found, and the version is smaller than the supplied value, the condition returns true.
 
'''versionlessorequal''' - This checks for the existence of a particular software package in the installation database and also checks the version of that software package. If the package is found, and the version is less than or equal to the supplied value, the condition returns true.
 
'''versionequalto''' - This checks for the existence of a particular software package in the installation database and also checks the version of that software package. If the package is found, and the version is equal to the supplied value, the condition returns true.
 
'''versiongreaterorequal''' - This checks for the existence of a particular software package in the installation database and also checks the version of that software package. If the package is found, and the version is greater than or equal to the supplied value, the condition returns true.
 
'''versiongreaterthan''' - This checks for the existence of a particular software package in the installation database and also checks the version of that software package. If the package is found, and the version is greater than the supplied value, the condition returns true.
</div>
</source>
This checks for the existence of The Gimp 2.6.6 or higher through the installation list:
 
<source lang="xml">
<check type="uninstall" condition="versiongreaterorequal" path="GIMP" value="2.6.6" />
</source>
 
 
'''Execute'''
 
Execute allows you to execute any script which checks if an application is installed. WPKG checks the exit code of the script to determine the existence of the particular software package.
This type of check also allows very complex checks. For example there is a limitation of the RegRead method used by WPKG's Registry checks to query registry values which contain backslashes '\'. Now you can execute a batch script which checks for such registry values using 'reg query ...'.
There are several possible conditions available for execute checks:
 
<div style="margin-left: 30px">
'''exitcodesmallerthan''' - This checks the exit code of the executed script. If the exit code is smaller than the supplied value, the condition returns true.
 
'''exitcodelessorequal''' - This checks the exit code of the executed script. If the exit code is less or equal to the supplied value, the condition returns true.
 
'''exitcodeequalto''' - This checks the exit code of the executed script. If the exit code is equal to the supplied value, the condition returns true.
 
'''exitcodegreaterorequal''' - This checks the exit code of the executed script. If the exit code is greater than of equal to the supplied value, the condition returns true.
 
'''exitcodegreaterthan''' - This checks the exit code of the executed script. If the exit code is greater than the supplied value, the condition returns true.
</div>
 
Examples:
 
This evaluates true if the exit code is negative
<source lang="xml">
<check type="execute" path="\\path\to\script.cmd" condition="exitcodesmallerthan" value="0">
</source>
 
This evalueates true if exit code is 0 or negative
<source lang="xml">
<check type="execute" path="\\path\to\script.cmd" condition="exitcodelessorequal" value="0" >
</source>
 
This evaluates true only if exit code is exactly 0
<source lang="xml">
<check type="execute" path="\\path\to\script.cmd" condition="exitcodeequalto" value="0" >
</source>
 
This evaluates true if exit code is 0 or any positive number
<source lang="xml">
<check type="execute" path="\\path\to\script.cmd" condition="exitcodegreaterorequal" value="0" >
</source>
 
This evaluates true if exit code is any positive number
<source lang="xml">
<check type="execute" path="\\path\to\script.cmd" condition="exitcodegreaterthan" value="0" >
</source>
'''Logical Conditions'''
Anonymous user