Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force run after silent update doesn't work. using appUpdater.quitAndInstall(isSilent=true, isForceRunAfter=true) #1746

Closed
alondanoch opened this issue Jun 27, 2017 · 3 comments

Comments

@alondanoch
Copy link

  • Version:
    "electron": "^1.7.2",
    "electron-builder": "^19.9.1",
    "electron-updater": "^2.4.3",

  • Target:
    win (NSIS)
    (tested on windows 10 latest)

  • Issue:
    using the new isForceRunAfter feature with appUpdater.quitAndInstall(isSilent=true, isForceRunAfter=true), to force reopen app after update doesnt work (update works, but doesnt run).

please see example code and package.json in the following repo:
https://github.com/alondanoch/sparkdownload

@develar
Copy link
Member

develar commented Jul 12, 2017

Works for me.

Your code is not fully correct, please see #1604 (comment)

You need to use setImmediate

@develar develar closed this as completed Jul 12, 2017
@Kunze
Copy link

Kunze commented Aug 2, 2017

Did not work for me on windows, even using setImmediate. The app closes but not reopen.

@ghost
Copy link

ghost commented Dec 13, 2019

For me, quitAndInstall with isForceRunAfter=true works in some occasions and fails on the others.

It works when I run checkForUpdates before launching the Electron main window.

However, after the the main window is launched, this function fails to force run the app. In details, it downloaded the update, installed the new version, closed the app, but failed to launch the app again after installing.

setImmediate or setTimeout didn't help to resolve this issues.

I also tried replicate the source code like below:

autoUpdater.on('update-downloaded', info => {
   spawn(info.downloadedFile, ['--force-run'], {
        detached: true,
      })
})

It still wouldn't force run the app after installing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants