nwutils / nw-builder

Build NW.js applications for Linux, MacOS and Windows

Home Page:http://nwutils.io/nw-builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Executable file if run on another machine fails

abhidaa1233 opened this issue · comments

commented

Issue Type

The executable generated in my machine if shared doesn't work in another system.

  • Feature Request

What is the process to get a completely independent executable that can run on another system without depending on external dependencies?

  • Successfully reproduced against the latest version of NW.js?

Current/Missing Behavior

Expected/Proposed Behavior

Additional Info

  • Operating System: Windows 10
  • NW.js Version: 0.77.0
  • Node version: 20.1.0
  • Repro link:

@abhidaa1233 Please elaborate what you mean by "another system"? Different computer same platform and arch or different platform and arch?

commented

@ayushmanchhabra same platform and architecture..In my case Windows and x64. The executable runs smoothly inside the project folder also if I copy to another directory it runs , but failed when trying to install in another pc. I think it's missing some dependencies, how to pack everything in that exe so that i can run independently

@abhidaa1233 Whats the output in the console/terminal when trying to run the executable on other system?

commented

There is nothing in the console, also the production version or the executable which we get via npm run prod , when run this the right click menu not coming but its coming for the dev version or when I run "npm run dev". Also when I copy the executable from my project drive to desktop it now giving error "The code execution cannot proceed because nw_elf.dll was not found. Reinstalling the program may fix this"

I'll try to debug this on my end. Most probably will be an answer by tomorrow.

I can only assume @abhidaa1233 believes nw-builder turns the entire app (including NW.js) into a single executable. That's not how nw-builder works, though. This package allows you to package your application for distribution, but does not generate a single executable. You will always need to copy the entire output directory to the system where you want it to run. The files in this directory other than the executable are necessary dependencies.

I can only assume @abhidaa1233 believes nw-builder turns the entire app (including NW.js) into a single executable. That's not how nw-builder works, though. This package allows you to package your application for distribution, but does not generate a single executable. You will always need to copy the entire output directory to the system where you want it to run. The files in this directory other than the executable are necessary dependencies.

AHH that makes sense. Yes the whole outDir directory is required.

commented

So suppose If I have to give someone to execute in their system so I need to give only the outDir (in my case the dist/src folder) and tell them to go inside that and click on the exe file to execute?

Also if possible let me know how to make a single executable. I can understand it may not be possible for you to recommend any third party software here but if its possible to do it manually in any way please do let me know or other options to do it.
Recently I tried with enigma virtualbox, there I had to give my generated executable as input and also add the folder of the executable, this gave me one single executable. It is working normally in my system but in other windows systems it failed to open but in one system which had Windows Server edition it ran there.

commented

I tried by sharing the outDir (in my case in dist/src folder), and when they tried it worked but it took more time to open at first time. Also the right click reload or opening console in the app is not working in the generated exe, is there any options to enable it on the generated executable if I wanted to?

@abhidaa1233 If you want other people to run your applications you need to package it using installers such as NSIS, MSI or APPX.

I tried by sharing the outDir (in my case in dist/src folder), and when they tried it worked but it took more time to open at first time. Also the right click reload or opening console in the app is not working in the generated exe, is there any options to enable it on the generated executable if I wanted to?

The right click on reload etc may be part of the sdk flavor (--flavor=sdk).

commented

thankx man @ayushmanchhabra , u saved life. My email is abhidaa1233@gmail.com, please do connect or send me your linkedln link. I know I should not post any personal things here, I will delete this msg after sometime. Thankx again man

Welcome!

Email: info@ayushmamchhabra
LinkedIn: https://www.linkedin.com/in/ayushmanchhabra/

commented

One more thing I wanted to ask is, that is the outDir enough for packaging or the executable has some other dependencies in other folders in our project which I should include

outDir has everything needed to run the executable