===============================================================================
= CHANGES FOR 1.1 release
===============================================================================
Changes 2009-09-26, v1.1.2 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Final release of WPKG 1.1.2

Changes 2009-09-22, v1.1.2-RC19 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed duplicated version read from file if a file version check is used.
NEW: Added environment value expansion for file version values.
NEW: Added environment value expansion for uninstall version values.
NEW: Added environment value expansion for execute check return values.
MOD: Modified message if uninstall check string fails to be used as a regular
     expression.

Changes 2009-09-21, v1.1.2-RC18 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Added check for package revision environment expansion. Expansion is only
     done if the revision string contains two "%" characters which indicates
     an environment definition in the form of %VAR%.
     This should prevent unneeded environment setups and therefore it prevents
     wasting resources.

Changes 2009-09-21, v1.1.2-RC17 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Expands environment variables in package revision. For example
     revision="%PRG_VERSION%" is valid now. Make sure the environment variable
     is defined before you use it.
     Fixes Bug 173. Thanks to Stefan Pendl.

Changes 2009-09-10, v1.1.2-RC16 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed typo in registry equality checks which caused exceptions.
     Thanks to Malte Starostik.
FIX: Fixed some code formatting and typo.
MOD: Updated built-in user notification to fit within the 256 character limit.

Changes 2009-09-05, v1.1.2-RC15 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Added expansion of environment variables in rebootCmd setting.
     Thanks to grubi for request.
     On this occasion I've updated some code to correctly expand
     settings_file_name too (in case no settings_file_path is defined).
     Environment expansion of logfilePattern setting has been added too.

Changes 2009-09-04, v1.1.2-RC14 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Added support for Windows Vista/7 msg.exe-based user notification
     (replaces "net send" messaging on those systems). Unfortunately there are
     some limitations. For example the message is ignored if it is longer than
     256 characters. So be aware and update your config.xml as needed.
     A new option to define a timeout after which the notification disappears
     automatically on those systems has been added (notificationDisplayTime).
     This defaults to 10 which will make the message to be automatically
     discarded after 10 seconds.
     Adresses report 171. Thanks to Ralf Lederle.

Changes 2009-08-29, v1.1.2-RC13 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Changed information-level output to debug-level output in registry equal
     checks if check fails. This avoids unnecessary output in the event log.
     Thanks to Malte Starostik for reporting.

Changes 2009-08-23, v1.1.2-RC12 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Added expression matching to uninstall key scanner. This allows to specify
     a check as follows:
     <check type='uninstall' condition='exists' path='Mozilla Firefox.*' />
     This matches all Firefox versions. In this case the check remains true if
     the user changes to another Firefox versions. Note that in this case WPKG
     would not even complain/reinstall the package if the user downgrades.
     To prevent this you might specify
     <check type='uninstall' condition='exists'
     	path='Mozilla Firefox \(3\.5\.[0-9]*\)' />
     This would allow any Firefox 3.5.x version to be installed by the user.
     Plese note that this does not prevent WPKG to upgrade the package when
     the administrator provides a new version.
     For example the Administrator might install Firefox 3.5.1. Then version
     3.5.2 is released and manually installed by the user. WPKG will accept
     this new version due to the regular expression and will not try to
     re-install (downgrade in this case) to version 3.5.1. But as soon as
     the administrator releases version 3.5.2 officially and increases the
     package version then WPKG will enforce to install the version provided
     by the administrator.
     Please also note that the regular expression you give has to match the
     full string read from the uninstall key. The heading "^" and trailing
     "$" are automatically added to the regular expression.
     This implements change request included in Bug 166.
     Thanks to Stefan Pendl.

Changes 2009-08-23, v1.1.2-RC11 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Added possibility to set execute="changed". This allows you to specify
     packages which are executed only if there are other packages (with
     different execute attributes) processed during this WPKG run.
     If no package is processed an execute="changed" package will not be
     processed at all. This allows one to define packages for actions which
     should run on every change (but not each time like execute="always"
     would).
     Please note: Due to the nature of these packages they form their own
     "group" in the WPKG package tree. All execute="changed" packages are
     executed in the order of priority at the end of the synchronization.
     Packages with lower priority but other execute attribute values are always
     executed before execute="changed" packages (even if the execute="changed"
     package has higher priority).
     Also note that the package using execute="changed" will be processed
     like every other package. So if you define checks which yield true, then
     the package is not installed/upgraded. If you want it to be executed on
     really each system change, then you should not specify any check.
     Addresses feature request as proposed in Bug 168.
