enable_auto_updates: Enable Auto-Updates

View source: R/updates.R

enable_auto_updatesR Documentation

Enable Auto-Updates

Description

Configures automatic update checking for your Electron application. GitHub Releases and generic HTTP servers are supported. An S3 provider is planned and will be added in a future release.

Usage

enable_auto_updates(
  appdir,
  provider = "github",
  owner = NULL,
  repo = NULL,
  url = NULL,
  check_on_startup = TRUE,
  auto_download = FALSE,
  auto_install = FALSE,
  verbose = TRUE
)

Arguments

appdir

Character path to app directory containing ⁠_shinyelectron.yml⁠

provider

Character update provider: "github" (the default) or "generic". "s3" is not yet wired into the build and will be added in a future release.

owner

Character GitHub username or organization (required for github provider)

repo

Character GitHub repository name (required for github provider)

url

Character address of the folder that holds the update files (required for the generic provider). It must start with ⁠http://⁠ or ⁠https://⁠ and hold no backslash or space. ⁠http://⁠ warns unless the host is localhost or ⁠127.0.0.1⁠.

check_on_startup

Logical whether to check for updates when app starts. Default TRUE.

auto_download

Logical whether to download updates automatically. Default FALSE.

auto_install

Logical whether to install updates automatically on quit. Default FALSE.

verbose

Logical whether to show progress messages. Default TRUE.

Details

Auto-updates require:

  1. A published application (e.g., to GitHub Releases)

  2. Proper code signing for macOS and Windows (recommended)

  3. The electron-updater package (automatically included in build)

Update Providers

GitHub Releases (recommended for open source):

  • Automatically detects new releases by comparing semver tags

  • Requires owner and repo parameters

  • Private repos require GH_TOKEN environment variable

S3 Bucket (planned, not yet supported):

  • For self-hosted updates behind a CDN

  • Configure bucket, region, and path in ⁠_shinyelectron.yml⁠

  • Bucket must allow public reads or use CloudFront signed URLs

  • Required bucket structure: ⁠/{path}/latest-mac.yml⁠, latest-linux.yml, latest.yml

  • Note: enable_auto_updates() currently rejects "s3" as a provider; S3 support will be added in a future release.

Generic HTTP Server:

  • For any static web server hosting the update files

  • Requires the url parameter: the folder that holds the files, saved as updates.generic.url in ⁠_shinyelectron.yml⁠

  • Upload the latest*.yml files from ⁠destdir/electron-app/dist/⁠, the installers they name, and any .blockmap files beside them, side by side in that folder

  • Use ⁠https://⁠; an ⁠http://⁠ address warns unless the host is localhost or ⁠127.0.0.1⁠

Publishing Updates (GitHub Releases)

After enabling auto-updates, follow this workflow to publish updates:

  1. Bump version in ⁠_shinyelectron.yml⁠ (e.g., version: "1.1.0")

  2. Rebuild with export(appdir, destdir, build = TRUE)

  3. Create a GitHub Release with a semver tag matching the version:

    • Tag: v1.1.0 (the v prefix is required)

    • Upload the built artifacts from ⁠destdir/electron-app/dist/⁠:

      • macOS: .dmg and latest-mac.yml

      • Windows: .exe installer and latest.yml

      • Linux: .AppImage and latest-linux.yml

  4. The app checks for updates on startup (if check_on_startup = TRUE) and notifies the user when a new version is available

Code Signing

Signing is what lets an app check who published an update. A signed Windows app installs only an update signed by the same publisher; an unsigned one, like a Linux AppImage, installs whatever the update address serves, so it trusts that server (and, over ⁠http://⁠, the network) completely. Set signing: sign: true in your config and provide credentials via environment variables (see ?validate_signing_config).

Value

Invisibly returns the path to the updated config file.

See Also

init_config() for creating initial configuration

Examples

# Enable GitHub-based updates on a temporary app
app <- file.path(tempdir(), "enable-updates-demo")
dir.create(app, showWarnings = FALSE)
writeLines("library(shiny)", file.path(app, "app.R"))
enable_auto_updates(app, owner = "myusername", repo = "myapp")

# Enable with automatic download
enable_auto_updates(app, owner = "myorg", repo = "dashboard",
                    auto_download = TRUE)


shinyelectron documentation built on Dec. 3, 2026, 9:07 a.m.