1
0
mirror of https://github.com/jiahaog/Nativefier synced 2024-06-26 07:38:59 +02:00

Copy icon with correct extension for windows

This commit is contained in:
Jia Hao 2016-03-10 12:54:09 +08:00
parent b7aada7967
commit a576d4e217

View File

@ -100,6 +100,7 @@ function maybeNoIconOption(options) {
const packageOptions = JSON.parse(JSON.stringify(options)); const packageOptions = JSON.parse(JSON.stringify(options));
if (options.platform === 'win32' && !isWindows()) { if (options.platform === 'win32' && !isWindows()) {
if (!hasBinary.sync('wine')) { 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; packageOptions.icon = null;
} }
} }
@ -125,8 +126,10 @@ function maybeCopyIcons(options, appPath, callback) {
} }
// windows & linux // windows & linux
// put the icon file into the app
const destIconPath = path.join(appPath, 'resources/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); callback(error);
}); });
} }