当前位置: 首页 > news >正文

做PPT参考图片网站 知乎百度一下你就知道百度一下

做PPT参考图片网站 知乎,百度一下你就知道百度一下,宁波建网站公司,网站建设要求说明Electron 打包工具有很多,如Electron-build、 Electron Forge 等,这里使用Electron-build,而Electron-build使用了nsis组件来创建安装向导,默认情况nsis安装向导不能自定义安装向导界面,但是nsis提供了nsis脚本可以扩展…

Electron 打包工具有很多,如Electron-build、 Electron Forge 等,这里使用Electron-build,而Electron-build使用了nsis组件来创建安装向导,默认情况nsis安装向导不能自定义安装向导界面,但是nsis提供了nsis脚本可以扩展安装向导。

0.效果图

在这里插入图片描述

1.配置nsis脚本

在新建nsis脚本文件resources/installer.nsh,并添加自定义内容:

!define MUI_LANGUAGE "Chinese"
Unicode true!include nsDialogs.nsh
!include LogicLib.nsh#OutFile nsDialogs.exe
#RequestExecutionLevel user
#ShowInstDetails showVar Dialog
Var apiUrl
Var other1
Var other2
Var other3
Var other4
Var skipSetPage custom pgPageCreate pgPageLeaveFunction pgPageCreatensDialogs::Create 1018Pop $Dialog${If} $Dialog == errorAbort${EndIf}${NSD_CreateGroupBox} 10% 10u 80% 100u "接入地址配置"Pop $0${NSD_CreateLabel} 20% 26u 20% 10u "接入地址:"Pop $0${NSD_CreateText} 40% 24u 40% 12u ""Pop $apiUrl${NSD_CreateLabel} 20% 40u 20% 10u "其他配置1:"Pop $0${NSD_CreateText} 40% 38u 40% 12u ""Pop $other1${NSD_CreateLabel} 20% 54u 20% 10u "其他配置2:"Pop $0${NSD_CreateText} 40% 52u 40% 12u ""Pop $other2${NSD_CreateLabel} 20% 68u 20% 10u "其他配置3:"Pop $0${NSD_CreateText} 40% 66u 40% 12u ""Pop $other3${NSD_CreateLabel} 20% 82u 20% 10u "其他配置4:"Pop $0${NSD_CreateText} 40% 80u 40% 12u ""Pop $other4${NSD_CreateCheckbox} 20% 96u 100% 10u "跳过当前设置"Pop $skipSetnsDialogs::Show
FunctionEndFunction PgPageLeave${NSD_GetText} $apiUrl $0${NSD_GetText} $other1 $1${NSD_GetText} $other2 $2${NSD_GetText} $other3 $3${NSD_GetText} $other4 $4${NSD_GetState} $skipSet $6;将配置信息写入文件: C:\用户\用户名\AppData\Roaming\demo\config.json${If} $6 == 0SetOutPath "$APPDATA\demo"CreateDirectory "$APPDATA\demo";FileOpen $9 $APPDATA\demo\config.json w;FileWrite $9 '{"apiUrl":"$0","other1":"$1","other2":"$2","other3":"$3","other4":"$4"}';FileClose $9;SetFileAttributes $APPDATA\demo\config.json NORMALStrCpy $0 '{"apiUrl":"$0","other1":"$1","other2":"$2","other3":"$3","other4":"$4"}'FileOpen $5 "$APPDATA\demo\config.json" "w"FileWrite $5 $0FileClose $5${EndIf}FunctionEndSection
SectionEnd

2.在package.json添加nsis脚本

在package.json的build中的nsis添加我们自定义nsis脚本的引用:"include": "resources/installer.nsh",完整配置如下:

"build": {"appId": "com.demo.electron","productName": "Electron应用示例","copyright": "Copyright © Electron应用示例","mac": {"category": "public.app-category.utilities"},"win": {"icon": "./resources/icons/icon.ico","target": [{"target": "nsis","arch": ["ia32","x64"]}],"artifactName": "${productName}_${version}-${arch}.${ext}"},"nsis": {"oneClick": false,"allowElevation": true,"allowToChangeInstallationDirectory": true,"installerIcon": "./resources/icons/icon.ico","uninstallerIcon": "./resources/icons/icon.ico","installerHeaderIcon": "./resources/icons/icon.ico","createDesktopShortcut": true,"createStartMenuShortcut": true,"shortcutName": "Electron应用示例","runAfterFinish": true,"include": "resources/installer.nsh"},"files": ["dist/**/*","dist-electron/**/*"],"directories": {"buildResources": "assets","output": "dist-build"},"publish": [{"provider": "generic","url": "http://192.168.1.2/release/"}],"extraResources": ["./plugins/${platform}/${arch}/**"]},

3.打包

执行打包命令:
npm run electron:build.exe

打包完双击安装包就有效果了。

http://www.15wanjia.com/news/39089.html

相关文章:

  • 制作静态网站头条今日头条
  • 郑州做网站建设公司排名东莞营销网站建设直播
  • 长汀党的建设网站培训机构加盟店排行榜
  • 做写字楼用哪个网站更好线下推广方案
  • wordpress 根据ua跳转seo网站优化怎么做
  • wordpress 真正静态化北京优化网站推广
  • 在ai中做网站图片怎么设置重庆网
  • wordpress 多主题共存南昌seo教程
  • 哈尔滨网站制作中国免费网站服务器2020
  • 为什么要用模板建站哪些网站可以seo
  • 建设网站规划书深圳 网站制作
  • 网站网页模板软文广告发布平台
  • 网站策划网站建设企业个人建网站的详细步骤
  • 买一个网站需要多少钱农产品网络营销推广方案
  • 网站建设 业务走下坡电脑培训学校排名
  • 苏州网站开发公司电话太原网络营销公司
  • 国办网站建设要求百度seo网络营销书
  • 做设计都有什么网站百度搜索数据统计
  • 丰台建设企业网站seo优化大公司排名
  • 网站制作结构太原网站优化
  • 建网站带支付链接南昌seo顾问
  • 电商类网站怎么做推广佛山网站建设公司
  • 石家庄建站模板源码今日中国新闻
  • word怎么做网站广告投放都有哪些平台
  • wordpress用户数据库丹东网站seo
  • 莱州一中网站太原百度推广排名优化
  • 龙虎和网站开发厦门网站建设公司哪家好
  • 做下一个盗版小说网站如何进行搜索引擎营销
  • 国家乡村振兴局站长工具seo优化
  • 秦皇岛住建局官网湖南竞价优化哪家好