[wpkg-users] Behaviour of WPKG

Rainer Meier r.meier at wpkg.org
Wed Jul 29 00:37:03 CEST 2009


Hi Johannes,

Mainly the reason that WPKG might fail to save the settings before an unexpected
reboot initiated by an installer which initiates an immediate reboot instead of
exiting with a proper exit code changed my mind.

I did some changes to wpkg.js in order to make it save the settings file each
time it is modified:
- package successfully installed -> add XML entry -> save
- package successfully removed  -> remove XML entry -> save

Instead I removed the save at WPKG exit. So if there is no change to the
settings it will not be saved at all (which is much more often the case assuming
that you do not deploy new software every time the user reboots).

I did some effort to prevent unnecessary disk access and I think the current
implementation is as least as efficient as the previous while providing you with
immediate save after each package operation. Please keep in mind that in case an
 installer forces an immediate reboot WPKG might have no chance at all to verify
its installation and might fail to add this very last package - so it might be
re-executed on next WPKG execution. However all previously applied changes
(remove/install) will be persisted to wpkg.xml.

So I ask you to test it and report if it works for you as expected.

Changes:

Changes 2009-07-29, v1.1.2-RC6 by Rainer Meier <r.meier (at) wpkg.org>
FIX: The environment set changes done in previous release did not work as$
     expected. WSH does not provide convenient methods to modify the
     environment. Maybe I will find a work-around later...
MOD: Modified bahavior of WPKG whensaving settings (wpkg.xml). Now the settings
     are saved immediately after modification instead of just when WPKG
     terminates. Mainly this helps in case of unexpected reboot (initiated
     outside WPKG) to prevent loss of some progress in case of unexpected
     interruption.
     Thanks to Johannes Brix for open discussion on the mailing list.
MOD: Changed some code to load package environment and and when restoring
     previous environment to prevent some IDE errors (but cscript somehow seems
     to accept the code).

As always the latest testing-release can be found here:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?view=log>

At time of writing 1.1.2-RC6 is the latest version:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=94>



br,
Rainer



More information about the wpkg-users mailing list