Creating an installer for my Electron app


#1

I have an Electron app which contains an Ionic 2 app. Electron is really a container for the Ionic 2 app, nothing more. Now I want to create an installer, that is, a .EXE file for the app so that I can just hand over the EXE to anybody and all they have to do is run it to get the app installed on their PC/Mac/Linux machine.

These other people will not have Electron or Ionic installed on their machines.

I am guessing this EXE will install the app on a user’s machine and can create kind of a desktop shortcut. The user can use this shortcut to open/launch my app.

My questions are:

  1. How do I create this installer?
  2. Do I have to include Electron and Ionic 2 while creating the installer so that those get installed as well?
    2a. If the answer for above question #2 is yes the how do I do that?
  3. Or, there is no need of #2 and #2a above because my package.json has dependency/dev-dependency for Electron and Ionic 2 so those two will be automatically installed?

Any help will be greatly appreciated.

Thank you.


#2

No can do. Only Windows uses exe installers. There are three tools for that, which you can find linked here.

OS X uses executable folders, so you just need to copy this structure. Then make a dmg or tar from that.

Building packages for Linux varies based on the distribution, but .deb and .rpm are most common and most Linux users can install either. Instructions are floating around the Internet. The most common deviant is Arch, which has its own system. You legitimately don’t have to care about anybody beyond that, because anybody who uses a system that can’t install from .deb, .rpm, or AUR is going to be used to building things from source.

Do I have to include Electron and Ionic 2 while creating the installer so that those get installed as well?
2a. If the answer for above question #2 is yes the how do I do that?

Just include the Electron binary in the package you build. For dependencies that are Node packages, like ionic, you just have to make sure that they’re in the node_modules/ directory when you make your asar file.

Or, there is no need of #2 and #2a above because my package.json has dependency/dev-dependency for Electron and Ionic 2 so those two will be automatically installed?

Not if you just have your data packed up into an installer. The user won’t know to run npm install unless you tell them.


#3

There are docs covering application packaging and distribution.


#4

Hi DamnedScholar, thank you for taking the time to reply in such detail manner. Very much appreciated!

I wasn’t sure what those installers are called in Mac and Linux platforms so just mentioned EXE. :slight_smile:

I had gone through those pages but couldn’t follow it properly or didn’t pay proper attention. :grin:

I guess I also wanted to check if people are following any different approach than what’s on those links.

Thanks again, I highly appreciate your help here!


#5

Hi enlight, thanks for replying to my post. Appreciated!


#6

I also found the following tutorial links in one of the discussions for creating an installer. I haven’t gone through them yet, will do it now. Thought it will be useful if anybody else is looking for this information.

And following one is to create an icon for your Electron app: