Distribute as a binary
Ship a Pear application as a small bootstrap binary that pulls the latest version from the swarm. One binary serves every future release.
The default Pear distribution model assumes users already have the pear runtime installed; they open pear://<your-link> to launch your application. For users who don't — or for app stores that want a self-contained download — Pear supports compiling a small bootstrap binary that pulls the platform and the application from the swarm at first launch. For why this stays small, see Storage and distribution.
The binary is bootstrap-only: it doesn't ship the application's code or assets, only the references needed to fetch them. Once a user has run any version, future releases reach them via the swarm without recompilation — the same delivery channel covered in Deploy your application.
Steps
-
Clone the
pear-applingtemplate repository. It's a CMake-based project that produces native binaries for macOS, Linux, and Windows from one source tree. (The repository is archived/read-only upstream, but remains usable as a template.) -
Edit
CMakeLists.txtwith your application metadata. Theadd_pear_appling()call holds the application name (NAME),pear://link (ID), version (VERSION), author and description, plus the platform-specific identifiers and signing inputs (MACOS_IDENTIFIER,MACOS_SIGNING_IDENTITY,WINDOWS_SIGNING_SUBJECT,WINDOWS_SIGNING_THUMBPRINT, and so on). Replace each placeholder with your own value. -
Build the binary with
bare-make:npm i -g bare-make npm i bare-make generate bare-make buildThe output is one small binary — typically a few MB — that bootstraps Pear when launched. Run the same steps on each target OS to produce that platform's binary.
-
Distribute the binary via your channel of choice (GitHub Releases, an MSI/dmg, an app store, a download link). End users run it; on first launch it replicates the Pear platform and your application, then runs it. On subsequent launches, the swarm delivers any new version of the application — usually no recompile or redistribution is needed.
When this is the wrong tool
- For users who already run Pear,
pear://<your-link>is the lighter path: zero compilation, instant updates. - For installing apps or binaries from a link, the upcoming
pear installcommand (preview:npx pear-install pear://<key>) pulls a build from the swarm without compiling a bootstrap binary yourself. See Installing applications. - For mobile distribution, see the platform-specific paths under Bare modules (Bare iOS / Bare Android) —
pear-applingtargets desktop OSes.