From a576d4e217a45275663528a7d6f577e76ebfe3d1 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Thu, 10 Mar 2016 12:54:09 +0800 Subject: [PATCH] Copy icon with correct extension for windows --- src/build/buildMain.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/build/buildMain.js b/src/build/buildMain.js index 2e98eb1..5a19198 100644 --- a/src/build/buildMain.js +++ b/src/build/buildMain.js @@ -100,6 +100,7 @@ function maybeNoIconOption(options) { const packageOptions = JSON.parse(JSON.stringify(options)); if (options.platform === 'win32' && !isWindows()) { if (!hasBinary.sync('wine')) { + console.warn('Wine is required to set the icon for a Windows app when packaging on non-windows platforms'); packageOptions.icon = null; } } @@ -125,8 +126,10 @@ function maybeCopyIcons(options, appPath, callback) { } // windows & linux + // put the icon file into the app const destIconPath = path.join(appPath, 'resources/app'); - copy(options.icon, path.join(destIconPath, 'icon.png'), error => { + const destFileName = `icon${path.extname(options.icon)}`; + copy(options.icon, path.join(destIconPath, destFileName), error => { callback(error); }); }