electron-auto-updater-setup
Configure electron-updater with code signing verification, delta updates, staged rollouts, and multiple update channels for Electron applications
What this skill does
# electron-auto-updater-setup
Configure electron-updater for Electron applications with advanced features including code signing verification, delta updates, staged rollouts, and multiple release channels. This skill creates a complete auto-update infrastructure.
## Capabilities
- Configure electron-updater with multiple providers (GitHub, S3, Generic, Spaces)
- Set up staged rollouts with percentage-based distribution
- Configure delta (differential) updates for efficient bandwidth usage
- Implement multiple release channels (stable, beta, alpha)
- Set up code signing verification for update packages
- Create update notification UI components
- Configure silent updates vs. interactive updates
- Implement rollback mechanisms
## Input Schema
```json
{
"type": "object",
"properties": {
"projectPath": {
"type": "string",
"description": "Path to the Electron project root"
},
"provider": {
"type": "object",
"properties": {
"type": { "enum": ["github", "s3", "generic", "spaces", "keygen"] },
"config": {
"type": "object",
"description": "Provider-specific configuration"
}
},
"required": ["type"]
},
"channels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"default": { "type": "boolean" },
"allowDowngrade": { "type": "boolean" }
}
},
"default": [{ "name": "latest", "default": true }]
},
"features": {
"type": "object",
"properties": {
"deltaUpdates": { "type": "boolean", "default": true },
"stagedRollout": { "type": "boolean", "default": false },
"silentUpdate": { "type": "boolean", "default": false },
"autoInstallOnQuit": { "type": "boolean", "default": true },
"forceDevUpdateConfig": { "type": "boolean", "default": false }
}
},
"stagedRollout": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"initialPercentage": { "type": "number", "default": 10 },
"incrementStep": { "type": "number", "default": 20 },
"incrementInterval": { "type": "string", "default": "24h" }
}
},
"ui": {
"type": "object",
"properties": {
"generateComponents": { "type": "boolean", "default": true },
"framework": { "enum": ["react", "vue", "svelte", "vanilla"] },
"notifications": { "type": "boolean", "default": true }
}
}
},
"required": ["projectPath", "provider"]
}
```
## Output Schema
```json
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"type": { "enum": ["config", "main", "ui", "ipc", "utils"] }
}
}
},
"electronBuilderConfig": {
"type": "object",
"description": "electron-builder publish configuration to merge"
},
"envVariables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"description": { "type": "string" },
"required": { "type": "boolean" }
}
}
},
"testCommands": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["success", "files"]
}
```
## Generated File Structure
```
src/
main/
updater/
auto-updater.ts # Main updater logic
update-channels.ts # Channel management
staged-rollout.ts # Staged rollout logic
delta-updates.ts # Delta update handling
preload/
updater-api.ts # Exposed updater API
renderer/
components/
UpdateNotification/ # UI components
UpdateNotification.tsx
UpdateProgress.tsx
ReleaseNotes.tsx
shared/
update-types.ts # TypeScript types
```
## Code Templates
### Main Auto-Updater Module
```typescript
import { autoUpdater, UpdateInfo } from 'electron-updater';
import { app, BrowserWindow, ipcMain } from 'electron';
import log from 'electron-log';
// Configure logging
autoUpdater.logger = log;
autoUpdater.logger.transports.file.level = 'info';
// Disable auto download - we control the flow
autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true;
export class AppUpdater {
private mainWindow: BrowserWindow | null = null;
constructor(mainWindow: BrowserWindow) {
this.mainWindow = mainWindow;
this.setupEventHandlers();
this.setupIpcHandlers();
}
private setupEventHandlers() {
autoUpdater.on('checking-for-update', () => {
this.sendToRenderer('update-status', { status: 'checking' });
});
autoUpdater.on('update-available', (info: UpdateInfo) => {
this.sendToRenderer('update-status', {
status: 'available',
version: info.version,
releaseNotes: info.releaseNotes,
releaseDate: info.releaseDate,
});
});
autoUpdater.on('update-not-available', () => {
this.sendToRenderer('update-status', { status: 'not-available' });
});
autoUpdater.on('download-progress', (progress) => {
this.sendToRenderer('update-progress', {
percent: progress.percent,
bytesPerSecond: progress.bytesPerSecond,
transferred: progress.transferred,
total: progress.total,
});
});
autoUpdater.on('update-downloaded', (info: UpdateInfo) => {
this.sendToRenderer('update-status', {
status: 'downloaded',
version: info.version,
});
});
autoUpdater.on('error', (error) => {
this.sendToRenderer('update-status', {
status: 'error',
error: error.message,
});
});
}
private setupIpcHandlers() {
ipcMain.handle('updater:check', async () => {
return autoUpdater.checkForUpdates();
});
ipcMain.handle('updater:download', async () => {
return autoUpdater.downloadUpdate();
});
ipcMain.handle('updater:install', () => {
autoUpdater.quitAndInstall(false, true);
});
ipcMain.handle('updater:set-channel', async (_, channel: string) => {
autoUpdater.channel = channel;
return autoUpdater.checkForUpdates();
});
}
private sendToRenderer(channel: string, data: unknown) {
this.mainWindow?.webContents.send(channel, data);
}
async checkForUpdates() {
return autoUpdater.checkForUpdates();
}
}
```
### Staged Rollout Implementation
```typescript
import { machineIdSync } from 'node-machine-id';
import crypto from 'crypto';
export class StagedRollout {
private machineId: string;
private rolloutPercentage: number;
constructor() {
this.machineId = machineIdSync();
this.rolloutPercentage = 100; // Full rollout by default
}
/**
* Deterministically decide if this machine should receive the update
* based on a hash of the machine ID
*/
shouldReceiveUpdate(version: string, rolloutPercentage: number): boolean {
const hash = crypto
.createHash('sha256')
.update(`${this.machineId}:${version}`)
.digest('hex');
// Convert first 8 hex chars to number (0 to 4294967295)
const hashNumber = parseInt(hash.substring(0, 8), 16);
// Normalize to 0-100
const bucket = (hashNumber / 0xffffffff) * 100;
return bucket < rolloutPercentage;
}
async fetchRolloutConfig(updateServerUrl: string, version: string) {
try {
const response = await fetch(
`${updateServerUrl}/rollout/${version}`
);
const config = await response.json();
return config.percentage || 100;
} catch {
return 100; // Default to full rollout on error
}
}
}
```
### Multi-Channel Support
```typescript
import { autoUpdater } from 'electron-updater';
import Store from 'electron-store';
const store = new Store();
export const UPDATRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.