A Go port of PSAppDeployToolkit (PSADT) v4 — a toolkit for building Windows application deployments. It provides deployment session management, CMTrace logging, localized user dialogs, deferral logic, MSI helpers and a broad set of Windows system utilities, as an importable Go SDK plus a CLI runner.
Windows-only at runtime. The toolkit targets
GOOS=windows(amd64/arm64). It cross-compiles and unit-tests its portable logic on any platform; the syscall layers only execute on Windows.
Every exported function is a 1:1 port of the PSADT PowerShell function of the same name with the hyphens removed, so existing deployment scripts translate mechanically:
| PowerShell (PSADT) | Go (adt) |
|---|---|
Open-ADTSession |
adt.OpenADTSession |
Start-ADTMsiProcess |
adt.StartADTMsiProcess |
Show-ADTInstallationWelcome |
adt.ShowADTInstallationWelcome |
Copy-ADTFile |
adt.CopyADTFile |
Set-ADTRegistryKey |
adt.SetADTRegistryKey |
PowerShell-runtime plumbing (Initialize-ADTFunction, New-ADTErrorRecord, …)
has no Go counterpart; the *-ADTModuleCallback family is replaced by
SessionHooks, and New-ADTTemplate is provided by adt new.
A deployment is a small Go program describing its phases — the analogue of
PSADT's Invoke-AppDeployToolkit.ps1:
package main
import (
"context"
"github.com/deploymenttheory/go-appdeploymenttoolkit/adt"
)
func main() {
(&adt.Deployment{
Session: adt.SessionOptions{
AppVendor: "VideoLAN",
AppName: "VLC media player",
AppVersion: "3.0.23",
AppProcessesToClose: []adt.ProcessObject{{Name: "vlc", Description: "VLC media player"}},
},
PreInstall: func(ctx context.Context, s *adt.DeploymentSession) error {
_, err := adt.ShowADTInstallationWelcome(ctx, adt.ShowADTInstallationWelcomeOptions{
CloseProcesses: s.Options().AppProcessesToClose, AllowDefer: true, DeferTimes: 3,
})
return err
},
Install: func(ctx context.Context, s *adt.DeploymentSession) error {
_, err := adt.StartADTMsiProcess(ctx, adt.StartADTMsiProcessOptions{
Action: "Install", Path: "vlc.msi",
})
return err
},
}).Run(context.Background())
}Build it for Windows and run it with the standard PSADT frontend flags:
GOOS=windows go build -o Invoke-AppDeployToolkit.exe
Invoke-AppDeployToolkit.exe -DeploymentType Install -DeployMode InteractiveThe adt command is the analogue of Invoke-AppDeployToolkit.exe:
adt run <package-dir>— run a deployment package. WhenFiles/holds a single MSI, it drives the zero-config install/uninstall/repair flow with no author code.adt new <dir> --name MyApp— scaffold a package (Files/,SupportFiles/,Config/,Strings/,Assets/, ago.modand a deploymentmain.go).
go install github.com/deploymenttheory/go-appdeploymenttoolkit/cmd/adt@latest
adt run ./MyPackage --deployment-type Install --deploy-mode Silent- Package config lives in
Config/config.yaml, mirroring PSADT'sconfig.psd1section structure (Assets, MSI, Toolkit, UI); embedded defaults are used when it is absent. - String tables ship for all 26 PSADT cultures plus English; override via
Strings/strings.yaml.
Interactive dialogs render through Microsoft Edge WebView2 (via the CGo-free
jchv/go-webview2), with a native MessageBox/TaskDialog fallback when the
WebView2 runtime is absent. Deployments running as SYSTEM show dialogs in the
interactive user session via a same-binary client re-exec over anonymous pipes.
adt/ public SDK — all ~169 ported functions (one file per category)
internal/ domain implementations behind portable seams
cmd/adt/ CLI runner (run / new / client)
examples/ runnable deployment programs
tools/ the psd1→YAML converter for config and string tables
All five porting phases are complete: core session engine, system domains
(registry, filesystem, INI, process, MSI, services, shortcuts, users), UI and
cross-session client-server, CLI runner, and the long tail. See
docs/windows-smoke.md for the manual Windows
verification checklist (the syscall layers are cross-compiled and linted here
but only execute on Windows).
go-bindings-win32— generated Win32 API bindings (MSI, WTS, registry, shell, tasks, …).go-bindings-wmi— typed WMI runtime (ConfigMgrTriggerSchedule,Win32_QuickFixEngineering).
See LICENSE.