quick-start
quick-start copied to clipboard
Unable to change app icon for exe file
Describe the bug
I am trying to change app icon for my exe file, attaching my electron-builder.yml file, the build is successful but my exe file icon does not change, it is 256x256 size and icon file, but does not show. Even install file icon change but not exe file.
appId: com.ownloader.app
productName: pepper-downloader
directories:
buildResources: build
files:
- '!**/.vscode/*'
- '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
asarUnpack:
- resources/**
extraResources:
- from: build/icon.ico
to: icon.ico
win:
executableName: pepper-downloader
icon: build/icon.ico
nsis:
artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
mac:
entitlementsInherit: build/entitlements.mac.plist
extendInfo:
- NSCameraUsageDescription: Application requests access to the device's camera.
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
notarize: false
dmg:
artifactName: ${name}-${version}.${ext}
linux:
target:
- AppImage
- snap
- deb
maintainer: electronjs.org
category: Utility
appImage:
artifactName: ${name}-${version}.${ext}
npmRebuild: false
publish:
provider: generic
url: https://example.com/auto-updates
package.json
{
"name": "pepper-downloader",
"version": "1.0.0",
"description": "",
"main": "./out/main/index.js",
"author": "MIRTAHAALI",
"homepage": "https://electron-vite.org",
"scripts": {
"format": "prettier --write .",
"lint": "eslint --cache .",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
"start": "electron-vite preview",
"dev": "electron-vite dev",
"build": "electron-vite build",
"postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir",
"build:win": "npm run build && electron-builder --win",
"build:mac": "electron-vite build && electron-builder --mac",
"build:linux": "electron-vite build && electron-builder --linux"
},
"dependencies": {
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^4.0.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@iconify/react": "^6.0.0",
"@mui/icons-material": "^7.1.1",
"@mui/material": "^7.1.1",
"@mui/x-data-grid": "^8.5.0",
"@reduxjs/toolkit": "^2.8.2",
"easydl": "^1.2.0",
"express": "^5.1.0",
"joi": "^17.13.3",
"react-redux": "^9.2.0",
"socket.io": "^4.8.1"
},
"devDependencies": {
"@electron-toolkit/eslint-config-prettier": "^3.0.0",
"@electron-toolkit/eslint-config-ts": "^3.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@types/node": "^22.14.1",
"@types/react": "^19.1.1",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.3.4",
"electron": "^35.1.5",
"electron-builder": "^25.1.8",
"electron-vite": "^3.1.0",
"eslint": "^9.24.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.19",
"prettier": "^3.5.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.8.3",
"vite": "^6.2.6"
},
"pnpm": {
"onlyBuiltDependencies": [
"electron",
"esbuild"
]
}
}
Used Scaffolding
create-electron
Used Package Manager
npm
Validations
- [x] Follow the Code of Conduct.
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.