Closed nicklaw5 closed 8 years ago
The "Unable to load file" is printed from https://github.com/atom/rcedit/blob/master/src/main.cc#L100.
I currently can't make it appear on Windows 7, and I presume it's a related to the terminal you are using (I use the Git Bash from Git for Windows).
Can you please prepend a console.log(rcedit, args);
to $DIR_NWJS_BUILDER/node_modules/rcedit/lib/rcedit.js#29
(https://github.com/atom/node-rcedit/blob/master/src/rcedit.coffee#L27), so that we can find if there is a difference in the arguments?
Thanks.
@evshiron I'm also using Git for Windows.
Here is the args
dump:
Nick@DESKTOP-78VVOH6 MINGW64 /f/Code/stryve-app/build (v0.3.0-beta)
$ nwb nwbuild -v 0.14.4-sdk -p win32,win64 --win-ico ./favicon.ico ../
{ version: 'v0.14.4',
flavor: 'sdk',
targets: [ [ 'win', 'x86' ], [ 'win', 'x64' ] ],
path: '../' }
0: Read package.json
1: Prepare build directory at stryve-win-ia32
2: Copy binary from C:\Users\Nick\.nwjs-builder\caches\binary-nwjs-sdk-v0.14.4-win-ia32
3: Make working directory
4: Compress application
5: Combine executable at stryve-win-ia32\nw.exe
6: Edit Windows executable
C:\Users\Nick\AppData\Roaming\npm\node_modules\nwjs-builder\node_modules\rcedit\bin\rcedit.exe [ 'stryve-win-ia32\\nw.exe',
'--set-version-string',
'ProductName',
'stryve',
'--set-version-string',
'FileDescription',
'A socket.io-driven chat application.',
'--set-version-string',
'InternalName',
'stryve',
'--set-version-string',
'CompanyName',
'Stryve',
'--set-version-string',
'OriginalFilename',
'stryve',
'--set-file-version',
'0.3.0',
'--set-product-version',
'0.3.0',
'--set-icon',
'./favicon.ico' ]
Fatal error: Unable to load file
Not much difference here, but it failed to fail :(
Have tried all of the below but still unresolved:
rcedit.exe
the absolute path to the build's nw.exe
C:
drive, rather than F:
, using output option (-o ~/
)nwb
from application node_modules
folder as opposed to running it globally.All attempts resulted in the same error:
$ node_modules/nwjs-builder/bin/nwb nwbuild -v 0.14.4-sdk -p win32 ./
{ version: 'v0.14.4',
flavor: 'sdk',
targets: [ [ 'win', 'x86' ] ],
path: './' }
0: Read package.json
1: Prepare build directory at stryve-win-ia32
2: Copy binary from C:\Users\Nick\.nwjs-builder\caches\binary-nwjs-sdk-v0.14.4-win-ia32
3: Make working directory
4: Compress application
5: Combine executable at stryve-win-ia32\nw.exe
6: Edit Windows executable
Fatal error: Unable to load file
Farewell!
Greetings. Some other things I want to know:
rcedit.exe
have failed?copy /b a.exe+b.nw c.exe
, we can check if the result is expected by opening it with HxD Hex Editor or something like that.@evshiron thanks for the suggested actions.
I will attempt to build from my work machine (also Windows 10). If that fails, I will try and build it on Windows 7 VM. I will also try on an example app.
If all else fails, I can provide you with my source files and you can take a look for yourself.
I'll report back soon.
@nicklaw5 In nwjs-builder
1.8.1, I reorder the steps and the "Edit Windows executable" process now handles original executables rather than the combined ones. Could you please try it out and see if it makes any difference?
@evshiron Downloaded v1.10.3. Getting the below error now:
$ nwb nwbuild -v 0.14.4-sdk -p win32,win64 -o ./builds ./
{ version: 'v0.14.4',
flavor: 'sdk',
targets: [ [ 'win', 'x86' ], [ 'win', 'x64' ] ],
path: './' }
0: Read package.json
1: Prepare build directory at builds\stryve-win-ia32
2: Copy binary from C:\Users\Nick\.nwjs-builder\caches\binary-nwjs-sdk-v0.14.4-win-ia32
3: Edit Windows executable
Fatal error: Unable to parse version string
I am feeling weird. Could you please clone this repo and run npm install && npm test
to see if all tests pass?
The test failed the first time I ran it with this error:
1) module nwbuild#build should build in "./temp/build/":
Error: timeout of 300000ms exceeded. Ensure the done() callback is being ca lled in this test.
at null.<anonymous> (F:\Code\nwjs-builder\node_modules\mocha\lib\runnable. js:226:19)
But I assumed it just exceeded the maximum run time of 5 mins, so I ran it again and all 6 tests passed.
You can clone the repo yourself if you'd like:
git clone https://github.com/nicklaw5/stryve.git
npm install
npm run build # builds neccessary webpack asset files
nwb nwbuild -v 0.14.4-sdk -p win32 -o ./builds ./ # assuming nwjs-builder is installed globally
@nicklaw5 Thanks for your testing and the repo.
It comes out to be that the version
in your package.json
isn't accepted by rcedit.exe
, as it expects x.x.x[.x]
, thus "Fatal error: Unable to parse version string" happens.
In nwjs-builder
1.10.4, I have extended some manifest options which enable you to custom the name
, version
and description
rather than using the name
, version
and description
from the package.json
.
You should be able to build with some additional changes to your package.json
:
{
...,
"nwjsBuilder": {
"productVersion": "0.3.0"
}
}
If there is further question, feel free to ask.
@evshiron thanks I will check it out when I get home from work.
@evshiron all good now. Thanks for your help.
OS: Windows 10 Node: v5.1.0 npm: 3.3.12
I run all my code from a secondary drive (
F:
) as opposed toC:
. Would that make any difference?Also worthy to note that the below worked