FIX: If notify="false" attribute is used WPKG was still notifying users during
     removal. Now WPKG will also not notify users on removal of such packages.
MOD: During install/upgrade/downgrade the user was notified (if notifications
     are enabled) even if the package did not have any commands specified for
     the action to be processed (e.g. upgrade without upgrade commands).
     This has been changed now and the user will be notified only if some
     commands are actually executed.
FIX: Version comparison is now done only once to detect if upgrade or downgrade
     should be performed. This has not been a bug actually but it prevents
     duplicated version checking and prevents redundant log output.

Changes 2009-08-23, v1.1.2-RC10 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed bug where "versionsmallerthan" version comparison on uninstall
     entries almost always returned false.
     Thanks to Falko Trojahn for reporting.

Changes 2009-08-10, v1.1.2-RC9 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Version checks on uninstall enttries could evaluate "true" in case the
     software is not installed at all.
     Fixes Bug 170. Thanks to Malte Starostik for reporting and discussion.

Changes 2009-08-09, v1.1.2-RC8 by Rainer Meier <r.meier (at) wpkg.org>
FIX: The change introduced to save the settings on each change inroduced some
     problems in case the settings (wpkg.xml) are created from scratch.
     In this case the settings were not saved at all until a change (package
     added to or package removed from) was done during WPKG operation.
     This fixes Bug 167. Thanks to Falko Trojahn for reporting.

Changes 2009-07-29, v1.1.2-RC7 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed two more bugs introduced in 1.1.2-RC6 regarding environment
     handling.
     Fixes Bug 164.
     Fixes Bug 165.
     Thanks to Stefan Pendl.

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...

Changes 2009-07-28, v1.1.2-RC5 by Rainer Meier <r.meier (at) wpkg.org>
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).

Changes 2009-07-18, v1.1.2-RC4 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Moved documents to the documents/ sub-folder in order to clean up the root
     directory.
MOD: Small corrections and updates to some documents.

Changes 2009-07-17, v1.1.2-RC4 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed another small problem when locating system locales which could lead
     to an exception in case the "HKCU\Control Panel\International\Locale" key
     does not exist.

Changes 2009-07-17, v1.1.2-RC3 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Retrieving the system locale caused an exception on some systems.
     Thanks to Simon Kelsall for reporting.

Changes 2009-07-10, v1.1.2-RC2 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed a couple of typos. Thanks to Malte Starostik for reporting.
NEW: Added additional output to the status printer (when /sendStatus is
     enabled) when installPackage() performs installation tasks and therefore
     takes some time to finish. This allows external tools to inform the user
     about ongoing actions.
     Thanks to Malte Starostik for the suggestion.

Changes 2009-06-25, v1.1.2-RC1 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Registry path checks can now contain variables in the form of %VAR% too.
     Variable expansion is allowed for the value attribute too. Please note
     that WPKG first tries to locate the unexpanded key and compare unexpanded
     values. For example if you use a registry equal check for the value of
     "%APPDATA%" then it first tries to look for the "%APPDATA%" string and
     only if this value does not exist it will compare the expanded value.
     This allows you to still match REG_EXPAND_SZ values which contain
     variable definitions.
     This should fix Bug 139 as reported on Bugzilla.
     Thanks to "graham" for reporting.
NEW: Variable expansion (see Bug 139) is now supported for uninstall entries as
     as well.

Changes 2009-06-25, v1.1.1 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Final release of WPKG 1.1.1

Changes 2009-06-25, v1.1.1-RC9 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed WPKG quit if a variable definition appears twice (re-defined). For
     example if a variable is defined in profiles.xml and overwritten in
     hosts.xml.
     Thanks to Jindrich Vorlicek for reporting.
     Fixes Bug 156.

