NWJS not completely closing when exiting app

Bugs will be moved here once resolved.

Post » Sun Jan 24, 2016 1:04 pm

Hey people, I've made a quick fix for nw.exe not closing which should work until this is fixed:

1. Download this .bat file or create one yourself by opening notepad and entering the following: taskkill /f /im nw.exe before saving the file as nw_exit.bat

2. Copy the nw_exit.bat to the \NWjsForC2\win64 and win32 folders, which will ensure the files are added to all new exports.

3. In C2, find the event you use to close the game. Above the Browser Close action add a NWjs run file action. In the Path box add: """"&NodeWebkit.AppFolder&"nw_exit.bat"""""
Here I also add a wait 0.1 second action and then the browser close action just in case the file doesn't run.

4. Export the game. Now when you click on your exit button the .bat script should run, closing all nw.exe processes!

I really have no idea what I'm doing when it comes to programming. My initial thought was to run javascript that could kill the process, and while there seems to be a way , I'd have no idea how to format this in a way C2 understands.

I hope this helps you as much as it helped me!
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Sun Jan 24, 2016 2:45 pm

This is unrelated to the previous post.
Browser close seems to work for the 32 bit export, but not for the preview.
No way to test the preview for 64.
The 32 bit preview, and 32 bit export seem to be different from each other somehow.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Sun Jan 24, 2016 3:51 pm

Just to stress how important it is to get a fix for this - those who close the game through alt-f4, the close window button or if the game crashes will still have the additional nw.exe's running.
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Sun Jan 24, 2016 6:58 pm

For me, the 64 preview version works fine so far. But that's after copying all the project into a new one. Might be a problem of corruption of files. Not really sure.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Jan 25, 2016 3:28 am

AlexFrancois wrote:Hey people, I've made a quick fix for nw.exe not closing which should work until this is fixed:

1. Download this .bat file or create one yourself by opening notepad and entering the following: taskkill /f /im nw.exe before saving the file as nw_exit.bat

2. Copy the nw_exit.bat to the \NWjsForC2\win64 and win32 folders, which will ensure the files are added to all new exports.

3. In C2, find the event you use to close the game. Above the Browser Close action add a NWjs run file action. In the Path box add: """"&NodeWebkit.AppFolder&"nw_exit.bat"""""
Here I also add a wait 0.1 second action and then the browser close action just in case the file doesn't run.

4. Export the game. Now when you click on your exit button the .bat script should run, closing all nw.exe processes!

I really have no idea what I'm doing when it comes to programming. My initial thought was to run javascript that could kill the process, and while there seems to be a way , I'd have no idea how to format this in a way C2 understands.

I hope this helps you as much as it helped me!


I am very grateful since you save me a lot of trouble and allow me to release my newest demo on the schedule I planned out.
For the close window option, I just export it as borderless and allow alt+F4 to activate the .bat file as well on the setting event sheet.

Yup, no nwjs process to be seen anywhere once the .bat is used.
B
36
S
18
G
11
Posts: 248
Reputation: 8,694

Post » Mon Jan 25, 2016 5:53 am

Thanks for the quick fix.

Is anyone else having random frame rate drops with the new node webkit?

I tested in chrome and my game ran fine but when it runs with node webkit there is frame rate drops that randomly happen.
B
10
S
4
Posts: 56
Reputation: 919

Post » Mon Jan 25, 2016 7:06 am

How about starting a new thread @Bodran, this one's crowded already.
Image ImageImage
B
169
S
50
G
173
Posts: 8,313
Reputation: 110,270

Post » Mon Jan 25, 2016 6:19 pm

@Sethmaster No worries, I'm glad it helped! Good idea with the alt-f4, I created an event and it works perfectly :)
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Tue Jan 26, 2016 5:17 pm

@AlexFrancois thanks for your fix, I really needed this!
for NWjs run file action I put "nw_exit" then export then just add nw_exit.bat to the package.nw
B
18
S
3
Posts: 32
Reputation: 1,191

Post » Tue Jan 26, 2016 5:28 pm

I think this is to do with NW.js 0.12 upgrades. The data folder NW.js 0.12 uses seems to have been in a different format to the one NW 0.13 uses, so if you in-place upgrade an app then it uses the 0.12 data folder in a 0.13 app and that seems to cause some weird issues (mostly just ghost processes, but I've seen one or two other related issues). Renaming the project causes it to start using a new empty data folder (because the data folder name is based on the project name). This fixes it and also explains why I can't reproduce the problem, because I'm just testing fresh 0.13 apps which work fine. Either way, it's a NW.js issue so it would probably be better to take this to the NW.js issue tracker, but we'd probably need a good repro for the NW.js devs. So, is anyone able to make a repro for this based on running a NW.js 0.12 app and then updating it to 0.13?
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

PreviousNext

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests