Skip to content

Releases

WPKG 1.4.0

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

WPKG 1.3.2

Choose a tag to compare

@EvilFreelancer EvilFreelancer released this 08 Sep 16:20
3d8adcd

First release since 1.3.1 (2017). It collects the contributions that landed on master plus a fix for the host matching by IP address.

New

  • Extended host attribute matching by makemodel and serial, so host definitions can select machines by the model and the serial number reported by the BIOS. Thanks to Shannon Brooks.
  • Checks of type execute accept a download element. Global package downloads happen just before the first command and are therefore too late for a check. Thanks to Kunzol.
  • Checks of type execute accept a timeout attribute, working the same way as the timeout of an install command. Thanks to Marco Schmidt.
  • New macaddresses extended host attribute listing the MAC addresses of the physical network adapters. Thanks to Kunzol.
  • A Node.js test harness which loads wpkg.js into a VM context with stubbed Windows Script Host globals, so single functions can be tested on any platform. Run it with node --test "tests/*.test.js".

Fixed

  • Only addresses of network adapters which are currently connected are reported as addresses of the host. Windows keeps the last address of an adapter in the registry after its link went down, so a machine which had been connected at another site kept matching the host definition of that site. The connection state is read from WMI; machines where it cannot be determined keep the previous behaviour and report every address found in the registry. Fixes #5, reported by InformatiqueOLLN.
  • The DHCP placeholder address 0.0.0.0 is no longer reported as an address of the host. It was already ignored for statically configured addresses.

Upgrading

Replace wpkg.js on the share. No configuration change is required. Host definitions which relied on the address of a disconnected adapter will stop matching, which is the point of the fix.

Full changelog: 1.3.1...1.3.2