使用electron-builder打包electron项目,其中Windows提供了NSIS来自定义安装程序。
在主进程的package.json文件中添加一些配置
"scripts":{},"build": {"directories": {"output": "release"},"nsis": {"oneClick": false,"allowToChangeInstallationDirectory": true,"installerIcon": "app/assets/yakitlogo.ico","uninstallerIcon": "app/assets/yakitlogo.ico"},"productName": "Yakit","win": {"artifactName": "${productName}-${version}-windows-amd64.${ext}"},"mac": {"artifactName": "${productName}-${version}-darwin-${arch}.${ext}"},"linux": {"artifactName": "${productName}-${version}-linux-amd64.${ext}"}}
nsis详细配置
参考地址