Changes 2009-06-19, v1.1.1-RC8 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed typo in install-success notification:
     "Package and all chained packages ininstalled successfully."
     changed to
     "Package and all chained packages installed successfully."
     Thanks to Stefan Pendl for reporting.
     Fixes Bug 163.

Changes 2009-06-18, v1.1.1-RC7 by Rainer Meier <r.meier (at) wpkg.org>
FIX: The /noUpgradeBeforeRemove remove switch was "on" by default. Somehow I
     left that in the code by accident from my testing sessions.
     Thanks to Stefan Pendl for reporting.

Changes 2009-06-17, v1.1.1-RC6 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Updated profiles.xsd. However I could not find a problem with the current
     profile definition but Brian reported on the mailing list that his editor
     throws a validation error. So I changed the definition according to his
     proposal.

Changes 2009-06-15, v1.1.1-RC5 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Updated the list of volatile release markers (see previous change).
NEW: Added the possibility to define "volatileReleaseMarker" parameters within
     config.xml. This allows users to extend the list of volatile release
     markers on-the-fly.

Changes 2009-06-15, v1.1.1-RC4 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Updated version comparison algorithm to treat some version appendixes as
     "volatile". Volatile means that WPKG would claim that a revision witout
     that suffix is newer than the one which carries this suffix. Usually a
     version is assumed to be higher if it has an additional suffix but in case
     of RC (Release Candidate), M (Milestone) and I (Integration) releases it's
     usually the opposite way around. For example:
     A        B              Result
     "1.0RC2" "1.0"          B us newer (A is an "RC" version)
     "1.5"    "1.5I3656"     A is newer (B is an "I"/intgration version)
     "1.5"    "1.5M3656"     A is newer (B is an "M"/milestone version)
     but (still)
     "1.5"    "1.5u3656"     B is newer (B is an update version)

Changes 2009-06-14, v1.1.1-RC3 by Rainer Meier <r.meier (at) wpkg.org>
MOD: The comparison of of version strings the same way how a human would read
     it is quite difficult. Up to now WPKG supported only versions containing a
     sequence of colon-separated digits. The algorithm has been re-worked to
     support much more complicated version strings. Some examples include:
     A        B              Result
     "1"      "2"            B is newer        
     "1"      "15"           B is newer        
     "1.0"    "1.2.b"        B is newer        
     "1.35"   "1.35-2"       B is newer        
     "1.35-2" "1.36"         B is newer        
     "1.35R3" "1.36"         B is newer        
     "1"      "1.0.00.0000"  Versions are equal
     "1"      "1.0"          Versions are equal
     "1.35"   "1.35-2"       B is newer        
     "1.35-2" "1.35"         A is newer        
     "1.35R3" "1.36R4"       B is newer        
     "1.35-2" "1.35-2.0"     Versions are equal
     "1.35.1" "1.35.1.0"     Versions are equal
     Thanks to Jens Geile for asking an improved algorithm.

Changes 2009-06-09, v1.1.1-RC2 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Added a new switch: /noUpgradeBeforeRemove.
     This switch allows to disable the upgrade-before-remove feature.
     Usually WPKG upgrades a package to the latest available version before it
	 removes the package. This allows administrators to fix bugs in the package
	 and assure proper removal.
	 However this feature can lead to (sometimes unexpected) re-execution of
	 packages. For example if execution=always is used the package will run
	 once again before it is finally removed.
	 It's advised to leave this option on default unless you really know what
	 you're doing.
	 Thanks to Simon.
NEW: Unfortunately the %COMSPEC%-wrapping introduced in WPKG 1.1.0 to allow
     STDOUT/STDERR flushing (see Bug 155) does not work in any case as
     expected. Therefore I decided to revert the change and fall back to the
     default execution behavior of WPKG 1.0. This should solve execution and
     return code problems for the moment.
     However the issue that commands which print > 4k to STDOUT/STDERR will
     block and not finish until the timeout has been reached. So make sure
     your installers are (quite-) silent on STDOUT/STDERR or to redirect the
     output to a file or NUL by appending ">NUL 2>&1" to commands which are
     using verbose printing.
