Skip to content

Proposal: Add Fine-Grained Control Over the Update Process to update-electron-app #164

@clicktodev

Description

@clicktodev

Problem

Currently, the update-electron-app package checks for updates automatically. While this approach is convenient for many scenarios, it may not suit applications requiring explicit user control over the update process. Developers may prefer to disable automatic checks and instead have:

  1. Manual control for checking updates: A method to initiate update checks programmatically.
  2. Manual installation of updates: A method to trigger the update installation process on demand.

Proposed Changes

  1. Add a disableAutoCheck Option:

    • Introduce a configuration option in the package to disable automatic update checks when the application starts.
    • Example:
      require('update-electron-app')({
        disableAutoCheck: true,
      });
  2. Expose a checkForUpdates Method:

    • Provide a method developers can call to manually check for updates. This method would work like the internal automatic check but only when explicitly invoked.
    • Example:
      const { checkForUpdates } = require('update-electron-app');
      checkForUpdates().then((updateAvailable) => {
        if (updateAvailable) {
          console.log('Update found!');
        } else {
          console.log('No updates available.');
        }
      });
  3. Expose a installUpdate Method:

    • Allow developers to manually trigger the installation of a downloaded update. This would be useful for scenarios where the user needs to approve updates or when updates are installed at specific times.
    • Example:
      const { installUpdate } = require('update-electron-app');
      installUpdate();

Benefits

  • Improved Flexibility: Developers gain greater control over when and how updates are managed in their applications.
  • Enhanced UX: End-users can be explicitly informed about updates and prompted for consent before downloading or installing.
  • Broader Adoption: These changes may attract developers with stricter requirements around update control.

Implementation Notes

  • Leverage Electron’s autoUpdater module to support the new methods.
  • Ensure compatibility with existing configurations to prevent breaking changes.

Compatibility

This change would be backward-compatible since the current default behavior (automatic update checks) would remain unchanged unless the disableAutoCheck flag is set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions