1

我们用electron打包生成跨平台软件,官方推荐的打包方式先说一下有两种.
第一种是:electron-packager
第二种是:electron-builder
这两种有什么不同呢?
1.electron-packager 打包会生成
image.png
这样一个文件夹,里面有exe的软件打开直接用
(这不是安装包 是个文件夹)

2.electron-builder 打包会生成
image.png
这样的多类型的安装程序
*注意本文讲的就是第一种electron-packager 打包 不能生成安装包的解决方案
这里就要提一下 nsis 这个东西了!

NSIS中文版下载地址:https://pan.baidu.com/s/1mitSQU0
也可以自行百度下载
关闭杀毒软件 一直下一步 安装完成

然后傻瓜式安装如下;
1
3b7411771fac7851c9c29f6359301c05f1db1edce88cde83b1a29a2ca95dfcb5QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI4NjQ1MTg4XzNFMzE2RjQzLTI1RjMtNGQzZS1CQkEyLUFFNEMwOTVGRDFEOC5wbmc=.png
258aeb9e51c72d9777d8619ae8b0008e56380d4e227a122271f9228d33b369c1bQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI4Njc3MDYyX0FGNTVCQTc1LTcxOTEtNDU1NS1BQzk2LTE4NDk2RDRDNDg4RC5wbmc=.png
37286822f48a97b3f0d8c71d97966899a4b2c6f6300202760ef31528d6383ea2eQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI4NzEyNjkzXzNGQjAwMENELTA0MEQtNDBkYy1CRjdFLTRBMzI0RkRERTY1NS5wbmc=.png
4719b0e4088e46ae97ff0a9e1bae3967f1bf9576d5022291e8d755f2ec21eb39aQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI4ODM4NzQxXzcxRTU1NEFBLTNEMDMtNGY0Zi05ODAzLUFEMUJBOEJFMEY0QS5wbmc=.png
可以更新自己软件的信息,然后下一步
5
52ea5821c8aa52f72b5f192297790edc6ba3f601821e77abeb589b79196dddbfQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI4ODg1MzU3XzE4NDEzN0Y3LTgwNTItNDdiOC04MjE0LTZDQUY5Q0EyRDNCQi5wbmc=.png
669304c5f2493e23a0e6bc08df5a56d5dbcfc5f74b92d277a7dda1e2292ddcb73QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MDA4MzI2XzNFMTc1NjQyLTQ1MjYtNGZmMi05QjhCLTA2NkUwQjIyN0Y0NC5wbmc=.png
74322fa98cec50e8f773991f13b0be2c8c21bfe233d3c6ef844d5ab1ce2d6b1e6QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MDU5NjY5XzVDMzFDNUYzLThFRDMtNDdkZC04NTM1LTZDMTE3MzM5NkY2NC5wbmc=.png
注意删掉授权文件 删除 删除 删除
810328cf6f213cc45fbffa775f6589c17f8cba8b949e18946fc4b10ba6678ad8aQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MTAwODkzXzU1MzQzMTI3LTQ3MjMtNDY4ZC05NUQ0LTZBN0ZDQzU1Q0VCNy5wbmc=.png
删除 删除 删除
9 最关键的一步
746571cf7d31adc6536e9f922345a596fc348e5724545ed6f37f879d1f13071dQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MTE4NDEzX0YxQTVGQzVELUMzOTItNDMxNS1CRjhGLTY2NDUxQzlGQkM1Ny5wbmc=.pngcf03345513f270792d58cbdd40e817ac038b4ddfd95dd2a0854d45e38822f2f9QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MTgzNDIxXzA5MjUzN0JBLTMyNjMtNDg3Ny1CQkYyLTEwMDIzNjdGMTFBNy5wbmc=.pngb8138dd016916e66307033e240eff8b92ad2e761d2a2775fc5626169a382ca18QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MjAyMzgxX0Y3MTVBMkI5LTA0M0MtNDRkOC1CNEI0LTQwNThCRDRFM0NEOS5wbmc=.png8adf01340f2db8f8549397556e6cf7bb7287a48d436f4eaab68ea686e3c52e98QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MjU5NDI5X0M0Qzg3ODFELURCQUMtNGNmNC04MjIxLTE1QzQzQTQwRkQzRS5wbmc=.png22f64ac2891aef7d9f1ea85744f452698c0b7567fe88ad87f241fd1f0c5ef4eeQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5Mjc4NTAxXzdFREQ1MEYyLTc4QkQtNDIwOC1BNEQ2LUUyRDE1Njg1REZFOS5wbmc=.png
选择electron-packager打包后生成的文件夹中的 exe 和全部文件夹 一定要点选 点选 点选
10c7b8469890c2aaaac3bb311b877d7386d84e99956dcd8e365f1e3e2599a4eb79QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5Mjk5MzQxXzY5OTI4NUJBLTgwQ0YtNGE3Zi04MjZCLTM5MEI3NUZDOTYwNS5wbmc=.pngf5bf9b0e7d7504a62750f4d03a51b52801eb5a71b218a7b40805b615316f5cbbQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MzE2OTQ5X0UyOTU1ODczLTcxNjgtNGIyMi1BRjNFLTBGRjRBMTJENUQxRS5wbmc=.png68213ab4d87a3dbe237c167a126e27d6717f93baff870f459d7eb7f4303be142QzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MzM2NjUzXzVBODNCMEQ1LUE0M0UtNGVlMC05OTM5LTFFMUYwMTdGQTNDQi5wbmc=.png
一直下一步
11.80f84fbe31960d4a0fee8a5d4f59bab7ca4537b7c94cac0ebedfc7a6d28dff4aQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5MzU0MzAxXzE0NjE5NjE5LUQxMkYtNDU4Ni1BMzExLUY2NzhFREM0QUY2Ni5wbmc=.png
全部勾选
12.03d5fe080ee6104a5040e2197b6f5fc377901e304d7bdafe5aa342cb6d17279dQzpcVXNlcnNcaHR3aW5zXEFwcERhdGFcUm9hbWluZ1xEaW5nVGFsa1wzNjM4NTg0MzlfdjJcSW1hZ2VGaWxlc1wxNjQyNzI5OTY2NjIzXzI2NDMyQTZGLUFDOUUtNDMzNy05ODQwLTE2NTk1OTdBOTg4RS5wbmc=.png
选择安装包出生的位置!
然后你就得到了安装程序!


三月
425 声望105 粉丝

街市人如鲫,晤君当有期,阴晴岁月稠,黯然眠中泣,相逢属不易,缘定自珍惜。