Distribute as a binary
Get a Pear app onto machines that don't have Pear: install it from a pear:// link, or hand out a signed binary that updates itself over the air with Pear OTA.
A Pear v3 app is a normal installed binary. It embeds Pear OTA (pear-runtime) and follows an upgrade link, so one binary serves every future release. There is no bootstrap binary to compile: pear run was removed in v3, so a pear:// link no longer launches an app through an installed Pear. This guide gets that binary to users who don't have Pear, then covers what to do for each release after that.
The pear-appling template and its cmake-pear build were the v2 way to do this. Both are archived upstream, and the launcher they build bootstraps a pinned v2 platform rather than Pear v3, so don't start new work from them. If you have an appling-era app, see Migrate from pear run to Pear OTA.
Before you begin
- An app that embeds Pear OTA and sets an
upgradelink; see Integrate Pear OTA. Thehello-pear-electronandhello-pear-baretemplates already do. - The
pearCLI on the machine you release from. Your users don't need it.
Steps
-
Build the release. Make the distributables and assemble the deployment directory with
pear build: see Build desktop distributables for an Electron app, or Build a CLI executable with pear make for a Bare command-line app (Pear 3.7.0 or later). Steps 3 and 4 of Deploy your application show the whole sequence. -
Stage, provision, and seed it. Publish the build to the link your binaries follow, and keep it seeded so users can fetch it; see Stage and Provision. The link must carry a build made with
pear build. -
Give users the binary. Choose how they first get it:
- From the link. On a machine without Pear, run
npx pear-install pear://<key>; it needs Node.js and npm, not Pear. On a machine with Pear, runpear install pear://<key>.pear installlists where each OS puts the result. - As a download. Publish the signed distributable from step 1 on GitHub Releases or a download page. macOS and Windows builds need vendor signing, and Windows MSIX updates need the same certificate on every build; see Build desktop distributables.
- Through a store. Submit the build to the Mac App Store, Flathub, the Snap Store, or a mobile store; see Submit to app stores.
- From the link. On a machine without Pear, run
-
Ship each later release the same way. Repeat steps 1 and 2. Installed copies poll their
upgradelink and update themselves over the air, so users don't download a new binary. Confirm stage updates shows how to check that a release is visible.
When this is the wrong tool
- For users who already have Pear,
pear install pear://<key>skips the download page entirely. - For a command-line app that should carry its own code, build a standalone executable with
pear makeinstead, from Pear 3.7.0. Its output isn't signed for distribution, so sign it yourself. - For mobile distribution, there is no standalone binary to hand out—mobile apps ship through the App Store and Google Play (or TestFlight / Play Console internal testing for pre-release builds). See Submit to app stores. For the raw
Worklet/IPCprimitivepear-mobilebuilds on, see Bare Kit.
Last updated on