[wpkg-users] how to safely copy wpkg.xml to a central UNC location when using Wpkg Agent (for after-processing with wpkgCreateReport)

Rainer Meier r.meier at wpkg.org
Thu Jan 26 16:47:43 CET 2012


Hi,

On 26.01.2012 14:32, Malte Starostik wrote:
> assuming agent == service, that service itself does not lock the file.  If
> anything does, it's wpkg.js.  Thus, if you configure the service to execute a
> batch file containing the above as a post-execute script, you should be all
> set.

This is correct. But WPKG does also not lock the file while processing. It reads 
the file at initialization and then writes a new one quickly when there was any 
change applied to the system (package installed/upgraded/downgraded/removed). In 
between you can do anything you like with wpkg.xml.

So there are people (including me) using a simple WPKG package to copy the file 
to the server. Simple Example:

<package id='WPKG-XML' name='WPKG XML backup' revision='1' priority='10' 
reboot='false' execute='always' >
   <!-- Backup copy of WPKG XML files -->
   <install cmd='"%SOFTWARE%\software.free\wpkg-xml\copy-xml.cmd"' />
   <upgrade cmd='"%SOFTWARE%\software.free\wpkg-xml\copy-xml.cmd"' />
</package>


Well, just use any command in the install section. The execute='always' 
attribute will make WPKG to run the package at any synchronization. So it will 
execute the install commands every time. I just use a simple cmd script do do 
it. Feel free just to use the one-liner you already posted.

Recent versions of WPKG also support execute="changed" attribute - so it will 
execute the copy action only if there were any system changes performed. So for 
example if there were no changes to your system it will also not copy wpkg.xml.

Use a low priority for the package to make sure it's executed at the end (after 
all modifications). This assures that changes applied during this WPKG session 
are already included in the copy.


br,
Rainer



More information about the wpkg-users mailing list