Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

How to build a Desktop app for a linux?

Open ZedZipDev opened this issue 3 years ago • 8 comments
trafficstars

I build my app for win

electronize build /target win

and find 2 folders: bin\Release\net5.0\win-x64 and \bin\Desktop\win-unpacked.

When I run exe from the 1st folder I see the server console only. and if I use query in a browser http://localhost:5000 I see the page but abs not formatted. Ok.

But when run exe form the 2nd folder - I have what I need: desktop app.

When I build

electronize build /target linux I receive only bin\Release\net5.0\linux-x64 and no any desktop . How can I build a Desktop app for linux?

ZedZipDev avatar Jul 18 '22 14:07 ZedZipDev

This is my log. FInally I have a folder: bin\Desktop\linux-unpacked but it contains subfolder \resources only

What I do wrong?

PS D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest> electronize build /target linux Build Electron Application... Arguments: target = linux Build ASP.NET Core App for linux-x64... Executing dotnet publish in this directory: D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux Build ASP.NET Core App for linux-x64 under Release-Configuration... dotnet publish -r linux-x64 -c "Release" --output "D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained dotnet publish -r linux-x64 -c "Release" --output "D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore... Restored D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\WebviewAppShared\WebviewAppShared.csproj (in 280 ms). Restored D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\BlazorDesktopTest.csproj (in 358 ms). WebviewAppShared -> D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\WebviewAppShared\bin\Release\net6.0\WebviewAppShared.dll BlazorDesktopTest -> D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\bin\Release\net6.0\linux-x64\BlazorDesktopTest.dll BlazorDesktopTest -> D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux\bin\

Start npm install... npm install --production npm WARN config global --global, --local are deprecated. Use --location=global instead. npm WARN config production Use --omit=dev instead. npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)

added 69 packages, and audited 70 packages in 2s

found 0 vulnerabilities

ElectronHostHook handling started... Build Electron Desktop Application... Executing electron magic in this directory: D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\bin\desktop Create electron-builder configuration file... node build-helper.js electron.manifest.json

Package Electron App for Platform linux... npx electron-builder --config=./bin/electron-builder.json --linux --x64 -c.electronVersion=13.1.5 npm WARN config global --global, --local are deprecated. Use --location=global instead. ΓÇó electron-builder version=23.1.0 os=10.0.19044 ΓÇó loaded configuration file=D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux\bin\electron-builder.json ΓÇó description is missed in the package.json appPackageFile=D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\obj\desktop\linux\package.json ΓÇó packaging platform=linux arch=x64 electron=13.1.5 appOutDir=D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest\bin\Desktop\linux-unpacked ΓÇó scheduling remote build target=snap arch=x64 ΓÇó scheduling remote build target=appImage arch=x64 ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1hdasls": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. attempt=0 waitTime=2 ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1hdasls": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. attempt=1 waitTime=4 ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1hdasls": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. attempt=2 waitTime=6 Γ¿» Get "https://service.electron.build/find-build-agent?no-cache=1hdasls": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. Γ¿» C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 failedTask=build stackTrace=Error: C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-bin\win\x64\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 at ChildProcess. (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\util.ts:250:14) at Object.onceWrapper (node:events:642:26) at ChildProcess.emit (node:events:527:28) at ChildProcess.cp.emit (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1092:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) From previous event: at processImmediate (node:internal/timers:466:21) From previous event: at RemoteBuilder.build (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\remoteBuilder\RemoteBuilder.ts:51:28) at RemoteTarget.finishBuild (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\linuxPackager.ts:105:30) at async Promise.all (index 2) at AsyncTaskManager.awaitTasks (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\asyncTaskManager.ts:65:25) at Packager.doBuild (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:453:5) at Object.executeFinally (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14) at Packager._build (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:376:31) at Packager.build (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\app-builder-lib\src\packager.ts:337:12) at Object.executeFinally (C:\Users\John\AppData\Local\npm-cache_npx\009083ec26dc578f\node_modules\builder-util\src\promise.ts:12:14)

... done PS D:\MyProjects4\Blazor\NET501_Blazor_ElectronNET\blazor-desktop-crossplatform-sample-master\src\BlazorDesktopTest>

ZedZipDev avatar Jul 18 '22 14:07 ZedZipDev

Anybody from Electron.Net team can help?

ZedZipDev avatar Jul 22 '22 06:07 ZedZipDev

Yes, but what is the 51.15.76.176 ? why it is trying to connect? The link https://service.electron.build/ does not exist too. Btw, no these errors when

electronize build /target win

ZedZipDev avatar Jul 22 '22 13:07 ZedZipDev

How to fix it? Anybody can help? Or my be it is impossible to build Linux app in WIndows?

win32nipuh avatar Jul 26 '22 06:07 win32nipuh

@win32nipuh I am not an expert on Electron though, trying to build a Linux app in Windows could be a good idea, try with the Linux subsystem on Windows

@Oleg26Dev If you could mention details about which Linux distribution you are working on would be a more input for the community members to help you, as per my experience the builds do have some variations with different distributions. Also, check if your app is getting built properly without Electron or maybe at baseline, it has some issues.

vinnaykulkarni avatar Aug 01 '22 07:08 vinnaykulkarni

@vinaykulkarni89 Yes, but I use Windows+VS2022 and would like to build electronize build /target win electronize build /target osx electronize build /target linux in my OS, also it is declared possibility of the Electron.

ZedZipDev avatar Aug 01 '22 09:08 ZedZipDev

Hello everybody, what about this issue?

ZedZipDev avatar Aug 16 '22 16:08 ZedZipDev

I compiled a version on linux using vs Code with the latest Nodejs 18.9.x

can't compile it on windows have to be a linux mashine for it to work on linux

don't know if wsl works

Cav-jj avatar Sep 20 '22 12:09 Cav-jj

I have tried again. it repeats: Γ¿» Get "https://service.electron.build/find-build-agent?no-cache=1hdasls": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it.

What is it? how to ix it?

ZedZipDev avatar Feb 13 '23 11:02 ZedZipDev

Hi, maybe you should try to mount a linux distro on a VMBox, then make a new tiny app (lets call it "TestApp") , just for test, copy all the files realted to "TestApp" from your win machine to the Linux VM, and build ur app using the console it in the VM.., and see what happens..

DarioChele avatar Mar 21 '23 20:03 DarioChele

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

GregorBiswanger avatar Mar 28 '23 20:03 GregorBiswanger

I am also having this problem. I updated the CLI to 23.6.1 and when I try to build for Linux on Windows, I get:

ΓÇó cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1i5lfuj": dial tcp 51.15.76.176:443: connectex: No connection could be made because the target machine actively refused it. attempt=0 waitTime=2

Is it not possible to build for Linux on a Windows machine?

connorsanders1 avatar May 09 '23 21:05 connorsanders1