Executable file if run on another machine fails #903
-
Issue TypeThe executable generated in my machine if shared doesn't work in another system.
What is the process to get a completely independent executable that can run on another system without depending on external dependencies?
Current/Missing BehaviorExpected/Proposed BehaviorAdditional Info
|
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 1 reply
-
@abhidaa1233 Please elaborate what you mean by "another system"? Different computer same platform and arch or different platform and arch? |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
@abhidaa1233 Whats the output in the console/terminal when trying to run the executable on other system? |
Beta Was this translation helpful? Give feedback.
-
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" |
Beta Was this translation helpful? Give feedback.
-
I'll try to debug this on my end. Most probably will be an answer by tomorrow. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
AHH that makes sense. Yes the whole |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
@abhidaa1233 If you want other people to run your applications you need to package it using installers such as NSIS, MSI or APPX. |
Beta Was this translation helpful? Give feedback.
-
The right click on reload etc may be part of the sdk flavor ( |
Beta Was this translation helpful? Give feedback.
-
thankx man @ayushmanchhabra , u saved life. My email is [email protected], 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 |
Beta Was this translation helpful? Give feedback.
-
Welcome! Email: info@ayushmamchhabra |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
outDir has everything needed to run the executable |
Beta Was this translation helpful? Give feedback.
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.