2

I'm trying to make an installation setup for my electron app. I've tried electron builder and electron packager, it worked but not what I hoped for. I wanted to have a installation set up similar to vscode (which I've heard was made using electronjs), which is a standalone installer with all the user agreement, the path and etc. How can this be done? Is it different depending on which OS the user is installing it to? I'm only focusing right now on windows since the app I'm creating is only for windows.

1 Answers1

1

With electron-builder did you set "oneClick": false? That will give you the "install wizard" style installer on the PC. The default for oneClick is true so you have to set it explicitly.


From the docs:

  • oneClick = true Boolean - Whether to create one-click installer or assisted.

  • perMachine = false Boolean - Whether to show install mode installer page (choice per-machine or per-user) for assisted installer. Or whether installation always per all users (per-machine).

  • If oneClick is true (default): Whether to install per all users (per-machine).

  • If oneClick is false and perMachine is true: no install mode installer page, always install per-machine.

  • If oneClick is false and perMachine is false (default): install mode installer page.

  • allowElevation = true Boolean - assisted installer only. Allow requesting for elevation. If false, user will have to restart
    installer with elevated permissions.

  • allowToChangeInstallationDirectory = false Boolean - assisted installer only. Whether to allow user to change installation
    directory.

On OSX, using DMG format, if you specify a license (and maybe the "licenseButtons" JSON file as well – that is what works for me) you will get an agreement dialog before the DMG mounts.

From the docs:

To add license to DMG, create file license_LANG_CODE.txt in the build resources. Multiple license files in different languages are supported — use lang postfix (e.g. _de, _ru)). For example, create files license_de.txt and license_en.txt in the build resources. If OS language is german, license_de.txt will be displayed. See map of language code to name.

You can also change the default button labels of the DMG by passing a json file named licenseButtons_LANG_CODE.json. The german file would be named: licenseButtons_de.json. The contain file should have the following format:

{
  "lang": "English",
  "agree": "Agree",
  "disagree": "Disagree",
  "print": "Print",
  "save": "Save",
  "description": "Here is my own description"
}
spring
  • 18,009
  • 15
  • 80
  • 160