LoginSignup
12
10

More than 5 years have passed since last update.

node-webkitのパッケージングで注意することメモ

Last updated at Posted at 2014-09-13

exe単体で配布するにはツールが必要

exe単体で実行できないじゃないか...

私は元々以下の手順でパッケージングしていたのですが、この方法でできたexeファイルは、単体で実行できるものと思っていました。
そんな噂を聞いていました。
しかし、実行できない...
あれ~

フォルダ構成はこんな感じで(v0.10.4)

node-webkit\
┣ app\
┃ ┣ index.html
┃ ┗ package.json
┣locales\
┣ffmpegsumo.dll
┣libEGL.dll
┣libGLESv2.dll
┣nw.exe
┣nw.pak
┗icudtl.dat

  1. index.htmlとpackage.jsonをまとめてzipに。
  2. 拡張子を.nwに変える(zippedAppFiles.nw)
  3. コマンドプロンプト↓な感じでnw.exeとくっつける。
cd ~\node-webkit  
copy /b nw.exe+app\zippedAppFiles.nw test.exe

nw.pakとicudtl.datが必須なんですね

上記の方法でexeを作る場合、少なくともnw.pakとicudtl.datはセットで配布しなければいけないらしいです。

GitHubのwiki見るとそのまんま書いてある。
https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps#windows-2

test.exeと同じフォルダに、nw.pakとicudtl.datを置いたらちゃんと動きました。

Enigma Virtual Boxを使えば単体で実行できるようになる

でもやっぱ単体の方がなんかスマートな感じしていいよね。
というときは、Enigma Virtual Boxなるツールを使えば実現できるそうです。
へー
https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps#an-alternative-way-to-make-an-executable-file-in-windows

全部GitHubのwikiに書いてあることそのままですね笑

12
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10