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

Windows nupkg downloaded twice each time / also keeps downloading latest release #234

Closed
mcaoun opened this issue Mar 13, 2016 · 3 comments · May be fixed by qcif/data-curator#563
Closed

Comments

@mcaoun
Copy link

mcaoun commented Mar 13, 2016

I am experiencing the following issue(s) with the windows downloads. As soon as the app is installed it starts downloading the latest version and it does that twice in a row.

Initially I suspected I might be doing something wrong but then I was able to get the same behavior to occur with this simple app:

var handleStartupEvent = function() {
  var squirrelCommand = process.argv[1];
  var target = path.basename(process.execPath);
  switch (squirrelCommand) {
    case '--squirrel-install':
    case '--squirrel-updated':
    case '--squirrel-uninstall':
    case '--squirrel-obsolete':
      app.quit();
      return true;
  }
};

var autoUpdaterInit = function(mainWindow) {
  const platform = os.platform() + '_' + os.arch();
  autoUpdater.setFeedURL('http://127.0.0.1:5000/update/' + platform)
  autoUpdater.checkForUpdates();
}

if (handleStartupEvent()) {
  return;
}

app.on('ready', function() {
  mainWindow = new BrowserWindow();
  mainWindow.loadURL('file://' + __dirname + '/index.html');
  autoUpdaterInit(mainWindow);
})

In the example above I am using a local server to return the RELEASES and nupkg of version 1.1.0, then I launch a version 1.0.0 and I find it will download both the RELEASES file and the nupkg twice. Am I doing something wrong?

On a related note, when I use the Nuts server, the app will keep downloading the "newest release" and think it doesn't have it locally. What I mean is that on every checkUpdates it will download the release even though it already has the latest version. I think this is a different issue. I have looked at the RELEASES file in AppData/Local and it has the right SHA1 hash, the only thing is the name of the nupkg, it has myapp-version-full.nupkg as the name of the package but in the RELEASES file that gets downloaded the name is http://my-nuts-server.com/myapp-version-x64-full.nupkg. When I switch the local RELEASES file in AppData to use the myapp-version-x64-full.nupkg of the name (with x64), this behavior gets fixed.

@develar
Copy link
Member

develar commented Mar 13, 2016

I still don't have time to fix Nuts issue...

Ok, we will produce x64 without arch prefix (as we already do in case of RELEASES file).

@mcaoun
Copy link
Author

mcaoun commented Mar 13, 2016

The change you made fixed the issue where it would keep downloading the latest release, thanks!

However, it still downloads the package twice on upgrades, not sure what is causing that. Maybe it is only me?

@develar
Copy link
Member

develar commented Mar 18, 2016

@mcaoun Please file issue to https://github.com/GitbookIO/nuts/issues (please don't forget to mention this issue, so, I can subscribe to ticket).

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

Successfully merging a pull request may close this issue.

2 participants