Skip to content

Commit

Permalink
Merge branch 'fix_win_ico' into develop
Browse files Browse the repository at this point in the history
fixes #44
  • Loading branch information
gabepaez committed Aug 20, 2014
2 parents abac0fb + d412cd3 commit 25bd59f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
Binary file modified example/icons/icon.icns
Binary file not shown.
Binary file modified example/icons/icon.ico
Binary file not shown.
33 changes: 17 additions & 16 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var EventEmitter = require('events').EventEmitter;
var fs = require('fs-extra');
var path = require('path');
var url = require('url');
var rcedit = Promise.promisify(require('rcedit'));
var winresourcer = Promise.promisify(require('winresourcer'));
var spawn = require('child_process').spawn;
var semver = require('semver');

Expand Down Expand Up @@ -415,22 +415,23 @@ NwBuilder.prototype.handleWinApp = function () {
// Set icon
if (self.options.winIco) {
self.emit('log', 'Update executable icon');
rcedit(
path.resolve(winPlatform.releasePath, _.first(winPlatform.files)),
{
icon: path.resolve(self.options.winIco)
},
function(err){
if(err) {
done.reject('Error while updating the Windows icon.' +
(process.platform !== "win32" ? ' Wine (winehq.org) must be installed to add custom icons from Mac and Linux.' : '')
);
}
else {
done.resolve();
}
winresourcer({
operation: "Update",
exeFile: path.resolve(winPlatform.releasePath, _.first(winPlatform.files)),
resourceType: "Icongroup",
resourceName: "IDR_MAINFRAME",
lang: 1033, // Required, except when updating or deleting
resourceFile: path.resolve(self.options.winIco)
}, function(err) {
if(err) {
done.reject('Error while updating the Windows icon.' +
(process.platform !== "win32" ? ' Wine (winehq.org) must be installed to add custom icons from Mac and Linux.' : '')
);
}
);
else {
done.resolve();
}
});
}

return done.promise;
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
"tape": "^2.12.3"
},
"dependencies": {
"semver": "^2.3.1",
"request": "~2.40.0",
"progress": "~1.1.7",
"lodash": "~2.4.1",
"archiver": "^0.10.0",
"bluebird": "~1.2.2",
"temp": "~0.7.0",
"plist": "^1.0.0",
"decompress-zip": "0.0.8",
"simple-glob": "~0.1.0",
"inherits": "~2.0.1",
"fs-extra": "^0.10.0",
"archiver": "^0.10.0",
"tar-fs": "^0.3.2",
"inherits": "~2.0.1",
"lodash": "~2.4.1",
"ncp": "^0.6.0",
"optimist": "^0.6.1",
"plist": "^1.0.0",
"progress": "~1.1.7",
"request": "~2.40.0",
"rimraf": "^2.2.8",
"semver": "^2.3.1",
"simple-glob": "~0.1.0",
"tar-fs": "^0.3.2",
"temp": "~0.7.0",
"update-notifier": "^0.1.8",
"rcedit": "0.2.0",
"ncp": "^0.6.0",
"rimraf": "^2.2.8"
"winresourcer": "^0.9.0"
}
}

0 comments on commit 25bd59f

Please sign in to comment.