* FIX: Removed echo statement which I used for debug purposes.
* NEW: Allowing matching of IP-addresses within the profile name now. The
* format has to be specified as follows:
* Re-Used code from scanUninstallKeys() to retrieve IP address from the
* registry. According to my knowledge there is no direct interface within
* WScript to access the local IP adress(es).
* FIX: Fixed some null reference problems in case package DB is inconsistent.
* FIX: Fixed bug where a package referenced within the profile but neither
* installed (available in wpkg.xml) nor within the package database
* (packages.xml) caused a null pointer exception.
* MOD: Sorting setting nodes before saving settings. This allows easier diff
* of XML files on server. See
* <http://wpkg.org/Viewing_software_installed_on_workstations> * for more information.
* MOD: Fixed some typo and output cosmetics reported by Falko Trojahn.
The IP-based profiles are completely new and implemented according to the ToDo
list at http://wpkg.org/TODO_list. The priority is as follows:
1. Direct match (if hostname matched exactly an entry from hosts.xml)
2. IP-based match (if hostname is in specified IP-range format matches against
any IP-address available at the host).
3. Regular-expression match.
NOTE: Unfortunately I was not able to figure out an easy way of retrieving the
hosts IP adresses by WScript objects. The workaround currently reads the values
from the registry. It checks weather DHCP is enabled and reads the
corresponding value. I hope this works stable but I feel that it might not work
any more with a changed TCP/IP stack with different Tcpip service
implementation. This might already be true for Vista (I did not check). In any
case the script will not crash or behave inexpectedly. It will simply skip
IP-based matching and continue with regular expression matching.
The sorting of XML nodes within the local wpkg.xml was done to allow
administrators to easily diff the resulting XML files on the server. In case
the packages were applied in different order this could result in different
wpkg.xml sort order before which makes it hard to textually diff the resulting
The sorting code has been re-used from the synchronization. I considered
implementing quicksort but then decided that it might bring little advantage.
So I left the bubble-sort algorithm for the moment.
I included the log output typo fixes of Falko as well.