[wpkg-users] Upgrade Skips Checks

Matthew Bowman mgbowman at gmx.com
Tue Feb 21 12:17:26 CET 2012


On 2/21/12 1:05 PM, Rainer Meier wrote:
> Hi Matthew,
>
> On 21.02.2012 11:50, Matthew Bowman wrote:
>> I've recently found myself in an odd situation. I recently upgraded a
>> package that had an exit code of -3 (Install Shield - missing info in
>> setup.iss file). This was not listed in the package.xml as success so
>> therefore wpkg was not recording the package as installed (it retained
>> the old version). However the package did install correctly. Now when my
>> clients boot (I'm using Wpkg-GP), they upgrade the package again even
>> though the check passes and wpkg should simply mark the package as
>> installed.
>>
>> Conclusion: I believe wpkg.js does not execute the check before
>> attempting an upgrade
>
> This is true. If WPKG discovers a new revision in the package it will
> perform an upgrade - not performing checks before. The reason is
> simple. Many checks just perform checks whether the application is
> installed and do not verify it's version. So if WPKG would perform a
> check before upgrading then most packages will NEVER do an upgrade
> since the checks of the new package will often also return true for
> the old package so WPKG would think the upgrade already took place.
>
I was unaware this was the default behavior. Good to know.
>
>> I believe if a package is going to be upgraded, the the checks
>> associated with that specific revision of the package should be ran just
>> like if that package was going to be installed (not upgraded). If the
>> checks pass, simply mark the package as installed/upgraded and move on.
>> This would prevent a "double upgrade" from happening which is what I am
>> experiencing.
>
> This is true only for packages where the checks do really assure that
> a specific version of a software is installed.
>
> But don't worry, we have thought about this situation already and it
> is already implemented. Just add the precheck-upgrade="always" flag to
> your package.
> e.g.
>
> <package revision="..." precheck-upgrade="always" ... />
>
> This will do exactly as you requested. It will execute checks before
> doing an upgrade in order to determine if the upgrade already took place.
Brilliant! Worked like a charm.

Thanks!
--mgb



More information about the wpkg-users mailing list