electron / electron/update-electron-app

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

Open
#164 1 comment 9 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
824
Forks
145
Avg merge
9h 22m
Merged PRs (30d)
3

Description

#### 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:
```javascript
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:
```javascript
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:
```javascript
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.