[wpkg-users] On remove only the first check is executed

Pendl Stefan stefan.pendl at haidlmair.at
Thu Jun 18 18:58:16 CEST 2009


Rainer Meier wrote:

>>
Hi Stefan,

Pendl Stefan wrote:
> Hi Rainer,
>      if I have four checks defined and a package is removed, only the first check is executed, if it returns a positive result, the additional three checks are not executed.
>
> Is this by design?

It's actually an optimization. Let's explain...


> On install all checks are executed.

If you specify the checks in "flat" order eg
<check ... />
<check ... />
<check ... />

Then the checks are evaluated loke you would use a logical AND for the checks.

WPKG will evaluate all of them in order and the result is true (installed) only
if all of them are true (none fails).

If one of them fails, then the result is clear anyway: it will be false!
There is no way that the final evaluation will be true if one of the checks fail.

So WPKG stops executing further checks if one of them fails.

The result is equal to the following construct:

<check type='logical' condition='and'>
        <check ... />
        <check ... />
        <check ... />
</check>
<<
------------------------------
Rainer,
thanks for clearing this up, so it is behaving like C and so forth, if the right-most condition returns a negative result skip the rest.

To summarize, so if I want to create four desktop shortcuts, I would need four separate packages, to be able to check each for correct removal.
I can live with that.

BTW, the upgrade-before-remove post has an error in the remove command, instead of "type NUL >" it should be "del /f /q ".
I have already changed my version of wpkg 1.1.1-RC5 to set the default for noUpgradeBeforeRemove to false and all is working as expected, seems this was a leftover from your testing.

---
Stefan




More information about the wpkg-users mailing list