Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hichemfantar opened this issue Nov 16, 2024 · 0 comments

Comments

@hichemfantar
Copy link

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.

@hichemfantar hichemfantar changed the title Proposal: Enhance UX in update-electron-app by Adding Manual Update Control Options Proposal: Add Fine-Grained Control Over the Update Process to update-electron-app Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant