39

I've HTML application build with AngularJS/jQuery/Bootstrap with AJAX REST API.
Is it possible to create executable/installer for Windows operating system?

Without any 3rd-party software, it should look like native application, but HTML.
For example, Slack messenger has web/mac/windows versions and they look same.

Any ideas?

// UPD

I probably need a wrapper (webview), but I need all features for EcmaScript5/CSS3.

Miraage
  • 3,334
  • 3
  • 26
  • 43

9 Answers9

31

Electron is the easiest way:

1. Install

2. Create and edit main.js:

const electron = require('electron');
const { app, BrowserWindow } = electron;

let mainWindow;

app.on('ready', () => {
    mainWindow = new BrowserWindow({
        width: 1000,
        height: 700
    });

    mainWindow.setTitle('title of the desktop app');
    mainWindow.loadURL('http://www.yourwebpage.com');

    mainWindow.on('closed', () => {
        mainWindow = null;
    });
});

3. Execute desktop app:

electron main.js

And to build the app, use a builder such as electron-builder.

Hope that helps you!

SaidbakR
  • 13,303
  • 20
  • 101
  • 195
Aral Roca
  • 5,442
  • 8
  • 47
  • 78
  • 3
    Does it become a true desktop application or just a site-specific browser? – Mojimi Dec 08 '17 at 17:29
  • 1
    @Mojimi What he made was a site specific browser, which needs internet connection to display the site. – Mrigank Pawagi Mar 19 '18 at 04:14
  • @MrigankPawagi I assume electron also has the capabilities to create a fully self-contained html based application? – Mojimi Mar 19 '18 at 20:13
  • @Mojimi Yes of course, that is what electron is for - cross platform applications with web technologies! – Mrigank Pawagi Mar 20 '18 at 05:48
  • 1
    Does Electron app will work "without any browser" installed on Client machine? – Yogen Darji Nov 22 '18 at 11:04
  • @yogendarji - yes, electron comes with its own version of chromium included (the engine underneath the hood of Chrome), so you don't have separately to install a web browser on the client machine. – RocketMan Apr 23 '20 at 18:26
  • Hi, i'm struggling to make this url dinamic. Any help would be apreciated – Leonardo Rick Mar 11 '21 at 15:48
  • To have desktop app just start your web app server and change url to localhost. You can start the server and electron from a bash script or start the server from the electron script through system call. Then you have a launcher /command to run the app and no need for internet. – nadapez Jan 26 '23 at 17:22
10

(Full disclosure, I'm the founder of ToDesktop, I'll try to be objective and unbiased here.)

As usual in Computer Science, the answer is "it depends"!

The first question that you should ask yourself is: Who is the desktop app being used by? Just you? Or, are you distributing the app to customers? Because these two segments have very different needs.

Just you

There are a lot of options here (in no particular order):

  1. Nativefier — The obvious option. Lots of configuration options, lots of contributors, open source and regularly updated. This should probably be the default option if you want to whip up an app just for yourself.
  2. WebDGap — This is a lovely project but it is a little old and "as of April 13th, 2018 WebDGap is no longer an active project.". It should also be noted that this is built on an old version of node-webkit and not Electron.
  3. Web2Desk — Great option if you don't want to mess around with the command-line. It uses Nativefier under-the-hood. It is free with a splash screen or $19 with the splash screen removed.
  4. Do-it-yourself with Electron — The basics were covered quite well in this earlier answer. I like this option because it gives you complete flexibility to take the project wherever you like and you'll learn a bit of Electron too.
  5. Fluid App — This is Mac only but otherwise it's a lovely solution and super easy. It's free for the standard version, there is also a $5 version which includes features like fullscreen.
  6. FlotatoMac only again but this is a really interesting approach. Simply clone the app and give it a name like docs.google.com, it will then turn into Google Docs. At the time of writing this, it's in pre-release (not released yet) but I'll be watching this closely, it's very cool.
  7. ToDesktop — ToDesktop will work but it's probably a bit overkill if you're creating a personal app. Also, it's probably a bit too expensive for this use-case. ToDesktop is targeted at creating a desktop app for distribution to customers (more about that below).

Distributing to customers

There are a few extra considerations which become more important when creating a desktop app for distribution to your customers:

  • Installer — Mac users expect a "drag to applications" DMG file. Windows users expect an installer and they also expect to be able to uninstall it from the control panel.
  • Code Signing — If your app isn't code signed then by default Windows Authenticode and Apple Gatekeeper will prevent your desktop app from being opened.
  • Auto-update — There is still a web browser running "underneath" your desktop app, it's important to keep this updated for two reasons. 1. Security issues + vulnerabilities should be patched over time. 2. You don't want to be stuck supporting an old web browser in 5 years time because your desktop app's browser hasn't been updated

