打包网站为Windows程序
打包网站为Windows程序
如何优雅的把网站封装为Windows的EXE客户端呢?
这里我们提供了方案!
Step1.安装NodeJS
去nodejs的官网下载最新的安装包,安装成功后在CMD命令行中输入npm -v
Step2.使用NPM安装nativefier
nativefier是一个Github上开源的项目
地址:https://github.com/nativefier/nativefiernpm install nativefier -g
Step3.打包网站
这里演示打包GameRole的主页nativefier --icon C:\temp\favicon.ico --name "GameRole" "http://www.gamerole.cn"
注意! —icon是应用的图标 —name是应用名称,两项其实都可以不写,不过根据我自己习惯给加上了
输出之后可以在App built to C:\Users\salte\GameRole-win32-x64, move to wherever it makes sense for you and run the contained .exe file
该行找to后面的路径,那就是客户端生成的路径,由于内核是Webkit所以APP.exe体积很大