gpt4 book ai didi

node.js - 使用 Electron 构建器设置 Electron 图标

转载 作者:太空宇宙 更新时间:2023-11-03 21:53:27 42 4
gpt4 key购买 nike

我想在我的 Electron 应用程序中设置新的图标,并在构建我的应用程序时替换默认的 Electron 图标。

我使用 Electron 构建器包。在文档中,我看到图标需要放置在构建目录中。所以:

enter image description here

当我构建我的应用程序时,我收到以下消息:

未设置应用程序图标,将使用默认的 Electron 图标

有人可以帮助我吗?

我的package.json的一部分:

  "scripts": {
"postinstall": "install-app-deps && npmpd",
"pre-build": "./node_modules/.bin/electron-rebuild",
"build-bcrypt": "npm rebuild bcrypt --update-binary",
"develop": "npm run private:compile -- --source-maps true && run-p -r private:watch private:serve",
"test": "mocha -R spec --compilers js:babel-core/register test/**/*.spec.js",
"lint": "eslint --no-ignore scripts app test *.js",
"pack": "run-s private:clean private:compile private:build:all",
"pack:mac": "run-s private:clean private:compile private:build:mac",
"pack:win": "run-s private:clean private:compile private:build:win",
"pack:linux": "run-s private:clean private:compile private:build:linux",
"private:build:all": "build -mwl",
"private:build:mac": "build --mac",
"private:build:win": "build --win",
"private:build:linux": "build --linux",
"private:watch": "npm run private:compile -- --source-maps true --watch --skip-initial-build",
"private:serve": "babel-node scripts/serve.js",
"private:compile": "babel app/ --copy-files --out-dir build",
"private:clean": "rimraf build",
"private:cleandb": "rm -rf ./categories ./presentations ./slides ./users"
},
"build": {
"win": {
"icon": "build/icon.ico"
}
}

最佳答案

package.json中,在win键下,还需要指定图标路径:

"build": {
"win": {
"icon": "build/app.ico"
}
}

关于node.js - 使用 Electron 构建器设置 Electron 图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47263056/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com