The tools mentioned above don't offer these features, so they're not really suitable for the use-case of distributing your app to customers. These are the features that we wanted to add when building ToDesktop, so I think it fits this use-case quite nicely. We're adding features all the time, last week we added support for App Protocols and Deeplinks.

DaveJ
  • 2,357
  • 6
  • 28
  • 35
  • I haven't tried it, but the page looks amazing, congrats, keep up the good work :) – Bersan Apr 20 '21 at 22:21
  • 2
    Another disclosure, It's a paid service so don't set up all the things before knowing that, and then realize you wasted all that time for nothing. – Shubham Kushwah Nov 30 '21 at 11:44
6

I myself was looking for an all around solution for awhile. I tried everything from TideSDK, AppJS, Appcelerator Titanium, native code in VB.NET, XCode, Python, C++, Electron, node-webkit, etc: Basically you name it I've tried it.

Note Electron is nice, but it only runs on 64bit processors. So node-webkit is good if you want to run your app on 32bit processors.

So I decided to build my own open source solution called WebDGap.

Currently WebDGap runs on Windows, Linux, Mac OS X, Google Chrome and as a web application!

Watch the How To Video to learn, well how to use the app obviously.

Here's a screenshot. The WebDGap Application

Being that you're a Mac user already you can merge your exported app into 1 .app mac file. This can be done with Automator (and a little shell scripting).

There's also a coding playground I made for mobile users that has this feature built in called kodeWeave.

Here's a Tic-Tac-Toe game I'm going to export as a Mac App: kodeWeave App

Now the web app is running as a native Mac application! Tic-Tac-Toe is now running as a Mac App

Michael Schwartz
  • 8,153
  • 14
  • 81
  • 144
  • I downloaded this, and when I ran it it seemed spammy - ads on the top and something about needing to change my DNS. I immediately closed it and deleted. – Peter Tirrell Jun 11 '19 at 20:56
  • Getting This browser or app may not be secure while signin in with google. Can anyone update it with latest google chrome engine on github/sourceforge? – Maths89 Jun 01 '20 at 04:09
3

The most easiest and quickest way i know is to use nodejs/npm’s nativefier library which underlying electronjs . It will just take 5 min to create executable for windows. Even a person who do not have programming experience can create desktop application from web application. Below mentioned post has described the steps to convert web application to desktop application. Must read !

Convert any web application to desktop application in 2 min using npm’s nativefier

Vishwas
  • 43
  • 5
0

There are a ton of frameworks out there that can wrap your web app into a native application that can access things like the file storage API for an operating system. This is the specific guide for Windows.

BEWARE THOUGH - you will need to spend time doing solid testing and QA work for your native app so it doesn't feel like a website inside a native wrapper, as well as integrates well with all versions of the OS you want to be compatible with. Tweetdeck for Mac is an example of what not to do - basically a web browser in a native wrapper).

Ben Rondeau
  • 2,983
  • 1
  • 15
  • 21
  • Yes, I need a wrapper which will remove all browser controls and just start webview. But I need support almost features of EcmaScript5/CSS3. – Miraage Apr 16 '15 at 21:28
  • 1
    Can you elaborate on why you need this? Slack's application is the result of native code that have 1000+ hours of high quality dev work that is constantly updated. Although it visually and functionally appears the same, the integration with the OS (such as growl notifications) uses native OS code. – Ben Rondeau Apr 16 '15 at 21:34
0

Use Web2Desk: If you are looking for Free and Simple solution.

Convert webapp to desktop app using web2desk

wherein all you need to do is enter the URL of the web app (or website) and Desktop app for Mac, Windows, and Linux is generated in no time.

Desktop App for Mac, Linux and Windows platforms

Felix josemon
  • 932
  • 1
  • 7
  • 14
0

If you want to convert your website into .EXE. This application is best for create windows , linux or Mac system. Must Check WEBEXE

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 25 '23 at 13:58
-1

With a bit of wrapper code you could package it as a Chrome App. They do not need to run in a browser window but have all the capabilities of a web app, standalone.

https://developer.chrome.com/apps/about_apps

  • Thanks you, but application should not rely on 3rd-party software. – Miraage Apr 16 '15 at 21:27
  • Google has just announced plans to gradually phase out support for Chrome apps on every platform except for Chrome OS. http://www.theverge.com/2016/8/19/12555052/google-shutting-down-chrome-apps – abe312 Jan 06 '17 at 19:22
-1

Best Way to Convert Web to Exe is using nativefier:

nativefier --name "Inventory Management System" "http://localhost/php_stock_zip/php_stock_zip/php_stock/" -i ./icon.png -p windows

Steps:

  1. Press Win+x
  2. Press C
  3. Type
  4. nativefier

Installation Requirements * macOS 10.9+ / Windows / Linux * Node.js >=6 (4.x may work but is no longer tested, please upgrade) See optional dependencies for more

Step 5: npm install nativefier -g

Finally type nativefier "Web Link"

tripleee
  • 175,061
  • 34
  • 275
  • 318