Describe the bug
On Linux, when "Launch Ferdi on start" is enabled in the General settings, an autostart entry is added pointing to electron4, not Ferdi. Disabling the setting removes the electron4 autostart entry.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
An entry for Ferdi should be present, not electron4
Screenshots
Here is the autostart entry added, pointing to electron4:

Desktop (please complete the following information):
Additional context
Running KDE on Manjaro Linux.
We could see if switching from Franz's custom package to the official node-auto-launch fixes this bug.
May be related, but when hovering over the Ferdi icon in my taskbar, the dialog box lists Ferdi as being named "electron4", instead of "Ferdi". Should I raise this as a separate issue?

No I think this is related. Did you installed Ferdi through the official release packages or through something like the AUR package?
No I think this is related. Did you installed Ferdi through the official release packages or through something like the AUR package?
AUR package, do you think it might be the packaging? Maybe @AGCaesar can help?
Maybe. The AUR packages gets build separately from how we package Ferdi.
@AGCaesar I don't quite know what it does, but this line in your PKGBUILD looks like it may be causing this issue?
sed -i "s|\(\s\+\"electron4\":\).*,|\1 \"$electron_version\",|" package.json
@deadmeu @vantezzen I created the AUR package mainly for myself to update ferdi easily... I have basically no Idea what I am doing, I copied the franz build and changed a few things... (Just to dampen expectations)
But maybe we can work out something together....
The sed command just changes the "electron" occurrences to "electron4" bevause the native electron package in arch is electron 6...
Ferdi is started using the ferdi.sh file shipped with the package and the command
"electron4 /usr/lib/ferdi/resources/app.asar "$@"" seen here:https://aur.archlinux.org/cgit/aur.git/tree/ferdi.sh?h=ferdi
maybe the autostart function fails on this? But I am not sure how to improve this....
Oh that could be the problem:
In your package, Ferdi is not really build to an application, it is only started using Electron - this is the same I do during development. When doing this, Ferdi can't properly add its branding to the application:

It makes sense that usr/lib/electron4 gets added as a startup item, as Ferdi is currently running over that application and simply add its current path to the startup list.
As far as I can tell, the only way to fix this is to actually build Ferdi inside the AUR package as suggested in https://wiki.archlinux.org/index.php/Electron_package_guidelines#Using_electron-builder_with_system_electron. @AGCaesar could you try to implement this that way? Maybe using https://aur.archlinux.org/packages/rocketchat-desktop/ as a template?
I will give it a try, give me some time :) Thanks for the hints!
I tried a lot (and actually this way I found the bug in #77 but I did not manage to create a working auto start shortcut... All examples I looked at start it similar to this: https://aur.archlinux.org/cgit/aur.git/tree/rocketchat-desktop?h=rocketchat-desktop
@AGCaesar can you try converting one of the DEB package into an Arch Linux package with debtap and see if that fixes the issue? (see https://github.com/helixarch/debtap)
Actually, I've just added pacman to the list of targets for Linux builds, that might build the deliverable you need for the AUR package? Giving it a try now.
I will wait what happens :) But I think using a deb file is possible too.
Not sure why the build is failing; please try with the deb file, for now, it should be better. Would having a .pacman in the releases assets help you to build the AUR package?
From what I understand, the AUR package is built from the Linux unpacked version of the app and ran using the system electron; which is nice if you want to optimize things and use one electron to run all your electron apps, but then it shows the system's Electron details where you mentioned it. Need to use a packaged version of Ferdi (so it comes with its own electron) for it to be standalone and properly show Ferdi info where it should. Some of the things I just said might be inaccurate but that's my understanding of it as of now. I also just noticed we use a hack for isDevMode in the build() of the PKGBUILD, which should not be needed and should hint us that we're doing something wrong. I have to sign off for now, but I'm happy to help at a later stage. I would be happy to pair with you on this @AGCaesar if you're keen — please reach out to [email protected] for us to arrange the details of the pairing session.
The dev mode hack is copied from the Franz version and is definitely still needed with ferdi. Just build it without it and it started in dev mode... I will try building a package from the deb file and report back :)
@deadmeu I Created https://aur.archlinux.org/packages/ferdi-bin/
Now with working autostart! Please try it out and see if it works :)
@AGCaesar Well done! 👍
Regarding the previous way, I'm still confused as I see the hack as not being needed: isDevMode should be true in development mode, but false when we are packaging and delivering the app for production use by users. I am not sure what are all the differences between dev/prod mode in Electron internals, but building an app in dev mode then overwriting the isDevMode in our codebase should not be enough to get a production-ready app. If isDevMode is true, we should figure why and make so the build we ship to non-developers/users has isDevMode set to false (without us overwriting it).
@AGCaesar I think ferdi-bin should be working properly now that it's based on the debian. Do you think we should deprecated ferdi-git/ferdi and redirect them to ferdi-bin? Or remove them and rename ferdi-bin to just ferdi?
@deadmeu Can we also close that issue now?
I will investigate further on the differences in build mechanism after the weekend. I think we should leave the arch packages the way they are as they follow the AUR standards. It is quite common to have different versions of a program. Maany arch users like to use the system electron package because it is more lightweigt. Also, franz packages are the same:
https://aur.archlinux.org/packages/?O=0&SeB=nd&K=franz&outdated=&SB=n&SO=a&PP=50&do_Search=Los
@AGCaesar LGTM, did not know that was AUR standards, but now I know 😃 Thank you again for the work you're doing on maintaining the AUR packages! 🙏