MOD: Updated README.TXT in tools/ folder to reflect the truth that the tools
     put into the tools folder are not automatically added to the PATH.
     Thanks to Chris Allen.
MOD: Fixed typo in in database-inconsistency message. Thanks to Gerd Ott.
MOD: Changed Wording after successful installation of a package.
     Thanks to Simon.
MOD: Enhanced variable expansion within <variable /> nodes. If the value
     contains shell variables they are expanded immediately.
     Thanks to Chris Allen for reporting and Stefan Pendl for fix suggestion.

Changes 2009-05-23, v1.1.0 by Rainer Meier <r.meier (at) wpkg.org>
NEW: WPKG 1.1.0 is finally released!
     WPKG 1.1.0 now becomse the stable branch and WPKG 1.0 releases are marked
     as end of life. WPKG 1.1.0 is fully backwards compatible and entirely
     replaces WPKG 1.0. Basically all you need to do in order to upgrade is to
     replace wpkg.js in your installation. It is recommended to migrate
     config.xml too because of a few new prameters.
     Package, host and profile definitions can be kept from previous WPKG
     versions.

Changes 2009-05-20, v1.1.0-M31 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Enhanced getPackageName() to prevent null pointer exceptions if the
     package node passed within the arguments is null. According to the
     documentation it should not throw an exception but return an empty string.

Changes 2009-05-13, v1.1.0-M30 by Rainer Meier <r.meier (at) wpkg.org>
MOD: PsTools of Sysinternals have been taken over by Microsoft. The latest
     version seems to require an additional (undocumented of course) switch
     "-accepteula" in order to prevent a screen displaying the EULA to pop
     up which has to be interactively accepted by the user.
     The work-around for this is to add the "-accepteula" flag to the "special"
     reboot command by default.
     Fixes Bug 159.

Changes 2009-05-09, v1.1.0-M29 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed bug which caused a null-pointer exception when a package marked for
     removal (removed from the profile) was removed from the package tree on
     server side. The bug has been reported in Bug 145.
FIX: Updated regression-test suite which contained some tests which failed
     because they used unix path separator "/" instead of windows "\"
     separator. Problems with this tests have been reported in Bug 145.

Changes 2009-05-06, v1.1.0-M28 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Dependency removal was not fully fixed. Actually the bug has been fixed
     but the fix contained another issue which caused the same exception.
     In fact WPKG was comparing the package name with the package ID during
     the check if the package has been removed already during this session.
     This of course caused WPKG to belive that it's the first time the package
     is attempted to be removed and returned a failure code.
     Fixes Bug 137 and 145.

Changes 2009-04-30, v1.1.0-M27 by Rainer Meier <r.meier (at) wpkg.org>
FIX: WPKG was ignoring the command-line parameter /log_file_path:<path>.
     This bug was not affecting log_file_path property set in config.xml.
     Fixes Bug 157.
     Thanks to Luca Manganelli.

Changes 2009-04-28, v1.1.0-M26 by Rainer Meier <r.meier (at) wpkg.org>
FIX: STDOUT/STDERR flushing code did not work for non-cmd/%COMSPEC% based
     installer scripts. Unfortunately on Windows it looks like the I/O re-
     director parameters ">" or "2>" need to be handled by the application
     and not by the shell/OS. As a result appending ">NUL" caused invalid/
     unknown arguments to be passed to some commands (like msiexec). As a
     work-around WPKG is now executing all commands within a %COMSPEC% shell
     unless they already use STDOUT & STDERR redirectors.

Changes 2009-04-27, v1.1.0-M25 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed a problem where removing the same package multiple times during one
     session ended in a null pointer exception. This could have happened if
     packages with dependencies are removed and therefore the packages which
     depend on the removed package is removed too.
     In case a package is removed two times now WPKG will detect it. In case
     the package has been removed successfully during this session the remove
     function returns successful state.
     Fixes Bug 137 and 145 I hope.

