Hello.
First things first:
NWJS: 13.0 x64 DEV and 13.2 x64 DEV
OS: Win 10 Home x64
Relative path to main HTML file cannot be used anymore. It was working fine on 0.12.3 but now I must do one of two things:
If I try to use relative path, then I get:
Nie znaleziono pliku (File not found)
Mógł zostać przeniesiony lub usunięty. (It could be moved or deleted.)
ERR_FILE_NOT_FOUND
I believe it is not intended behavior because I haven't found this in documentation.
Files structure
┣ NWJS
┃ ┗ package.json
┣ start.html
â”— start.bat
package.json
{
"main": "../start.html",
"name": "AppName",
"description": "",
"version": "1",
"nodejs": true,
"window": {
"title": "app title",
"icon": "",
"frame": true,
"width": 920,
"height": 520,
"position": "center"
},
"webkit": {
"plugin": false
},
"chromium-args": "--data-path='NWJS/Storage' --user-data-dir='NWJS/User data'"
}
start.bat
@echo off
cd /d %~dp0
start "" "..\..\bin\0.13.2 SDK\x64\nw.exe" "%cd%/NWJS" %*
Nobody can resolve this issue? @rogerwang
@liufangfang
A solution for now is to use symlinks. In your folder with nw.exe create a symlink named "package.nw" which points to PROJECT_ROOT folder. In the PROJECT_ROOT folder you can put a "package.json" file and change "main" to "start.html".
It should be a bug. I expect the authority can fix it. I can only wait, @rogerwang
@rogerwang ???
After this issue I have changed my approach. Maybe it will be useful for someone. I still don't like to place package.json in root folder but haven't yet try to move it deeper in newest release.
File structure:
┣ cache/
┣ package.json
┣ index.html
â”— run.bat
run.bat
Batch file I use to start the application. It can be converted to exe with ease.
@echo off
cd /d %~dp0
start /b "" ..\..\bin\RUN_LATEST_SDK.bat "%cd%" %*
exit
RUN_LATEST_SDK.bat
This batch is single place that redirects to path of for the latest NWJS version.
I will publish it's content when I'll be back home.
If I change my directory structure, I will do a big change.
I'm having the same issue...is this going to be solved in some way?
will add a command line flag to specify project root.
Most helpful comment
will add a command line flag to specify project root.