Application Updates & Releases
Relevant source files
The following files were used as context for generating this wiki page:
The Application Updates & Releases system in Duplicator manages the lifecycle of the software from version incrementing and deployment to automated updates within the Electron environment. It utilizes electron-updater for client-side management and custom bash/Node.js scripts for repository and release management.
Release Lifecycle & Deployment
The release process is semi-automated through a deployment script that synchronizes the development environment with the Electron wrapper and creates GitHub releases.
Automated Deployment Flow
The deployment process follows a specific sequence to ensure consistency between the PHP core and the Electron shell.
The script specifically handles versioning by extracting the current tag and using a Node.js one-liner to increment the patch version (e.g., 1.0.0 to 1.0.1).
Sources: app/deploy-script.sh:7-86, package.json:3
Build Configuration
Releases are packaged using electron-builder with specific configurations for Windows, Linux (AppImage), and macOS.
| Platform | Target Format | Artifact Name Pattern |
|---|---|---|
| Windows | NSIS Installer | Duplicator-Setup-${version}.exe |
| Linux | AppImage | Duplicator-${version}-x86_64.AppImage |
| macOS | DMG | Duplicator-${version}.dmg |
Sources: package.json:69-110, README.md:12-16
Update Architecture
The update system is split between the Electron Main process (logic and networking) and the Renderer process (User Interface).
Main Process Logic
The Main process initializes the autoUpdater and manages the state of the update lifecycle. It handles platform-specific configuration, such as pointing Linux AppImages toward specific YAML metadata files (latest-linux-appimage.yml) and managing conflicts between .deb and .AppImage formats.
UI Components
The update interface is injected into the application via app/public/js/updater-ui.js. It creates a fixed notification container on the screen to communicate with the user.
- Notification Container: A fixed
divpositioned attop: 60px; right: 20pxwith a high z-index (99999). - Update Available: Displays the new version number and a "Download" button.
- Progress Tracking: Shows a progress bar with percentage, bytes transferred, and total size.
- Installation: Offers a "Restart Now" button once the download is complete.
Sources: app/public/js/updater-ui.js:34-118
Critical Update Procedures
Graceful Shutdown
Before applying an update, the application must terminate its child processes (Caddy and PHP-FPM) to prevent file locking and ensure a clean overwrite. The function stopAllChildrenGracefully is invoked during the before-quit-for-update event.
Sources: main-caddy.js:847-862, main-caddy.js:1049-1052
Update Management IPC Handlers
The system exposes several Inter-Process Communication (IPC) handlers for the UI to trigger update actions:
| IPC Channel | Functionality |
|---|---|
check-for-updates | Manually triggers a check against the GitHub repository assets. |
download-update | Starts the asynchronous download of the update package. |
install-update | Triggers the graceful shutdown and calls quitAndInstall(). |
get-app-version | Returns the current version string from app.getVersion(). |
Sources: main-caddy.js:1262-1376
Error Handling & Platform Conflicts
The update system contains specific logic to handle platform-specific issues:
- AppImage/Deb Conflict: Detects if an AppImage build is trying to download a
.debpackage and warns the user to perform a manual update. - Linux Permissions: Checks for
pkexecavailability before attempting an automated installation on Linux; if missing, it directs the user to manualdpkgcommands. - Network Errors: Silently ignores common network failures (e.g.,
ENOTFOUND,ECONNREFUSED) to avoid intrusive error messages when offline.
Sources: main-caddy.js:1068-1130, main-caddy.js:1355-1365
Release Communication
New releases are communicated through the annonce_nouvelle_version.html page, which highlights operational features like:
- Tirage Registration: Reliable saving of print runs.
- Consumables Management: Real-time tracking of ink and master changes.
- Pricing System: Automated price calculations.
- Known Issues: Transparent reporting of bugs, such as PDF resizing issues in booklet mode.
Sources: annonce_nouvelle_version.html:75-115
Application updates are checked automatically every 4 hours or can be manually triggered through the "Rechercher des mises à jour" (F3) menu item.
Sources: main-caddy.js:885-896, main-caddy.js:1152-1158