Changes 2009-04-26, v1.1.0-M24 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Added work-around for STDOUT/STDERR flushing problem. Unfortunately
     reading from output streams is terribly broken in WSH. Reading output from
     the streams blocks if the process does not write to the stream.
     Even reading the "AtEndOfStream" property blocks which makes it impossible
     to read from a stream which receives data without blocking the application.
     As a work-around WPKG now makes sure STDOUT/STDERR is redirected to NUL
     to discard them completely. Well, if your command includes the strings
     " >" or " 2>" WPKG will not replace them by NUL redirects. This means you
     can still redirect the output manually to files (or redirect to NUL by
     yourself). The code just makes sure that output which would be discarded
     anyway is not even sent to the buffers.
     The drawback of this work-around is that it is not possible to capture the
     output from within WPKG and therefore it will not appear within the logs.
     However this is the same behavior as all WPKG versions (except 1.1.0-M21)
     had. So no big loss. 
     Fixes Bug 155.

Changes 2009-04-22, v1.1.0-M23 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Italian LCIDs added to configuration (config.xml).
     Thanks to Marco Gaiarin.

Changes 2009-04-12, v1.1.0-M22 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Improved file downloading. Different versions of MSXML use different
     factories. Now WPKG supports multiple factories.
MOD: Re-arranged download functions to avoid false-positive warning by
     Avira AntiVir where WPKG was wrongly recognized as HTML/ADODB.Exploit.Gen.

Changes 2009-04-11, v1.1.0-M21 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Unused Array removed from getPackageDependencies() function. Seems to be
     some left-over from a testing session.
     Fixes Bug 154. Thanks to Jason Oster.

Changes 2009-04-11, v1.1.0-M20 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Writing log events to event log with null value might fail due to the
     fact that WshShell.logEvent() method does not accept null values
     directly. Now the string "null" will be logged in such case.
     Fixes Bug 135.

Changes 2009-04-11, v1.1.0-M19 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Added flushing of STDOUT and STDERR during exec(). Due to strange
     behavior of WSH a command might block if the buffer for STDOUT/STDERR
     is full. Now WPKG flushes this buffer every second and prints its
     contents to the debug log. This also allows you to see the console
     output of the executed command if any.

Changes 2009-04-11, v1.1.0-M18 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed possible errors when a package is removed twice during the same
     session. This could happen if a package depends on multiple other
     packages which are removed during a WPKG session.
     Fixes Bug 153. Thanks to Jason Oster.

Changes 2009-04-10, v1.1.0-M17 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed loading of package-specific environment for remove commands.
     Previously environment variables set for a package have been unavailable
     to remove commands.
     Fixes Bug 146. Thanks to Jason Oster.
FIX: Fixed packages.xsd - type of some elements was wrongly set to String.
     Now correctly refers to packageReference where appropriate
     (chain, depends, include).
     Fixed 'type' attribute of 'check' element to be specified in lower case.

Changes 2009-04-10, v1.1.0-M16 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Changed misspelled word "referemces" to "references"
     Changed quoting in "Removal of <package> successful." message.
     Fixes Bug 152. Thanks to Jason Oster.

Changes 2009-04-08, v1.1.0-M15 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Modified message when removing depending package from
     Removal of depending package package '<package-id'> ...
     to
     Removal of depending package '<package-id'> ...
     Fixes Bug 151.. Thanks to Jason Oster.

Changes 2009-04-07, v1.1.0-M14 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed removal of package dependencies by fixing up removePackage() return
     value. Anyway by definition it should return the success state according
     to the documentation which was not the case yet.
     Fixes Bug 150. Thanks to Jason Oster.

Changes 2009-03-29, v1.1.0-M13 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Fixed typo when reading fixed IP adresses from registry. It looks like
     it did not have any effect on the functionality.
     Changed
     var fixedIPs = getRegistryValue(regBase, "IPAddress").toArray();
     to
     var fixedIPs = getRegistryValue(regBase + "IPAddress").toArray();
     Thanks to Alan for reporting it.
NEW: Added possiblity to chain packages. Use the following synatx:
	 <chain package-id="some-id" />
	 A chained package is pretty much similar to the
	 <depends package-id="some-id" />
	 functionality but chained packages are installed right after the package
	 which specifies the chain.
	 Personally I prefer to set a dependency on the "chained" package to assure
	 that the "chaining" package is installed _before_ the package which
	 depends on it.


