Electron-builder: Linux: Be more restrictive with executable name

Created on 7 Oct 2016  Â·  8Comments  Â·  Source: electron-userland/electron-builder

  • Version: 7.11.3

  • Target: Linux (any)

Currently electron-builder uses productName info for naming app's main executable, which may be painful for Linux binaries being run from command terminal, if that info contains uppercase letters, spaces, etc.

I would like to suggest a new option executableName for Linux binaries, with the following restrictions:

  • should not contain spaces
  • should not contain uppercase letters
  • should not contain any special characters which have some meaning for the shell (e.g.: &).

If no executableName is provided in package.json, electron-builder could calculate it from name or productName options (convert to lowercase, strip spaces, replace special characters with - or _, etc.).

feature linux

Most helpful comment

Yes. Also, in any case, all file names are sanitised using https://www.npmjs.com/package/sanitize-filename

All 8 comments

executable name will be not changed and productName will be still used — please see https://github.com/electron-userland/electron-packager/issues/297#issuecomment-207749334

executableName will be added.
https://github.com/wireapp/wire-desktop/issues/125

We already use name for AppImage. To simplify.... ok, name will be used by default on Linux instead of productName.

if it is not important for you — name or productName doesn't matter for you.

If it is important for you — you want name.

Should electron-builder force you to explicitly set executableName? Should electron-builder bother you about it? No. No.

So, name will be used not only for AppImage, but for all linux targets.

Using name by default for Linux executable name is reasonable, but it's not clear to me in your documentation which character set is allowed for name.

I would still suggest you to e.g. convert name to lowercase for naming Linux executable, if no explicit executableName option is given.

but it's not clear to me in your documentation which character set is allowed for name.

name according to npm rules — https://docs.npmjs.com/files/package.json#name "must not have uppercase letters in the name", "name can't contain any non-URL-safe characters."

Very good. So name is in fact a good choice here.

To summarize:

  • name would be used for main Linux executable name, AppImage name, etc.
  • productName would be used for desktop entry Name property.

Right?

Yes. Also, in any case, all file names are sanitised using https://www.npmjs.com/package/sanitize-filename

@lbssousa Your are right. npm doesn't restrict name to be lowercased. But snaps does. So, electron-builder will lowercase your name in any case for all Linux targets.

Please use the proper unchanged application names (including capitalization, if any) for AppImages like you do for macOS. Every time I see an application like e.g., RcloneTray spelled correctly (RcloneTray.dmg) for macOS but wrongly (rclonetray.AppImage) for Linux it reminds me that macOS still feels more polished to me.

Point in case:
https://github.com/dimitrov-adrian/RcloneTray/releases

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iklemm picture iklemm  Â·  3Comments

AidanNichol picture AidanNichol  Â·  3Comments

lbssousa picture lbssousa  Â·  3Comments

leo picture leo  Â·  3Comments

noahprince22 picture noahprince22  Â·  3Comments