Skip to content

WPKG 1.4.0

Latest

Choose a tag to compare

@EvilFreelancer EvilFreelancer released this 08 Sep 18:06
f4bf524

Maintenance release. It repairs the XML schemas, which have not compiled since the download element was added to the execute check, fixes three defects in wpkg.js and puts the project under a test suite and CI.

Fixed

  • The XML schemas did not compile at all. The download element of the execute check was declared after the attributes inside an xsd:restriction and referenced wpkg:download, a type which does not exist in wpkg.xsd. Every other schema imports wpkg.xsd, so no configuration file could be validated against packages.xsd, profiles.xsd, hosts.xsd or config.xsd. The download type moved to wpkg.xsd, the generic check type learned the download element and the timeout attribute, and the execute check restricts them properly. All configuration files of the repository validate again.
  • trim() stripped the leading whitespace only, its regular expression was missing the global flag. WMI reports the operating system caption, the make and model and the serial number with trailing spaces, so a host definition matching them with an anchored expression such as serial="^PF1A2B3C$" never matched.
  • hex() printed 0 as 100000000. The value appears in the messages reporting a failed operation.
  • resetHostInformationCache() kept the cached MAC addresses while it dropped every other host attribute.

Added

  • A test suite of 110 tests, up from 10, covering the decision making of wpkg.js: version comparison including the volatile release markers, ISO date parsing in both range modes, host attribute matching (makemodel, serial, macaddresses, the locale lists, the environment conditions), conditional node filtering, the package and command accessors, the checks of type registry, execute, host and logical, and the network adapter queries. The harness gained stubs for Scripting.Dictionary and WScript.Shell, and XML nodes are built by tests/xmlstub.js instead of being parsed. Run it with node --test or npm test, which replaces the node --test "tests/*.test.js" of 1.3.2, a command current Node.js releases reject.
  • An examples/ directory with commented definitions: an MSI package with exit codes and reboot handling, a check running a downloaded script, one package adapting to architecture, locale, hardware and network, host matching by model, serial number, MAC address and environment, and profile inheritance. All of them validate against the schemas.
  • A GitHub Actions workflow running the suite on Node.js 20, 22 and 24 and validating the sample and example configuration against the schemas.
  • A rewritten README.md, packaging metadata in package.json and composer.json, a root LICENSE and .gitattributes pinning the line endings.

Upgrading

Replace wpkg.js on the share. No configuration change is required.

One behaviour changes: host attributes are compared without their trailing whitespace now. A host definition which worked around the old behaviour, for example serial="^PF1A2B3C\s*$", keeps matching, but one which relied on the trailing spaces being present will not.

Full changelog: 1.3.2...1.4.0