Changes 2009-03-29, v1.1.0-M12 by Rainer Meier <r.meier (at) wpkg.org>
MOD: Updated source to be readable by Eclipse JSDT. This will be my primary
     development environment now.
     The change already helped me to identify a bunch of unused code and to
     improve code quality in general.

Changes 2009-03-29, v1.1.0-M11 by Rainer Meier <r.meier (at) wpkg.org>

MOD: Changed behavior of wpkg.js again in case reboot is overridden.
     Previously it was exiting with exit code 3010 but this caused WPKG client
     to initiate a reboot immediately after wpkg.js terminated.
     Now WPKG returns code 3010 << 8 (3010 bit-shifted by 8 bits to the left)
     which evaluates to a decimal value of 770560. This allows an external
     tool to verify if a reboot was initiated but overridden.
     If you would like WPKG to exit with code 3010 without issuing a reboot
     consider to specify a reboot command within the configuration
     (see rebootCmd in config.xml or /rebootcmd: switch) which points to a
     script which does not do anything. In this case WPKG executes the script
     (e.g. reboot.cmd) and then exits with code 3010.
     This was discussed in Bug 132.
FIX: Fixed invalid env-splitting introduced in earlier pre-release version.
FIX: Fixed environment setup for package install/remove/upgrade.
FIX: Package IDs wrongly read from profile.
FIX: Fixed recursive dependency tree build introduced in previous milestone
     checkin.
FIX: Fixed error if profile does not have any packages assigned.
NEW: Shows usage if executed without parameter (instead of just throwing an
     error and exiting).
MOD: Improved documentation.


Changes 2009-03-12, v1.1.0-M10 by Rainer Meier <r.meier (at) wpkg.org>
FIX: In case a command is executed which does not exist (WScript.Shell.exec()
     throws exception) WPKG does not immediately terminate.

Changes 2009-02-16, v1.1.0-M9 by Rainer Meier <r.meier (at) wpkg.org>
FIX: After quite an intensive search I migrated my development tools from
     JSEclipse to Eclipse JSDT (JavaScript Development Tools). Unfortunately
     it does not yet fully support all WSH classes because it's mainly targeted
     to be used for Ajax and Web development and used for scripts running
     within IE and Firefox. However it provides syntax checking, type and style
     checks. Unfortunately this means I had to re-write some parts slightly in
     order to get rid of errors/warnings yielded by JSDT within parts of the
     code which was accepted by Microsoft JScript interpreter. However I think
     this slightly improved the quality of the code and will for sure help
     avoiding unnecessary mistakes in the future. 

FIX: Removed unnecessary check for undefined checks in getPackageChecks()
     method. It seems that selectNodes(String) never returns null but instead
     returns empty collection.

Changes 2008-05-11, v1.1.0-M8 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Updated help and config.xml with grammar and consistency fixes as proposed
     by Jens Geile. Thanks Jens. Fixes Bug 116.


Changes 2008-05-08, v1.1.0-M7 by Rainer Meier <r.meier (at) wpkg.org> (not released)
NEW: Variables now supported for all package actions (install, remove upgrade,
     downgrade, check). This issue was reported on the mailing list.

FIX: Fixed missing quote in debug output. Changed
     Found package node "'Package name (PackageID) in package database "
     to
     Found package node "'Package name' (PackageID) in package database."
     Thanks to Jens Geile for reporting it. Fixes Bug 115.


Changes 2008-04-24, v1.1.0-M6 by Rainer Meier <r.meier (at) wpkg.org>
NEW: File size checks were broken due to faulty code in get file size method
     which was modified to support expanding of environment variables.
     WPKG 1.0 is not affected. This fixes Bug 112. Thanks to Daniel Dehennin!


Changes 2008-04-21, v1.1.0-M5 by Rainer Meier <r.meier (at) wpkg.org>
NEW: Improved handling of event log system errors. In case writing to event log
     causes an exception WPKG will not exit silently any more but fall back to
     write to STDOUT and log to the log file as appropriate (depending on log
     level). Thanks to Brian May for reporting and debugging.
     This fixes Bug 109.


