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

Updater not working with Windows 10/Electron 1.7.3 #1725

Closed
ngprasad opened this issue Jun 21, 2017 · 19 comments
Closed

Updater not working with Windows 10/Electron 1.7.3 #1725

ngprasad opened this issue Jun 21, 2017 · 19 comments

Comments

@ngprasad
Copy link

ngprasad commented Jun 21, 2017

  • Electron builder version: 19.6.3
  • Electron updater version: 2.4.1
  • Target: Windows 10

We have our app built using the latest electron-builder and latest electron (1.7.3) but we are seeing issues on windows 10 while updating. It prompts for the download but does not update the app after quitting the old version of the app. Checking the version of the app in installed path shows that it is still on the older version.

@develar
Copy link
Member

develar commented Jun 22, 2017

Works for me and confirmed by other users. Do you call quitAndInstall explicitly or not?

@develar
Copy link
Member

develar commented Jun 22, 2017

Works for me in both cases — explicit exit or install on quit. Please provide more details and debug log (https://github.com/electron-userland/electron-builder/wiki/Auto-Update#debugging).

@ngprasad
Copy link
Author

Yes, I am calling autoUpdater.quitAndInstall() explicitly.

@ngprasad
Copy link
Author

@develar Are you sure you are on the same version of electron (1.7.3) when you tested it? Because the issue doesn't happen on any earlier versions of electron.

@develar
Copy link
Member

develar commented Jun 22, 2017

@JaisonJose
Copy link

JaisonJose commented Jun 23, 2017

@develar I work with @ngprasad
debug log shows this error:

2017-06-23 11:10:41.885 [ERROR] Error: Error: spawn EACCES
at exports._errnoException (util.js:1050:11)
at ChildProcess.spawn (internal/child_process.js:319:11)
at exports.spawn (child_process.js:390:9)
at NsisUpdater.install (C:\Program Files\QuickBooks\resources\app.asar\rel\node_modules\electron-updater\src\NsisUpdater.ts:116:7)
at NsisUpdater.quitAndInstall (C:\Program Files\QuickBooks\resources\app.asar\rel\node_modules\electron-updater\src\NsisUpdater.ts:86:14)
at Function.o (C:\Program Files\QuickBooks\resources\app.asar\rel\src\updater.js:1:2606)

(Issue looks very similar to #1636)
Note: We are facing this issue only on Windows 10, on Mac and on Windows 7, it works fine.
"electron": "1.7.3",
"electron-builder": "^19.6.3"
My Windows 10 has Powershell (PSVersion 5.0.10586.672)

@JaisonJose
Copy link

I tried "electron-builder": "^19.7.3" too.

@develar
Copy link
Member

develar commented Jun 26, 2017

Please provide your electron-builder config.

@itsWeller
Copy link

itsWeller commented Jun 26, 2017

@develar I work with @JaisonJose and @ngprasad.

Here's our electron-builder-release config; all "MOCK" strings are just replacements of info directly related to our application.

// electron-builder-release.json; code-block listed as Javascript to support inline-comment
{
  "appId": "com.MOCK_APP.ID",
  "productName": "MOCK_NAME",
  "extraResources": [
    "app/lib/**/*"
  ],
  "files": [
    "rel/**/*",
    "!rel/**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme,test,__tests__,tests,",
    "!rel/**/node_modules/.bin",
    "!rel/**/*.{o,hprof,orig,pyc,pyo,rbc}",
    "!rel/**/._*",
    "!rel/**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.flowconfig,.yarn-metadata.json,.idea,appveyor.yml,.travis.yml,circle.yml,npm-debug.log,.nyc_output,yarn.lock,.yarn-integrity}"
  ],
  "compression": "normal",
  "dmg": {
    "title": "MOCK_TITLE",
    "contents": [
      {
        "x": 350,
        "y": 180,
        "type": "link",
        "path": "/Applications"
      },
      {
        "x": 100,
        "y": 180,
        "type": "file"
      }
    ],
    "window": {
      "width": 447,
      "height": 288
    }
  },
  "mac": {
    "category": "public.app-category.MOCK_CATEGORY"
  },
  "win": {
    "target": "nsis",
    "certificateFile": "./build-utils/sha2_mycredentials.pfx",
    "certificatePassword": "MOCK_PASSWORD"
  },
  "publish": {
    "provider": "generic",
    "url": "http://MOCK_URL_BASE/static/release/${os}"
  },
  "nsis": {
    "oneClick": true,
    "warningsAsErrors": false,
    "perMachine": true  // This is true so the installation will wind up in "Program Files"
    "unicode": false,
    "artifactName": "${productName}-Setup-${version}.${ext}"
  },
  "directories": {
    "output": "dist/release"
  }
}

@itsWeller
Copy link

@develar Following up, any updates regarding this issue, or anything we can do to help reproduce or debug?

@develar
Copy link
Member

develar commented Jul 5, 2017

Sorry for delay. I am going to check per machine update tomorrow morning CET.

@develar
Copy link
Member

develar commented Jul 12, 2017

I cannot reproduce. perMachine works correctly for me. Could you please show your updater code (where do you call quitAndInstall)?

@JaisonJose
Copy link

autoUpdater.on('update-downloaded', (event) => {
const options = {type: 'info', buttons: ['Update Now'], defaultId: 0, noLink: true, title: constants.updater_title, message: 'A new version is ready to install.', detail: 'The update will proceed once you click Update Now.'};
const callback = (buttonIndex) => {
if (buttonIndex === 0) {
autoUpdater.quitAndInstall();
}};
dialog.showMessageBox(null, options, callback);
}
@develar Could you please let us know the electron and electron-builder versions that you used for checking this issue. (I assume you have used Windows 10 machine).

@develar
Copy link
Member

develar commented Jul 12, 2017

Ouch... please do not call autoupdater quit from dialog callback. Please wrap in setImmediate.

@develar
Copy link
Member

develar commented Jul 12, 2017

Please see #1604 (comment)

@ngprasad
Copy link
Author

ngprasad commented Jul 17, 2017

@develar We investigated the dialog but it still failed. Then we changed perMachine setting to false and it works.

We downloaded the sample app and tried setting perMachine setting to true with Electron v. 1.7.3 on Windows 10 x64, and that fails with the same error. Previous electron versions (1.6.x) with the same settings (perMachine=true, Windows 10 x64) work as expected. Here's the error log:-

[2017-07-17 12:52:56:0723] [info] Checking for update
[2017-07-17 12:52:56:0724] [info] Checking for update...
[2017-07-17 12:52:58:0467] [info] Found version 0.4.3 (url: http://172.28.35.65/win/electron-updater-example Setup 0.4.3.exe)
[2017-07-17 12:52:58:0468] [info] Update available.
[2017-07-17 12:52:58:0472] [info] Downloading update from http://172.28.35.65/win/electron-updater-example Setup 0.4.3.exe
[2017-07-17 12:52:59:0527] [info] Download speed: 1555638 - Downloaded 4.587408422831984% (1561861/34046696)
[2017-07-17 12:53:00:0526] [info] Download speed: 3401964 - Downloaded 20.034067329176374% (6820938/34046696)
[2017-07-17 12:53:01:0527] [info] Download speed: 5969574 - Downloaded 52.705672233217584% (17944540/34046696)
[2017-07-17 12:53:02:0527] [info] Download speed: 7300915 - Downloaded 85.90397435334107% (29247465/34046696)
[2017-07-17 12:53:02:0973] [info] Download speed: 7647506 - Downloaded 100% (34046696/34046696)
[2017-07-17 12:53:05:0460] [info] New version 0.4.3 has been downloaded to C:\Users\DevAdmin\AppData\Local\Temp\up-p2cFzQ\electron-updater-example Setup 0.4.3.exe
[2017-07-17 12:53:05:0460] [info] Update downloaded; will install in 5 seconds
[2017-07-17 12:53:10:0535] [error] Error: Error: spawn EACCES
    at exports._errnoException (util.js:1050:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at exports.spawn (child_process.js:390:9)
    at NsisUpdater.install (C:\Program Files\electron-updater-example\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:116:7)
    at NsisUpdater.quitAndInstall (C:\Program Files\electron-updater-example\resources\app.asar\node_modules\electron-updater\src\NsisUpdater.ts:86:14)
    at Timeout._onTimeout (C:\Program Files\electron-updater-example\resources\app.asar\main.js:128:17)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
[2017-07-17 12:53:10:0535] [info] Error: spawn EACCES
[2017-07-17 12:53:10:0608] [info] Auto install update on quit

We think there might still be an issue with perMachine=true on Electron 1.7.3 and Windows 10 x64.

Can you please look into it?

@JaisonJose
Copy link

@develar Did you get a chance to look at this issue with sample app?

@akorchev
Copy link
Contributor

I think this code is supposed to handle that error and run the installer with elevated rights. However child_process.spawn never throws exceptions so that code is never executed. It emits error event instead.

@stale
Copy link

stale bot commented Jul 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the backlog label Jul 2, 2019
@stale stale bot closed this as completed Jul 9, 2019
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

5 participants