Compiling Windows EXE


John Clarke
How can I compile my application as a Windows EXE?

Samuel Vanneste
Hello John,
Electron is the solution.

Enable Electron's support in your app's configuration and compile (build) your app. You'll get the necessary batch files already available to ease your work.

Hope this can help.

DecSoft

Hello to all,

Yes; as Samuel said (thanks for your help, Samuel!), the Cordova Electron platform appear the best option, since Apache Cordova (and DecSoft App Builder integrates it too) support the Windows UWP (Universal Windows Platform), however, what we get is not exactly an executable.

Here you can take a look at the documentation of the Cordova Electron platform. There is not too much requirements for this particular platform.

However, I must recognize that, even when I get it working in the past, right now, probably due to some misconfiguration here in my PC, I can't get the executable of the app as expected, due to some NodeJS (or Electron itself...) problems / errors that I must investigate.

By now, I publish a new release of AB which changes the default settings for the Electron platform. If you finally get it working (I hope it), there is know problem that can cause that the app can't work as expected, as you can read here in the Electron FAQs.

What the new relase of AB do is to avoid the usage of NodeJS modules, since, I am not sure right now how to implement the proposed solution in the Electron FAQ. If you want to use NodeJS modules, by now, you can follow that instructions to get it working.

Cordova Electron appear very interesting. I want try to solve here the problems that I get right now. Maybe you did not get any problem and can compile the app without problems, asseting that you meet the requirements, just by executing one of the AB provided BAT files or the provided SHELL files for that platform.

Feel free to post here if you find any problem, so we try to help. AB is ready for this platform.



DecSoft

Hello to all,

Well. Just to mention that I finally can get the executable (and the installer) of the app, just by remove the NodeJS modules from the "package.json" file, because that's the cause of the problem in my PC: since I did not want to use NodeJS modules (for now), I just remove it from the "package.json" file, so this file become like below:

Doing that the app is perfectly compiled, even his installer, and, works as expected. I want to continue investigating, because, as I mention above, the Cordova Electron platform appear quite interesting. So try it, John, and, post here if you get stuck with any problem.



John Clarke
How can I create the batch file that will use Cordova to create the distributable version ?

Samuel Vanneste

Enable Electron's support in your app's configuration and compile (build) your app. You'll get the necessary batch files already available to ease your work.


John Clarke
I went to the App Options and in Batch and Shell ticked Electron, clicked compile but couldn't find the batch file for the Cordova build. Also, the App Options seems to lack a scroll bar on my screen.

Samuel Vanneste

John, you probably did no checked the box : "Create a Cordova config file" too.
I don't have a scrollbar too. Which is your AB version (this to inform David when he will read the thread) ? Thanks

Edit: did you thought to save the settings too ? (the floppy icon when you made the changes)


John Clarke
Release Version is 2020.29. When I clicked the save button it generated the batch files. I presume that if I want to create a release version (distributable) I run the cordova_electron_release.bat. However, when I do this I get a message saying "ENOENT: no such file or directory, open 'C:\Work\App Builder\Test Project\MyApp\compiled\package.json'"

DecSoft

Hello to all,

Yes; as Samuel, I also bet to assert that "Create Cordova config file" is checked, and, also, that the app / options are saved.

About the scrollbars... I am not sure... if there is a problem here? In principle, the scrollbars must appear in the options if required, that is, if the controls can't fit into the screen, then a scrollbar must appear, so we can reach all the options. This is not working for you?



Samuel Vanneste

That's the good way to do it. For the moment, you will have to manually create another file : package.json (using for example your NotePad). The content of that file should be

I think that David will automate the process. But for now, it can allow setting the resulting app (when we study how Electron works (the link I provided in a previous message).


John Clarke
Unfortunately I don't see a scrollbar.

DecSoft

Hello to all,

Release Version is 2020.29. When I clicked the save button it generated the batch files. I presume that if I want to create a release version (distributable) I run the cordova_electron_release.bat. However, when I do this I get a message saying "ENOENT: no such file or directory, open 'C:\Work\App Builder\Test Project\MyApp\compiled\package.json'"

The "ENOENT" problem is one of what I can see here in my PC too. Apparently it's related with NodeJS, but, I can't get something working after made some searchs. What I do is to rename the "package.lock" file to "package.json". Then try again.



Samuel Vanneste

Hello David
Sorry, we replied at the same time. I let you the hand. ;-)


DecSoft

Hello Samuel,

Yes; we are crossing messages here. :-) About the "package.json"... in principle we can create a file like that, but, I think the "ENOENT" error must be solved in another way... must work, and, inf act, it's working in previous versions of Electron. So there must be a reason for that error... and a way to solve it.



DecSoft

Hello John,

Unfortunately I don't see a scrollbar.

I want to see that with my eyes... because I can't reproduce the problem here. Can you please give me access to your computer, maybe using Team Viewer or Any Desk? Send me an E-Mail with the right data and I will try to take a look.



DecSoft

Hello John,

I already receive your E-Mail about the "scrollbar issue" and your captured screenshot. Certainly, you are right. I specifically refers to the scrollbar that you can see in the Cordova Electron options, for example. However, probably you can see that specific scrollbar. In other words, the capture that you sent to me refers to an app option tab that do not have any scrollbar... because I understand that is not required. I think I am wrong, so, I will take a look at this.



DecSoft

Hello to all,

I want to reopen this thread because, I am not sure what happen or what to do. First of all, I continue having the problem here with Cordova Electron, related with the "package.json" file. Firstly, I must to rename "package.json.lock" to "package.json", and then, remove the "dependencies" from that JSON file.

Doing that I can see the app compiled as an executable, and, working as expected, except that NodeJS modules are not availables (and maybe we want to use it). But I am not sure how to focus the referred problem, due to two reasons: 1º Maybe the problem don't occur in all Windows PCs. 2º Maybe the problem occur because Cordova Electron are just in his first versions. If we no need NodeJS modules... probably we can deal with the referred problem, until it's solved... maybe in the next version of Cordova Electron / or Electron itself.

And about the app options and the available scrolls... I am not sure if can be a good idea to place a scroll in every options tabs: apparently AB requires a more or less larger screen resolution in order to properly work: so maybe I can place the optional scrollbars in all the options tabs,... or maybe the controls inside the tabs can be made a bit more smaller: which is possible, because I made "larger"... asuming (maybe wrong) that we have a more or less larger screen resolution.

Anyone want to comment something about these questions? Please, don't hesitate to do it!



DecSoft

Hello to all,

Well. I am wrong all this time! Finally I know what happen with the above referred errors when build our apps using the Cordova Electron platform. Finally I can get some help and understand what is happen: there must be a "package.json" file available to be used, and, DecSoft App Builder never creates that file, because it's no needed for other platforms than Cordova Electron.

This new release of DecSoft App Builder prepares the right "package.json" file, and, also perform some enhancements over the created Batch and Shell files for Cordova Electron: basically we can use now the "run" batch file, for example, and get a preview of our app, before build it like we can do using the "debug" or the "release" batch files.

I hope this information can be of your interest!



DecSoft

Hello to all,

Certainly the Cordova Electron platform offer a lot of possibilities... take a look at how to open a file dialog to allow the user to select a file and then read that file and show the contents in an alert message:

See the above working like a charm in a Windows executable is very exciting, in my opinion. :-)



DecSoft

Hello to all,

This post is to inform about this new release, which try to solve the problem with the app options and program options dock forms, around the "scrollboxes" and the problem to reach some options in some specific "small" screen resolutions. I hope this new release can be useful to you!


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.