Changes 2008-04-10, v1.1.0-M4 by Rainer Meier <r.meier (at) wpkg.org>
FIX: Fixed Bug 107. Registry equality checks throw an error in case of checked
     value is of type REG_DWORD or REG_BINARY. Now the values are converted to
     strings before comparing it to the 'value' attribute. REG_MULTI_SZ and
     REG_BINARY values are concatenated using newline characters. For
     REG_BINARY values each octett is converted to its decinal number
     representation. Examples:
     REG_MULTI_SZ = a
                    b
                    c
     value = "a
     b
     c"
     will match.
     REG_BINARY values will be converted to multiline string as well. Each octett of the binary value
     is converted to its decimal representation.
     REG_BINARY = "11 22 33 44"
     value = "17
     34
     51
     68"
     will match.

MOD: Misleading/confusing info message about non-zero exit code (even if exit
     code was 0) changed from:
     Command '<cmd> returned non-zero exit code [<code>]. This exit code...
     to
     Command '<cmd>' returned exit code [<code>]. This exit code...
     The quoting has been fixed as well (see above).

MOD: Download XML nodes are now allowed as sub-nodes of any command (install/
     upgrade/downgrade/remove). This allows you to specify a download which is
     only downloaded for a specific command. This was implemented since it
     usually makes no sense to download the installation package again right
     before the remove commands are executed (which usually runs a local
     uninstall command which does not need the original installer).
     Specifying a download XML node on the global package level (not below a
     specific command definition) is still allowed. Such downloads will be
     executed regardless of the command to be executed. So you can specify some
     global downloads which are executed in any case.
     Note: If multiple install (or upgrade/downgrade/remove) commands are
     specified WPKG will download the the files of all command nodes of the
     same kind before starting to execute the commands in sequence.
     Example:
     <package...>
     <donwoad url="http://example.org/package.exe" target="package.exe" />
     <install cmd="%TEMP%\file.exe some arguments" ...>
       <donwoad url="http://example.org/file.exe" target="file.exe" />
     </install>
     <install cmd="%TEMP%\file2.exe some arguments" ...>
       <donwoad url="http://example.org/file2.exe" target="file2.exe" />
     </install>
     <upgrade cmd="%TEMP%\update.exe arguments" ...>
       <donwoad url="http://example.org/update.exe" target="update.exe" />
     </upgrade>
     </package>
     This definition will simply download "package.exe" (global). "file.exe"
     and "file2.exe" right before the install commands are executed in
     seuence.
     In case of upgrade it will download "package.exe" (global) and
     "update.exe" before executing the upgrade command(s).

NEW: Checks of type 'execute' allow to use environment variables within the
     'path' attribute now. For example the following specification is valid
     now:
     "%SystemRoot%\mycheck.cmd"


Changes 2007-04-05, v1.1.0-M3 by Rainer Meier <skybeam (at) users.sourceforge.net>
NEW: Package uninstall checks have been extended. The following values are now
     valid:
     type="uninstall" path="prg" condition="versionsmallerthan" value="1.1"
             Check if version is smaller than the specified value

     type="uninstall" path="prg" condition="versionlessorequal" value="1.1"
             Check if version is less or equal than the specified value

     type="uninstall" path="prg" condition="versionequalto" value="1.1"
             Check if version is exactly equal to the specified value

     type="uninstall" path="prg" condition="versiongreaterorequal" value="1.1"
             Check if version is greater or equal to the specified value

     type="uninstall" path="prg" condition="versiongreaterthan" value="1.1"
             Check if version is greater than the specified value

     The version is compared to the DisplayVersion value within the uninstall
     entry within the Windows registry.
     Changes are based on a patch by Richard de Vos. Thanks!

