From 3afb188ab6292b9d14b015853dd00cc93e3732ea Mon Sep 17 00:00:00 2001 From: Frank Hale Date: Thu, 7 Apr 2016 09:58:23 -0400 Subject: [PATCH] Update build instructions for NW.js 0.13.x --- README.md | 63 +++++++++++++++++++------------------------------------ 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index b9fe44c..53abd5b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ #nw-edge-example -An example usage of Node-Webkit and Edge.JS. This code calls a function inside -a .NET class library from the DOM. I've included everything (except Node-Webkit) +An example usage of Node-Webkit and Edge.JS. This code calls a function inside +a .NET class library from the DOM. I've included everything (except Node-Webkit) so this example code should work out of the box. screenshot @@ -17,19 +17,19 @@ You need Node-Webkit and Windows to run this. - Open command prompt to node-webkit - Run using the command: nw nw-edge-example -**NOTE: The Edge node module is included in the repo on purpose. If you are -running x64 Windows you won't need to run any of the compile instructions below +**NOTE: The Edge node module is included in the repo on purpose. If you are +running x64 Windows you won't need to run any of the compile instructions below as the module has been compiled for NW 0.12.0 already.** ###C# Class Library -The SimpleLibrary.dll is built from the Hello.cs source file. I've omitted the -Visual Studio project to build this from this repository. This library only -contains one function as noted in the Hello.cs. Notice the function signature -is special because by default Edge.JS wants to call asynchronous methods so it -does not block the Javascript engine. +The SimpleLibrary.dll is built from the Hello.cs source file. I've omitted the +Visual Studio project to build this from this repository. This library only +contains one function as noted in the Hello.cs. Notice the function signature +is special because by default Edge.JS wants to call asynchronous methods so it +does not block the Javascript engine. -If you want to see more examples of using Edge.JS please see it's Github +If you want to see more examples of using Edge.JS please see it's Github repository located at: https://github.com/tjanczuk/edge @@ -38,8 +38,8 @@ https://github.com/tjanczuk/edge ###Building Your Own Edge.JS -Edge.JS has to be rebuilt using nw-gyp in order for it to work from within -Node-Webkit. +Edge.JS has to be rebuilt using nw-gyp in order for it to work from within +Node-Webkit. NOTE: By default Edge.JS is built using node-gyp and only works within Node.JS. @@ -47,13 +47,13 @@ Things you need in order to build Edge.JS yourself: - Visual Studio 2013 - Python 2.7.x -- Node.JS 0.12.0 +- Node.JS 5.x - nw-gyp (npm install -g nw-gyp) -Next, open a command prompt to your source code directory and install the +Next, open a command prompt to your source code directory and install the Edge.JS module using npm: -Create a folder on your desktop (for illustration call it my-app) and copy the +Create a folder on your desktop (for illustration call it my-app) and copy the Node-Webkit runtime files to it. Next open a command prompt to the my-app folder and install the Edge.JS module: @@ -63,15 +63,13 @@ c:\>cd my-app c:\my-app>npm install edge ``` -This will create a node-modules folder and then install edge into that folder. -Now we need to recompile Edge using nw-gyp (instead of node-gyp which it is +This will create a node-modules folder and then install edge into that folder. +Now we need to recompile Edge using nw-gyp (instead of node-gyp which it is built with by default). -**NOTE: Assuming Node-Webkit 0.12.0 is the target version of Node-Webkit.** - ``` c:\my-app\>cd node_modules\edge -c:\my-app\node_modules\edge>nw-gyp configure --target=v0.12.0 --msvs_version=2013 +c:\my-app\node_modules\edge>nw-gyp configure --target=v0.13.3 --msvs_version=2013 --arch=x64 c:\my-app\node_modules\edge>nw-gyp build ``` @@ -81,34 +79,17 @@ Once the build finishes, the new module will be in: c:\my-app\node_modules\edge\build\Release ``` -Copy edge.node to: (depending on your architecture, I built against x64) - -``` -c:\my-app\node_modules\edge\lib\native\win32\x64\0.12.0 -``` - -Additionally, you will likely need to edit the versionMap in node_modules\edge\lib\edge.js - -Add the following line: (update as necessary for the version of Node you are -using, currently Node 0.12 is being reported as Node 0.1.2 by Edges version -detection function. So you'll have to update the versionMap inside the -following file: - -``` -node_modules\edge\lib\edge.js -``` - -Add the following line to the versionMap: +Copy edge_coreclr.node and edge_nativeclr to: (depending on your architecture, I built against x64) ``` -[ /1.2.0/, '0.12.0' ] +c:\my-app\node_modules\edge\lib\native\win32\x64\5.1.0 ``` ###Author Frank Hale <frankhale@gmail.com> -9 March 2015 +7 April 2016 -###License +###License GPL version 3, see LICENSE file for details