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

Checksum mismatch on Windows NSIS #1045

Closed
Daymannovaes opened this issue Dec 24, 2016 · 7 comments · May be fixed by qcif/data-curator#563
Closed

Checksum mismatch on Windows NSIS #1045

Daymannovaes opened this issue Dec 24, 2016 · 7 comments · May be fixed by qcif/data-curator#563
Labels

Comments

@Daymannovaes
Copy link

Daymannovaes commented Dec 24, 2016

  • Version: 10.8.1
  • Target: NSIS
    (building from windows too)

  • Node version: 6.9.1

  • npm version: 4.0.3

I'm getting checksum mismatch, like following in the screenshot

screenshot 18

I uploaded the executables with --publish=always at github and didn't change anything.
The fact that I'm checking for updates a lot of times even ater the download starts, can affect this?

Because just for test purpose, I put the check interval to 30 seconds, so I get update-available a bunch of times.

Plus, I'm getting everytime a different checksum. What's going on?

My autoupdater module is very simple:

autoUpdater.addListener('update-available', () => {
  logger.info('update-available');
});
autoUpdater.addListener('update-downloaded', (event, releaseNotes, releaseName, releaseDate, updateURL) => {
  autoUpdater.quitAndInstall();
});
autoUpdater.addListener('error', (error) => {
  logger.error('error when trying to check for update');
  logger.error(error);
});
autoUpdater.addListener('checking-for-update', () => {
  logger.info('checking-for-update');
});
autoUpdater.addListener('update-not-available', () => {
  logger.info('update-not-available');
});

async function setup() {
  autoUpdater.checkForUpdates();

  await sleep(30 * 1000);
  setup();
}
setup();

And but package config is simple too:

"build": {
    "appId": "some-id",
    "files": [
      "node_modules/**/*",
      ".env",
      "app/**/*"
    ],
    "publish": [
      {
        "provider": "github",
        "repo": "some-repo"
      }
    ],
    "win": {
      "certificateFile": "./certs/my_signing_key.pfx",
      "certificatePassword": ""
    }
  }
@develar develar added the bug label Dec 24, 2016
@develar
Copy link
Member

develar commented Dec 24, 2016

Probably. Confirmed that we don't queue check updates requests. Should be fixed. In any case it is better to check updates not so often.

@tvanro
Copy link

tvanro commented Jan 3, 2017

electron-builder: 10.16.0
electron-auto-updater: 0.9.0

Target: NSIS
(building from docker on Linux)

I'm receiving the exact same error so there's still something going on I'm afraid.
Like with @Daymannovaes, the second checksum is different on each check from electron-builder. My guess is that it's doing the check on a whole file-download request instead of only the file.

This is my autoUpdater implementation:

autoUpdater.addListener("update-available", function(event) {
  dialog.showMessageBox(mainWindow, {title: "update-available", message: "A new update is available"});
});
autoUpdater.addListener("update-downloaded", function(event, releaseNotes, releaseName, releaseDate, updateURL) {
  dialog.showMessageBox(mainWindow, {title: "A new update is ready to install", message: `Version ${releaseName} is downloaded and will be automatically installed on Quit`});
  autoUpdater.quitAndInstall()
  return true    
});
autoUpdater.addListener("error", function(error) {
  dialog.showMessageBox(mainWindow, {title: "error", message: JSON.stringify(error)});
});
autoUpdater.addListener("checking-for-update", function(event) {
  dialog.showMessageBox(mainWindow, {title: "checking-for-update", message: "Checking for update"});
});
autoUpdater.addListener("update-not-available", function() {
  dialog.showMessageBox(mainWindow, {title: "update-not-available", message: "Update not available"});
});

mainWindow.webContents.once("did-frame-finish-load", function(event) {
  dialog.showMessageBox(mainWindow, {title: "autoUpdater", message: 'checking for updates....'});
  autoUpdater.checkForUpdates();
})

And package.config:

  "build": {
    "appId": ".....",
    "win": {
      "signingHashAlgorithms": "sha256",
      "certificateFile": ".certs/certificate.pfx",
      "certificatePassword": "......"
    },
    "publish": {
      "provider": "generic",
      "url": "....."
    }
  },

@develar
Copy link
Member

develar commented Jan 3, 2017

@tvanro What server do you use? Amazon S3? GitHub? Own server (please at least specify server — nginx, some node module).

@tvanro
Copy link

tvanro commented Jan 3, 2017

@develar thanks for getting back to me.
I'm using an own server, nginx/1.11.5 to be precise.

@maczikasz
Copy link
Contributor

maczikasz commented Jan 3, 2017

I see the same issue, with ownserver (spring boot based) but what I also see is that the file that was downloaded is not runnable, @tvanro does that happen to you too?

I wrote a small app that uses electron.net to download a file and pipe it to a file, and what I see that downloading the same file with auto updater results in a file that's 3 KB smaller

If I remove the part where it notifies the "transferred" callback (from the compiled js), it works perfectly

@maczikasz
Copy link
Contributor

Adding response.pause to the compiled js solved the issue for me

@tvanro
Copy link

tvanro commented Jan 4, 2017

You rock @maczikasz !
I installed electron-auto-updater 0.9.1 and it works as expected now

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

Successfully merging a pull request may close this issue.

4 participants