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

Use RELEASES-x64 for Windows x64 #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions lib/nuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Nuts.prototype.onUpdateWin = function(req, res, next) {
var that = this;

var fullUrl = getFullUrl(req);
var platform = 'win_32';
var platform = req.params.platform;
var channel = req.params.channel || '*';
var tag = req.params.version;

Expand All @@ -277,9 +277,20 @@ Nuts.prototype.onUpdateWin = function(req, res, next) {
if (!latest) throw new Error("Version not found");

// File exists
var asset = _.find(latest.platforms, {
filename: 'RELEASES'
});
var asset = null;

if (platform === platforms.WINDOWS_64) {
asset = _.find(latest.platforms, {
filename: 'RELEASES-x64'
});
}

if (!asset) {
asset = _.find(latest.platforms, {
filename: 'RELEASES'
});
}

if (!asset) throw new Error("File not found");

return that.backend.readAsset(asset)
Expand Down
9 changes: 8 additions & 1 deletion lib/utils/platforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ function detectPlatform(platform) {
var prefix = "", suffix = "";

// Detect NuGet/Squirrel.Windows files
if (name == 'releases' || hasSuffix(name, '.nupkg')) return platforms.WINDOWS_32;
if (name == 'releases-x64') return platforms.WINDOWS_64;
if (name == 'releases') return platforms.WINDOWS_32;
if (hasSuffix(name, '.nupkg')) {
if (_.contains(name, 'x64') || _.contains(name, 'amd64'))
return platforms.WINDOWS_64;
else
return platforms.WINDOWS_32;
}

// Detect prefix: osx, widnows or linux
if (_.contains(name, 'win')
Expand Down