diff --git a/example/icons/icon.icns b/example/icons/icon.icns index 0f8492b5b..a524a3a53 100644 Binary files a/example/icons/icon.icns and b/example/icons/icon.icns differ diff --git a/example/icons/icon.ico b/example/icons/icon.ico index 978565c75..92ca9753b 100644 Binary files a/example/icons/icon.ico and b/example/icons/icon.ico differ diff --git a/lib/index.js b/lib/index.js index 0b1a19015..b997d9e02 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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'); @@ -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; diff --git a/package.json b/package.json index dd5ae40b9..3082c4d30 100644 --- a/package.json +++ b/package.json @@ -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" } }