Desktop application auto-update implementation

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Implementing Auto-Update for Desktop Applications

Auto-update is critical for desktop apps. Without it, users work with old versions for months. With poor implementation — they lose data or get broken updates. Let's cover Electron and Tauri.

Electron: electron-updater

electron-updater from electron-builder package is the standard tool. Supports GitHub Releases, S3, custom servers.

npm install electron-updater
// main/updater.js
const { autoUpdater } = require('electron-updater');
const { app, BrowserWindow } = require('electron');
const log = require('electron-log');

autoUpdater.logger = log;
autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true;

function setupAutoUpdater(mainWindow) {
  autoUpdater.on('update-available', (info) => {
    mainWindow.webContents.send('update:available', {
      version: info.version,
      releaseNotes: info.releaseNotes,
      releaseDate: info.releaseDate
    });
  });

  autoUpdater.on('download-progress', (progress) => {
    mainWindow.webContents.send('update:progress', {
      percent: Math.round(progress.percent)
    });
  });

  autoUpdater.on('update-downloaded', (info) => {
    mainWindow.webContents.send('update:downloaded', {
      version: info.version
    });
  });

  const { ipcMain } = require('electron');
  ipcMain.handle('updater:check', () => autoUpdater.checkForUpdates());
  ipcMain.handle('updater:download', () => autoUpdater.downloadUpdate());
  ipcMain.handle('updater:install', () => autoUpdater.quitAndInstall(false, true));

  setInterval(() => autoUpdater.checkForUpdates(), 4 * 60 * 60 * 1000);
  setTimeout(() => autoUpdater.checkForUpdates(), 10000);
}

module.exports = { setupAutoUpdater };

Configuration for GitHub Releases

# electron-builder.yml
publish:
  provider: github
  owner: your-github-username
  repo: your-repo-name
  private: false

When building, electron-builder creates latest.yml with version metadata. autoUpdater reads it to check for updates.

UI Component for Updates

// renderer/components/UpdateNotification.tsx
import { useEffect, useState } from 'react';

type UpdateState =
  | { status: 'idle' }
  | { status: 'checking' }
  | { status: 'available'; version: string }
  | { status: 'downloading'; percent: number }
  | { status: 'ready'; version: string }
  | { status: 'error'; message: string };

export function UpdateNotification() {
  const [state, setState] = useState<UpdateState>({ status: 'idle' });

  useEffect(() => {
    const unsubscribers = [
      window.electronAPI.onUpdateAvailable((info) =>
        setState({ status: 'available', version: info.version })
      ),
      window.electronAPI.onUpdateProgress((p) =>
        setState({ status: 'downloading', percent: p.percent })
      ),
      window.electronAPI.onUpdateDownloaded((info) =>
        setState({ status: 'ready', version: info.version })
      ),
    ];

    return () => unsubscribers.forEach(fn => fn?.());
  }, []);

  if (state.status === 'available') {
    return (
      <div className="update-banner">
        <span>Version {state.version} available</span>
        <button onClick={() => window.electronAPI.downloadUpdate()}>Download</button>
      </div>
    );
  }

  if (state.status === 'ready') {
    return (
      <div className="update-banner">
        <span>Version {state.version} ready</span>
        <button onClick={() => window.electronAPI.installUpdate()}>Restart and Install</button>
      </div>
    );
  }

  return null;
}

Tauri: Built-in Updates

# src-tauri/Cargo.toml
[dependencies]
tauri-plugin-updater = "2"
// src-tauri/src/lib.rs
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_updater::Builder::default().build())
        .invoke_handler(tauri::generate_handler![check_for_updates])
        .run(tauri::generate_context!())
        .expect("error running app");
}

#[tauri::command]
async fn check_for_updates(app: tauri::AppHandle) -> Result<(), String> {
    let updater = app.updater().map_err(|e| e.to_string())?;
    let response = updater.check().await.map_err(|e| e.to_string())?;

    if let Some(update) = response {
        app.emit("update:available", &update.version).unwrap();
        update.download_and_install(
            |chunk, total| {
                if let Some(total) = total {
                    let percent = (chunk * 100 / total) as u8;
                    app.emit("update:progress", percent).unwrap();
                }
            },
            || { app.emit("update:installed", ()).unwrap(); }
        ).await.map_err(|e| e.to_string())?;
    }

    Ok(())
}

Tauri requires signed updates — can't install unsigned patches.

Update without Restart

Full seamless updating is technically impossible for a running binary. But minimize disruption by:

  • Downloading updates in background silently
  • Offering installation at next app close
  • Showing notification in tray
  • Saving state before restart and restoring after