I am creating an electron app in windows. Everything is working fine but when I run the setup, the desktop shortcut icon is electron's icon.
This is my package.json
file:
{
"name": "happiness",
"version": "1.0.0",
"icon": "logomain.ico",
"iconUrl":"file:///E:/abc/abc1/logomain.ico",
"description": "Descriptions",
"main": "index.js",
"build": {
"appID": "happiness",
"productName": "happiness",
"icon": "logomain.ico"
},
"scripts": {
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron-packager": "^13.0.1"
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0",
"electron-winstaller": "^2.7.0"
}
}
I am using Electron windows installer
to generate final exe
and this is my build.js
file:
var electronInstaller = require('electron-winstaller');
// In this case, we can use relative paths
var settings = {
appDirectory: './release-builds/app-happiness-win32-ia32',
outputDirectory: './myapp-source-built-installers',
authors: 'ABC',
exe: './app-happiness.exe',
setupIcon: 'logomain.ico'
};
resultPromise = electronInstaller.createWindowsInstaller(settings);
resultPromise.then(() => {
console.log("The installers of your application were succesfully created !");
}, (e) => {
console.log(`Well, sometimes you are not so lucky: ${e.message}`)
});
However the icon is displaying in control panel
and in the startup menu
. But in shortcut of the app electron's icon is displaying.
This is the command I'm using:
electron-packager . app-happiness --overwrite --asar=true --platform=win32 --arch=ia32 --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="Happiness" --electron-version=4.0.0 --icon=logomain.ico
and then
node build.js