LoginSignup
8
9

More than 5 years have passed since last update.

node-webkit windowsで環境構築

Last updated at Posted at 2014-09-09

windows vista 32bit で確認しました。
windowsでnode-webkitをダウンロードからアプリ作成まで

  1. node-webkitをダウンロード
    https://github.com/rogerwang/node-webkit#downloads

  2. ダウンロードが終わったら展開します

  3. 展開したフォルダの中に新しいフォルダを作ります
    (フォルダ名は任意、ここではappとつけています)

  4. node-webkitフォルダにjsonファイル、作成したフォルダの中にhtmlファイルを作ります
    (ファイル名は任意、ここではpackage.json ,index.htmlとしています)

package.json

{
  "name": "test",
  "main": "app/index.html",
  "window": {
     "width": 640,
     "height": 640,
     "toolbar": true
  }
}

index.html

<!DOCTYPE html>
<html>
  <head>
    <title>sample</title>
    <style>body{background-color: red;}</style>
  </head>
  <body>
    <h1>sample</h1>
  </body>
</html>

作り終わったら、appフォルダを圧縮します。
圧縮したらコマンドプロンプトを起動します


cd c:\展開したフォルダ名

cdで展開したフォルダまで移動したら


copy /b nw.exe+app.zpp test.exe

とうちます、するとフォルダの中にtest.exeというファイルができているので開きます
先ほど作ったindex.htmlの内容が反映されていたら成功です。

appフォルダの中でアプリ本体を作成していきます
package.jsonで画面の幅やツールバーを表示。。。などを設定していく感じです。

8
9
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
8
9