Set up icon for electron app

- Linux uses BrowserWindow icon option, but the filename was incorrect.
- Windows and Mac use packagerConfig, which differentiates on the file extension automatically, but the file names have to be the same otherwise.
main
Isaiah Odhner 2021-08-03 12:53:13 -04:00
parent 8995af743d
commit 401475e180
5 changed files with 6 additions and 5 deletions

View File

@ -157,7 +157,6 @@ Electron boilerplate stuff:
* [Set up Content-Security-Policy](https://electronjs.org/docs/tutorial/security)
* Remember window position/state
* Add icon to built executable
* Set up autoupdating
* Keep window hidden until loaded (`show: false`, [`ready-to-show`](https://electronjs.org/docs/api/browser-window#event-ready-to-show))
* Ideally name the executable `jspaint.exe` instead of `JS Paint.exe`

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -27,7 +27,9 @@
"main": "src/electron-main.js",
"config": {
"forge": {
"packagerConfig": {},
"packagerConfig": {
"icon": "./images/icons/jspaint"
},
"makers": [
{
"name": "@electron-forge/maker-squirrel",

View File

@ -25,10 +25,10 @@ const createWindow = () => {
minHeight: 360,
icon: require("path").join(__dirname, "../images/icons",
process.platform === "win32" ?
"windows.ico" :
"jspaint.ico" :
process.platform === "darwin" ?
"mac.icns" :
"48.png"
"jspaint.icns" :
"48x48.png"
),
title: "JS Paint",
webPreferences: {