Node-webkit打包工具。
完成MacOS上Node-webkit的App自动打包脚本,支持打包
Mac App和Win32 App。
1.Node-webkit项目目录为
resources;
2.脚本文件
tool/builder.sh, 参数有一个为Resources绝对路径,不给出,为默认为项目下resources目录;
3.将Node-Webkit的核心文件放到
node-webkit目录下,分mac和win两个目录,mac下应有node-webkit.app,而win下应有nw.exe、nwsnapshot.exe、nw.pak、icudt.dll、ffmpegsumo.dll、libEGL.dll、libGLESv2;
4.配置文件
config/app.config:app_name=Demo //APP的名称
app_class=demo //APP的Class
app_package=me.edwon.nw //APP的Package
app_site=http://edwon.sinaapp.com //APP的官方地址
app_type=all //需要打包的类型 all|mac|win
对于
Mac,需要在config/mac下增加app.icns和Info.plist。
Info.plist代码:
CFBundleDevelopmentRegion
en
CFBundleDisplayName
NAME
CFBundleDocumentTypes
CFBundleTypeIconFile
app.icns
CFBundleTypeName
NAME
CFBundleTypeRole
Viewer
LSHandlerRank
Owner
LSItemContentTypes
PACKAGE.CLASS
CFBundleTypeName
Folder
CFBundleTypeOSTypes
fold
CFBundleTypeRole
Viewer
LSHandlerRank
None
CFBundleExecutable
node-webkit
CFBundleIconFile
app.icns
CFBundleIdentifier
PACKAGE
CFBundleInfoDictionaryVersion
6.0
CFBundleName
NAME
CFBundlePackageType
APPL
CFBundleShortVersionString
29.0.1547.31
CFBundleVersion
1547.31
LSFileQuarantineEnabled
LSMinimumSystemVersion
10.6.0
NSPrincipalClass
NSApplication
NSSupportsAutomaticGraphicsSwitching
SCMRevision
213023
UTExportedTypeDeclarations
UTTypeConformsTo
com.pkware.zip-archive
UTTypeDescription
NAME
UTTypeIconFile
app.icns
UTTypeIdentifier
PACKAGE.CLASS
UTTypeReferenceURL
URL
UTTypeTagSpecification
com.apple.ostype
node-webkit
public.filename-extension
nw
public.mime-type
application/x-node-webkit-app
其中
NAME、PACKAGE、CLASS、URL会根据配置项自动替换。(也可以自定义)
对于
Win32,前四个配置项无效。然后用工具生成安装包即可。