mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Can't run under Linux #353
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CrisVrinceanu on GitHub (Jul 3, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
I can't run my application under Linux anymore after the new release.
It's creating a .snap file which I can't use because of the environment we have (can't install snap in production OS). I have tried copying the linux-unpacked folder which seems to have the same hierarchy as the previous one, given execution permissions but no output is shown when executing.
I can still build with the previous CLI version (which wasn't using the build server I guess).
How can I avoid building a .snap?
@CrisVrinceanu commented on GitHub (Jul 3, 2019):
@GregorBiswanger
@GregorBiswanger commented on GitHub (Jul 3, 2019):
What was your previous CLI version?
@CrisVrinceanu commented on GitHub (Jul 3, 2019):
The previous version which is working:
ElectronNET.CLI Version: 0.0.11.0
Actual version I'm trying to use:
ElectronNET.CLI Version: 5.22.13.0
The command is the same:
electronize build /target linux
Electronize start works with both (on windows)
Build output:
You can see i've never set snap as target.
Electron manifest:
{ "executable": "Browser.Electron", "splashscreen": { "imageFile": "" }, "singleInstance": false, "build": { "target": "AppImage", "appId": "com.Browser.Electron.app", "productName": "Browser.Electron", "copyright": "Copyright © 2019", "buildVersion": "1.0.0", "compression": "maximum", "directories": { "output": "../../../bin/Desktop" }, "extraResources": [ { "from": "./bin", "to": "bin", "filter": [ "**/*" ] } ], "files": [ { "from": "./ElectronHostHook/node_modules", "to": "ElectronHostHook/node_modules", "filter": [ "**/*" ] }, "**/*" ] }@GregorBiswanger commented on GitHub (Jul 3, 2019):
In the new version (5.22.12), we moved from electron-packager to electron-builder.
Please, use the new "electron.manifest.json" file. Delete the old one, and execute the "electronize init" command inner your asp.net core project.
If you develop under Linux, please install electron-builder with:
sudo npm install electron-builder --global@CrisVrinceanu commented on GitHub (Jul 4, 2019):
I have followed the steps but the result is still the same.
I am trying to build from Windows for Linux.
It keeps doing that remote build and generating the .snap file. The files in linux-unpacked are still not working.
@CrisVrinceanu commented on GitHub (Jul 4, 2019):
Update
Now it works, I figured out that this behaviour occurs only if the electron.net.host is run as root (with sudo).
Executing it with a lower level user works fine.
Thank you for the help @GregorBiswanger
@CrisVrinceanu commented on GitHub (Jul 4, 2019):
Re-Opening
Seems like I need to find a way to run the application with elevated privileges (root). Is there any way to do it?
Also is there an electron log I can enable to see what's going wrong when launching as root?
Could be because of the chrome-sandbox? I can see similar behaviour on chromium-browser if trying to launch as root without the "--no-sandbox" flag, but even setting Sandbox to false in WebPreference nothing happens.
@GregorBiswanger commented on GitHub (Jul 26, 2019):
Hi @CrisVrinceanu,
unfortunately, I can not handle your problem right now. Under the hood, Electron.NET uses the electron-builder. You can configure it in the electron.manifest.json file under the build part. You can find the documentation here: https://www.electron.build/configuration/snap
Alternatively you have to google it and try it afterwards.