Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options.bin should default to package.productName #118

Closed
DuBistKomisch opened this issue Nov 19, 2017 · 8 comments
Closed

options.bin should default to package.productName #118

DuBistKomisch opened this issue Nov 19, 2017 · 8 comments

Comments

@DuBistKomisch
Copy link

DuBistKomisch commented Nov 19, 2017

What version of electron-installer-debian are you using?
0.7.1

What version of node and npm are you using?
6.12.0
5.5.1

What operating system are you using?
Arch Linux (surprisingly works)

Can you compile the example app successfully?
I can compile my own app.

What did you do? Please include the configuration you are using for electron-installer-debian.
I didn't use any special config besides src/dest/arch. I configured my app for electron-packager by having an npm-style package name in the name field (vivi) of my package.json, and a human-friendly name in productName (Vivi). This makes electron-packager rename the electron binary to the productName, not the name, i.e. Vivi-linux-x64/Vivi.

What did you expect to happen?
The generated /usr/bin symlink to point to the renamed executable.

What actually happened?
It points to vivi instead of Vivi, which is of course broken:

-rwxr-xr-x root/root  80394960 2017-11-20 00:42 ./usr/lib/vivi/Vivi
lrwxrwxrwx root/root         0 2017-11-20 00:42 ./usr/bin/vivi -> ../lib/vivi/vivi

I can set options.bin to Vivi, but it seems like it should default for me.

@DuBistKomisch DuBistKomisch changed the title should differentiate between package.name and package.productName options.bin should default to package.productName Nov 19, 2017
@fcastilloec
Copy link
Collaborator

fcastilloec commented Nov 19, 2017

Can you please include the configuration you are using for electron-installer-debian? Be specific, what command did you use to run it? or if you use it programmatically, show us the code.

Nonetheless, I'm pretty sure that your problem is related to this #107 (comment)

The proper way to fix this is passing appname to electron-packager and making appname be exactly what the name field in your package.json is.

@DuBistKomisch
Copy link
Author

DuBistKomisch commented Nov 19, 2017

In my Makefile:

@npx electron-packager $(APP_DIR) --platform linux --arch x64 --electron-version $(ELECTRON_VERSION) --out $(DIST_DIR) --overwrite true --prune false --asar --app-copyright "Vivi International Pty Ltd"`
@npx electron-installer-debian --src $(DIST_DIR)/Vivi-linux-x64/ --dest $(DIST_DIR)/ --arch amd64 --config $(RES_DIR)/debian.json

$(RES_DIR)/debian.json:

{
  "bin": "Vivi",
  "icon": {
    "128x128": "res/icon_128.png",
    "scalable": "res/icon-v.svg"
  },
  "section": "education",
  "categories": ["Education", "Utility"],
  "depends": ["gstreamer1.0-libav", "gstreamer1.0-plugins-bad", "gstreamer1.0-plugins-good", "gstreamer1.0-plugins-ugly", "gstreamer1.0-pulseaudio", "gstreamer1.0-tools"]
}

$(APP_DIR)/package.json

{
  "name": "vivi",
  "productName": "Vivi",
  "version": "2.10.1",
  "description": "Client for Vivi, a wireless screen sharing solution",
  "productDescription": "Vivi is a wireless presentation tool that enables users to share, display, annotate, capture and save information in real time, from anywhere in the room.",
  "author": {
    "name": "Vivi International Pty Ltd",
    "email": "info@vivi.io",
    "url": "http://vivi.io"
  },
  "license": "UNLICENSED",
  "main": "main.js"
}

That linked comment is extremely relevant, but I'm not sure it's right. We specifically want the executable to be Vivi, as it's already that on Windows/Mac. electron-installer-debian already uses the productName for some things, and name for others, so shouldn't it use productName for bin since that's what electron-packager does by default?

@fcastilloec
Copy link
Collaborator

fcastilloec commented Nov 19, 2017

No, the one to blame is electron-packager in this case. In Linux, the executables have to follow the same convention that the name field in npm, and that's why electron-installer-debian uses name instead of productName. Our README clearly states it. You should definitely follow the convention and change the name of the executable in electron-packager by specifying appname; but if you really want to disregard the convention, use the bin option.

EDIT: As other apps that work across all OSs. They still follow the convention. For example Headset has it's windows and mac installers named Headset and the linux one is named headset.

@DuBistKomisch
Copy link
Author

DuBistKomisch commented Nov 19, 2017

You're right, it's weird behaviour from electron-packager, and it seems like they don't want to change it either..

In hindsight I should have used vivi for appname on Windows/Mac but too late to change now (firewall exceptions based on filename ugh) so it's inconsistent, but I'll set appname to vivi on Linux as the lesser evil here. Thanks for the help.

For the record, the README only talks about the package name there, not the executable name, so I wouldn't say it's clear.

@fcastilloec
Copy link
Collaborator

I guess we can make it clearer, I'll just add the same message to the bin option

@malept
Copy link
Member

malept commented Nov 20, 2017

FWIW I've been working on a change to Electron Packager to have a way to change the executable name separately. It's been a difficult change to do historically because of the way that Packager's code base has grown over time, but I think I can do it now without a breaking change.

@malept
Copy link
Member

malept commented Nov 20, 2017

Not sure if this helps your use case, but see: electron/packager#758

@DuBistKomisch
Copy link
Author

@malept It won't help me now since I still want to keep it as Vivi on Windows/Mac, but this would have helped prevent the problem in the first place yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants