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 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.
And no, due to the reasons above "always" will not be the default. In Most cases
such a pre-check is not desired. Please make sure that your package where you
enable precheck-upgrade does perform a very clear check for the application
version. This check shall fail for the old version but succeed for the new
version. For example this is true if you check for uninstall entry which has the
version number inside the entry. Like checking for "Audacity 1.2.6".
In particular checking for something like "Pidgin" would be insufficient as WPKG
would never ever perform an upgrade of Pidgin since the check would be true for
the old and the new version. So for applications like Pidgin you would have to
add additional checks to verify by uninstall version, binary version, file size,
file date or whatever in order to allow WPKG to distinguish whether the update
is done properly already.
br,
Rainer
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users