Skip to main content

Module windows

Module windows 

Source
Expand description

Installs and removals on Windows: winget’s packages, WSL’s own installer and Hyper-V’s Windows feature (DISM), each elevated through Windows’ own UAC prompt, and HashiCorp’s signed MSI for VMware’s utility. A declined prompt exits ERROR_CANCELLED (1223), which reads as cancelled (super::exit_codes::Known::Cancelled).

winget is never told to accept anything for its user: no --accept-package-agreements, no --accept-source-agreements. No package a setup installs, nor the winget source, has an agreement today; one that asks for it stops the install, and its user accepts it running winget themselves (super::exit_codes::Known::AgreementToAccept). Docker’s manifest adds --accept-license to its installer’s switches, so Docker’s are given in full instead (DOCKER_SWITCHES): Docker Desktop shows its agreement at its first start.

Constants§

DOCKER_SWITCHES
Docker Desktop’s installer switches, in place of its winget manifest’s (install --quiet, and --accept-license --backend=wsl-2 --no-windows-containers as its custom ones): the same but --accept-license, which would accept Docker’s Subscription Service Agreement for its user.

Functions§

install
The install of dep on Windows, on a CPU arch: its winget package, or WSL’s, Hyper-V’s and VMware’s utility’s own elevated installers.
uninstall
The removal of dep on Windows: its winget package, VMware’s utility by its MSI’s product code; the Windows features are their user’s to turn off in Windows Features.
winget
winget <verb> <id>, from the winget source alone. Without --source, winget asks every source it has, the Microsoft Store’s (msstore) too, and one that fails stops the command: on a clean Windows 11 the Store source’s certificate pinning failed (0x8a15005e, “The server certificate did not match any of the expected values”) and Docker Desktop’s install with it. Every package a setup installs is in the winget source.