Skip to content

autoInstallOnAppQuit causes stuck app on Windows when user relaunches during silent NSIS install #90

@igorgudelj

Description

@igorgudelj

On Windows, electron-updater's autoInstallOnAppQuit defaults to true. When the app quits after an update has been downloaded, the NSIS installer runs silently in the background (/S flag) with no visible UI. The user has no indication an update is being installed and will naturally relaunch the app immediately.

NativePHP Windows installations can take several minutes (around 3 minutes in our case) due to the size of the bundled PHP runtime and app resources. Since the user sees no feedback that an update is running, they will almost certainly try to reopen the app during this window. The relaunched app gets stuck (blank window / "Loading..." screen) because the NSIS installer is still replacing files on disk.

Steps to reproduce

  1. Publish a NativePHP app on Windows with auto-updater enabled
  2. Publish a new version so the update is downloaded in the background
  3. Close the app normally (X button or taskbar)
  4. Relaunch the app within the next few minutes

Expected: App launches normally with the new version.
Actual: App gets stuck on the loading screen. The NSIS installer is still running silently in the background, replacing the app's files.

Suggested fix

Set autoUpdater.autoInstallOnAppQuit = false in startAutoUpdater(). This gives developers control over when to install via the UpdateDownloaded event and quitAndInstall() API. Silent background installs are unsafe on Windows because NSIS needs exclusive file access and takes too long for users not to relaunch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions