Skip to content
Carlos Hernandez edited this page Jul 13, 2026 · 1 revision

Nupkg (Chocolatey / NuGet)

The nupkg format builds a Chocolatey package for plain executables put on PATH. Chocolatey automatically shims every tools/*.exe in an installed package, so choco install <name> makes your exe callable from any shell with no install script to write. That auto-shim is the whole scope: v1 packages a CLI (or several), nothing else.

embala writes the package (an OPC zip — a nuspec, some bookkeeping parts, and a tools/ payload) directly. No choco, NuGet client, or .NET is needed to build, and builds are byte-reproducible: fixed entry order and pinned timestamps.

The package is dual-targeted: it installs on Chocolatey (verified on real Windows) and is built to generic NuGet V3 feed conventions. The V3 side — how a server renders the embedded icon/license and serves the package — is a design target, not something embala verifies. Treat the V3 claims below as "built to spec", and spot-check your own feed before you rely on its rendering.

The artifact is named <name>-<version>.nupkg (from [package].name and [package].version), written into your output directory.

See Getting-Started for the build command and Configuration-Reference for the full embala.toml schema.

Two styles

The [nupkg] style field picks how the payload reaches the machine.

embedded download
Where the binary lives Inside the .nupkg under tools/ Fetched from a URL at install time
Generated files VERIFICATION.txt (SHA-256 of every embedded file) + LICENSE.txt (when [package].license is set) chocolateyinstall.ps1 that downloads into tools/
files One or more entries; each dest names the file under tools/ Exactly one entry; its dest names the downloaded file
url / checksum Not allowed Both required (checksum = sha256, 64 hex chars)
Package size Carries the binaries Small — only the install script

Both styles end up the same way on the machine: the executable lands in the package's tools/ directory and Chocolatey shims it onto PATH.

embedded

The binaries ship inside the package. embala reads each file, packs it under tools/, and generates two companion files:

  • VERIFICATION.txt — Chocolatey requires this whenever binaries ship inside a package. embala writes a statement that the publisher built the binaries, lists every embedded file with its SHA-256, and gives the checksum -t sha256 <file> command to re-check them.
  • LICENSE.txt — written only when [package].license is set. Names the license and points "Full license text:" at [nupkg].license-url (falling back to [package].homepage) when either is present.
[package]
name = "hello"
display-name = "Embala Hello"
version = "0.1.0"
identifier = "ca.hrndz.embala.hello"
publisher = "Carlos Hernandez"
description = "A friendly greeter"
license = "MIT"

[nupkg]
style = "embedded"
files = [{ src = "dist/hello.exe", dest = "hello.exe" }]

Dest rules (build fails otherwise): a dest must be a relative, /-separated path with no empty or .. segments; two files may not share a dest; and license.txt / verification.txt are reserved (they collide with the generated files, case-insensitively).

download

The package carries only a generated chocolateyinstall.ps1. At install time that script calls Chocolatey's Get-ChocolateyWebFile to fetch your url, verify it against checksum (as sha256), and save it into tools/ under the name your single files entry's dest gives it — where the shim machinery picks it up exactly like an embedded payload.

[nupkg]
style = "download"
url = "https://example.com/downloads/hello-0.1.0-win64.exe"
checksum = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
files = [{ src = "dist/hello.exe", dest = "hello.exe" }]

src is still required on the entry (it is a shared config type), but for the download style only dest is used — the downloaded file is renamed to it.

Config errors, exact messages:

  • style = "download" with a missing url or checksum → nupkg: style "download" requires both url and checksum.
  • url/checksum set under style = "embedded" → nupkg: url/checksum are only valid with style "download".
  • style = "download" with anything other than one files entry → nupkg: style "download" needs exactly one files entry (its dest names the downloaded payload), got N.
  • A checksum that is not 64 hex chars → nupkg checksum must be 64 hex chars (sha256), got … (build time).

Install and uninstall

choco install <name>
choco uninstall <name>

Chocolatey owns the whole lifecycle. On install it creates the PATH shims for every tools/*.exe; on uninstall it removes those shims and the package's tools/ directory itself. There is no custom uninstall script — none is generated, needed, or supported. This is the deliberate v1 scope: plain PATH executables, with Chocolatey doing the install/remove work natively.

Metadata

Package metadata comes from [package] (fields shared across all embala formats) and [nupkg] (Chocolatey-specific fields). embala emits each nuspec element only when its source field is present.

nuspec element Config field Notes
id [package].name Also the artifact file name
version [package].version Numeric x.y.z
title [package].display-name
authors [package].publisher
license [package].license SPDX id, emitted as <license type="expression">
licenseUrl [nupkg].license-url
projectUrl [package].homepage
projectSourceUrl [nupkg].project-source-url
packageSourceUrl [nupkg].package-source-url
icon [package].icon In-zip path of the packed icon (see below)
iconUrl [nupkg].icon-url
requireLicenseAcceptance [package].require-license-acceptance Emitted only when true (false is the nuspec default)
description [package].description
releaseNotes [nupkg].release-notes
copyright [package].copyright
tags [package].tags Array, joined with single spaces; omitted when empty

tags entries must each be non-empty and contain no whitespace (a space inside one tag would silently split it), or the build fails at config load: package.tags entries must be non-empty and contain no whitespace. There is no summary element — NuGet deprecated it in favour of description, so embala does not emit one.

License and the two feeds

Chocolatey and NuGet V3 disagree on how a license is declared: Chocolatey wants <licenseUrl>, NuGet V3 wants the embedded <license> element. embala emits both into one nuspec — each feed reads its own and ignores the other, so you supply the SPDX id once ([package].license) and a URL once ([nupkg].license-url). See Code-Signing for the unrelated question of Authenticode; a nuspec <license> is metadata, not a signature.

require-license-acceptance = true requires a license-url, or the build fails at config load: package.require-license-acceptance = true requires nupkg.license-url (Chocolatey rejects the package otherwise). Leave it unset (the default) for an acceptance-prompt-free choco install.

Icon

[package].icon names an image file (resolved relative to embala.toml) that embala packs at the package root — not under tools/ — as icon.png or icon.jpg, named by the format it sniffs from the file's magic bytes. The nuspec <icon> element then references that in-zip name.

Rule Value
Formats PNG or JPEG only (detected by magic bytes)
Size ≤ 1 MiB
Recommended dimensions 128×128 (not enforced)

Build errors:

  • Not a PNG or JPEG → nupkg icon … must be a PNG or JPEG (magic-byte check).
  • Over the cap → nupkg icon … is N bytes; NuGet caps embedded icons at 1 MiB.

As with the license, the embedded <icon> (for NuGet V3) and <iconUrl> (for Chocolatey, from [nupkg].icon-url) are independent and may both be set; each feed uses its own. The V3 side embedding is built-to-spec, not verified — the Chocolatey <iconUrl> is the path proven on Windows.

Limitations

These are scope decisions for v1, not defects. embala's nupkg support is deliberately "a CLI on PATH, and nothing more".

  • No lifecycle scripts. embala does not author chocolateyuninstall.ps1, chocolateybeforemodify.ps1, or a customizable chocolateyinstall.ps1, and there is no package-parameter (--params) support. The only generated script is the fixed download-style installer. Anything that needs custom install behaviour (env vars, extra PATH entries, shortcuts, custom cleanup) is out of scope.
  • No dependencies. The nuspec carries no <dependencies> block; packages are standalone.
  • NuGet V3 rendering is unverified. The package is built to V3 conventions (embedded <icon>, <license>), but embala does not verify how a V3 server renders or serves it. Chocolatey behaviour is the verified path.
  • Never Authenticode-signed. Chocolatey packages are not Authenticode signed, so embala never signs the .nupkg — even with a [sign] section configured. See Code-Signing.

Clone this wiki locally