[wpkg-users] check conditions "and or"

Paul McGrath J.P.McGrath at leeds.ac.uk
Wed Jun 16 09:19:03 CEST 2010


Stefan,
  Thank you I understand now.  The documentation does not go into it in that much detail.
Regards
Paul

-----Original Message-----
From: wpkg-users-bounces at lists.wpkg.org [mailto:wpkg-users-bounces at lists.wpkg.org] On Behalf Of Pendl Stefan
Sent: 15 June 2010 16:50
To: wpkg-users at lists.wpkg.org
Subject: Re: [wpkg-users] check conditions "and or"

>
> Hi,
>   Is it possible to combine check conditions?  I ask because with the advent of Windows 7 64bit the %programfiles%
> variable becomes inaccurate for file location between XP and Win7 64.  I'll show you what I would like to achieve
>
> <check type="logical" condition="and">
>         <check type="uninstall" condition="exists" path="McAfee VirusScan Enterprise" />
>    <check type="logical" condition="or">
>         <check type="file" condition="versiongreaterorequal" path="%programfiles%\mcafee\virusscan enterprise\mcupdate.exe" value="8.7.0.659" />
>         <check type="file" condition="versiongreaterorequal" path="%programfiles(x86)%\mcafee\virusscan enterprise\mcupdate.exe" value="8.7.0.659" />
>  </check>
>
> If this is not possible now could it be possible in the future?
>
> I would prefer this to creating multiple packages and profiles for multiple OS.
>

Paul,

If you use multiple checks without a logical condition, they must all be true, since AND is the default.

This is not specific to Win7, but to 64-bit Windows in general, since 32-bit applications are always installed into %ProgramFiles(x86)%.

The correct check for your package is below:

<check type="uninstall" condition="exists" path="McAfee VirusScan Enterprise" />
<check type="logical" condition="or">
  <check type="file" condition="versiongreaterorequal" path="%programfiles%\mcafee\virusscan enterprise\mcupdate.exe" value="8.7.0.659" />
  <check type="file" condition="versiongreaterorequal" path="%programfiles(x86)%\mcafee\virusscan enterprise\mcupdate.exe" value="8.7.0.659" />
</check>

As an example, for the following all three checks must return true:

<check type="uninstall" condition="exists" path="McAfee VirusScan Enterprise" />
<check type="registry" condition="exists" path="HKLM\SOFTWARE\MyCheck\TestMe" value="true" />
<check type="file" condition="versiongreaterorequal" path="%programfiles(x86)%\mcafee\virusscan enterprise\mcupdate.exe" value="8.7.0.659" />

Nested checks must be done as below:

<check type="logical" condition="or">
  <check type="logical" condition="not">
    <check type="file" />
  </check>

  <check type="registry" />
</check>

---
Stefan
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users



More information about the wpkg-users mailing list