Skip to content

EdwonLim/Node-Webkit-Packager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node-Webkit-Packager

完成MacOS上Node-webkit的App自动打包脚本,支持打包Mac AppWin32 App

1.Node-webkit项目目录为resources;

2.脚本文件tool/builder.sh, 参数有一个为Resources绝对路径,不给出,为默认为项目下resources目录;

3.将Node-Webkit的核心文件放到node-webkit目录下,分macwin两个目录,mac下应有node-webkit.app,而win下应有nw.exenwsnapshot.exenw.pakicudt.dllffmpegsumo.dlllibEGL.dlllibGLESv2

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.icnsInfo.plist

Info.plist代码:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>NAME</string>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFile</key>
            <string>app.icns</string>
            <key>CFBundleTypeName</key>
            <string>NAME</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>PACKAGE.CLASS</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>Folder</string>
            <key>CFBundleTypeOSTypes</key>
            <array>
                <string>fold</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>None</string>
        </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>node-webkit</string>
    <key>CFBundleIconFile</key>
    <string>app.icns</string>
    <key>CFBundleIdentifier</key>
    <string>PACKAGE</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>NAME</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>29.0.1547.31</string>
    <key>CFBundleVersion</key>
    <string>1547.31</string>
    <key>LSFileQuarantineEnabled</key>
    <true/>
    <key>LSMinimumSystemVersion</key>
    <string>10.6.0</string>
    <key>NSPrincipalClass</key>
    <string>NSApplication</string>
    <key>NSSupportsAutomaticGraphicsSwitching</key>
    <true/>
    <key>SCMRevision</key>
    <string>213023</string>
    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>com.pkware.zip-archive</string>
            </array>
            <key>UTTypeDescription</key>
            <string>NAME</string>
            <key>UTTypeIconFile</key>
            <string>app.icns</string>
            <key>UTTypeIdentifier</key>
            <string>PACKAGE.CLASS</string>
            <key>UTTypeReferenceURL</key>
            <string>URL</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>com.apple.ostype</key>
                <string>node-webkit</string>
                <key>public.filename-extension</key>
                <array>
                    <string>nw</string>
                </array>
                <key>public.mime-type</key>
                <string>application/x-node-webkit-app</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

其中NAMEPACKAGECLASSURL会根据配置项自动替换。(也可以自定义)

对于Win32,前四个配置项无效。然后用工具生成安装包即可。

About

Node-webkit打包工具

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages