12

Is there a program that can convert HTML, CSS and JavaScript into an exe?

A similar question was asked on StackOverflow: How can you convert html css and javascript into a exe?

  • Do you want something that translates Javascript to native x86 code? That seems like a pretty tall order. – Ira Baxter May 19 '15 at 9:41
6

While the (previously) accepted answer was correct, in the intervening years the industry has gone ahead by leaps and bounds... Two very good open-source and extremely actively developed options are

  • Electron, by GitHub. Lets you build cross-platform Windows, MacOS, and Ubuntu applications from HTML/JavaScript/CSS. It works by embedding them into a Chromium build alongside with Node.js. Many applications such as Slack and Visual Studio code are built with Electron.
  • Cordova, by the Apache Foundation. Targets Android, iOS, and Windows from HTML/JavaScript/CSS. It works by embedding them into a WebView (or whatever is the equivalent on the target platform).
  • Proton Native. Works with React Native components and does not use Electron (see above), which makes generated apps therefore more "lightweight" than the ones generated by Electron. Uses libui under the hood.
| improve this answer | |
  • I'm assuming you mean "such" and not "suck". Tried to add an edit but the edit requires at least 6 characters changed. – StarGeek Dec 2 '19 at 17:01
  • Haha good catch! fixed. – Guido Domenici Dec 3 '19 at 12:42
5

Yes there is a program HTML Compiler that allows you to convert an entire HTML application (using CSS, JavaScript, Images and more) into an standalone Windows application.

There is also ExeOutput for PHP that lets you create applications in native format for Windows with PHP, JavaScript and HTML. Convert PHP scripts, websites, JavaScript, HTML, databases into stand-alone apps for Windows (single EXE files) that do not require a Web server nor PHP distribution.

| improve this answer | |
  • 4
    There is nothing wrong with self-answered questions, however, one should disclose one's affiliation - especially with commercial products. Are you in any way affiliated with HTML Compiler? – ComFreek Dec 22 '14 at 15:11
  • 3
    No, I am not affiliated. @ComFreek – Davidenko Dec 22 '14 at 15:13
3

I am not taking exe literaly, but you can setup a desktop application with node-webkit which will basicaly run your webapp localy in a webkit browser. see http://strongloop.com/strongblog/creating-desktop-applications-with-node-webkit/

| improve this answer | |
1

For window apps

If you need something to present you a window environment and a webserver emulation, choose ZZEE or ExeOutput, these are decent tools, maybe ZZEE is a bit outdated regarding the PHP version. So for "HTML, CSS and Javascript", the answer is clearly something like this.

For console apps

If you only need a tool to run in the background or from command line, here's my pet project called RapidEXE - it's quite simple to use, somewhat extendable and features PHP 7 out of the box. Also, it's free and always will be. But since there's no browser involved, technically this is not solution for HTML/CSS/JS; just something very similar, like using web-related languages to create EXE files.

A real compiler: JSC

If you want (something-like-)javascript to be compiled to a standalone EXE, give a chance to JSC, it's there in your Windows, you just probably never met before. JSC gives you extremely small executables (because of the .NET already built into Windows itself) and they have full power of .NET so you can do pretty much anything you want. Flipside: apart from the syntax being familiar, not a lot will remind you of Javascript, you have to learn a lot of new practices to get along.

A bonus track: "chrome --app" and RAR

If you can live with a dependency such as Chrome, you can do a nasty but working solution: RAR can create a self-extracting EXE for you and run a command after extraction (!!), so you can pack up a little micro-universe of HTML/CSS/JS files; then you can call Chrome with "--app=something.html" that will give you a plain window with a browser environment and your HTML file in it. I know this is not a compiler; however, it's a way to create an EXE that is self-contained and gives the user a web-liek experience in an application-like window. Sure, Javascript will be a bit limited because you're running in a local file, not a proper website, but it's not that painful. One lovely thing about this technique is that Chrome will remember the position and size of your window so it will pretty much feel like an application.

| improve this answer | |
  • Welcome aboard. The OP accepted his own answer of ExeOutput almost 3 years ago. You don't give a link to ZZEE and you don't explain how these recommendations answer the OP's question. – Mawg says reinstate Monica Oct 29 '17 at 11:17
  • These statements are all true. – dkellner Oct 30 '17 at 9:49
  • but you won't address them? ;-) – Mawg says reinstate Monica Dec 2 '19 at 11:32
  • 1
    Crystal clear. Edited my post. Does it look better? – dkellner Dec 2 '19 at 15:44
  • 1
    Yes, it does. Thanks and upvote. Welcome aboard – Mawg says reinstate Monica Dec 3 '19 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.