NEW: Added new check type: "execute". This allows you to execute any script
     which checks if an application is installed - based on the exit code of
     the script.
     Usage:
     type="execute" path="\\path\to\script.cmd"
         condition="exitcodesmallerthan" value="0"
             Evaluates true if the exit code is negative

     type="execute" path="\\path\to\script.cmd"
         condition="exitcodelessorequal" value="0"
             Evalueates true if exit code is 0 or negative

     type="execute" path="\\path\to\script.cmd"
         condition="exitcodeequalto" value="0"
             Evaluates true only if exit code is exactly 0

     type="execute" path="\\path\to\script.cmd"
         condition="exitcodegreaterorequal" value="0"
             Evaluates true if exit code is 0 or any poitive number

     type="execute" path="\\path\to\script.cmd"
         condition="exitcodegreaterthan" value="0"
             Evaluates true if exit code is any positive number

     This type of check also allows very complex checks. For example there is a
     limitation of the RegRead method used by WPKG to query registry values
     which contain backslashes '\'. Now you can execute a batch script which
     checks for such registry values using 'reg query ...'.

NEW: Added download extension as initially proposed by Tomasz Chmielewski (with
     some changes). A download definition is specified as follows:
     <download url="http://server.domain.tld/path/to/file.msi"
     target="subdir/file.msi" timeout="7200" />

     The 'timeout' attribute is entirely optional. It defaults to the value of
     'downloadTimeout' as specified within config.xml (7200 if not omitted).
     The value is specified in seconds.

     The 'target' attribute specifies a path relative to the 'downloadDir' as
     specified within config.xml (defaults to '%TEMP%' if omitted).
     NOTE: You need to specify the full file path, including the file name, not
     just a directory name!

     So to install the package above could be installed by the following
     install command definition:
     <install cmd="msiexec /qn /i %TEMP%\subdir\file.msi">

NEW: Added downgrade command nodes. These commands are executed if the version
     installed on the client is newer thant the one on the server side.
     Example:
     <downgrade cmd="&quot;\\Store1\Mozilla\Firefox Setup 2.0.0.12.exe&quot; /S"/>

NEW: Added /sendStatus flag and 'sendStatus' configuration parameter in
     config.xml. The parameter allows to enable printing of status information
     to STDOUT in order to be parsed by the calling program (e.g. WPKG client).
     This allows the calling program to display some status messages about the
     synchronization process.
     The status update might not be very linear depending on the package sizes
     but at least it allows to display the start time (and therefore also
     elapsed time to the user. So the user can see at least how many percent of
     packages have been synchronized already and for how long the current task
     is running currently.
     Users usually feel much less annoyed when waiting for a task to be
     finished if there are at least some screen updates and a kind of progress
     bar which is updating from time to time.
     Note: STDOUT was chosen due to the fact that I was unable to find a way to
     write to named pipes from JScript yet. However the implementation could
     easily be adapted to pipes or sockets.
     I also updated wrapper.js to read STDOUT of the called wpkg.js and print
     it to its own STDOUT. This required if WPKG client is going to read the
     output of wpkg.js, in that case output needs to be "chained" to be
     forwarded to the GUI.


Changes 2008-02-18, v1.1-M2 by Rainer Meier <skybeam (at) users.sourceforge.net>
FIX: Included cosmetic fix for Bug 104 (opening quotation missing).
     This fix adds a missing opening quotation in debug output when a new
     package is added to the local settings node (after installation success).
FIX: Fixed Bug 103. /help screen is not showing up if config.xml is missing and
     null-pointer exception is thrown.


Changes 2007-01-14, v1.1-M1 by Rainer Meier <skybeam (at) users.sourceforge.net>
NEW: removePackage now removes all packages which depends on the one to be
     removed as well (recursively). This assures that after poackage uninstall
     no packages are left installed which miss their required dependency.
     Please note that if a package which depends on the one to be removed
     specifies an immediate reboot the reboot takes place right after the
     this package has been removed. In such case the package initially
     requested to be removed will still be there after the reboot.
     To avoid this it is possible that depending packages use the postponed
     reboot functionality. Alternatively you can use the /noreboot switch
     to advice WPKG to ignore each reboot request. Note that in such cases
     some packages will not properly finish their uninstall procedure.
     In case removing of any package from the dependency tree fails WPKG
     will stop uninstalling and print a message. In such case the package
     you requested to remove will still be there because there is at least one
     more package which depends on it. You can advice WPKG to remove the
     requested package in any case by using the /force switch. Warning: In such
     case it might happen that some packages depending on the removed one could
     not be removed and therefore will be left on the system (probably not
     working any more).
