bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
307 stars 82 forks source link

Build windows app (*.exe) on linux platform #276

Open FridaCai opened 5 months ago

FridaCai commented 5 months ago

Hi Team,

We are trying to build windows app (*.exe) on linux build machine and meet following error:截屏2024-01-21 20 55 53

We can solve the problem by adding following line before build:

https://github.com/bennymeg/nx-electron/blob/0d194ccb2c330b40656a163dfb29af2797403d77/packages/nx-electron/src/executors/package/executor.ts#L83

normalizedOptions.win=[]

more information can be find here: https://github.com/electron-userland/electron-builder/blob/277341000a87abaa65a7985854c06e88ed5938b9/packages/electron-builder/src/builder.ts#L89C1-L89C26

Although we have approach to solve this problem, it is not good practice to modify framework code in application project. So may I have your advice about how to config/use nx-electron properly in this case? Thanks in advance and look forward for your reply. Feel free to let me know if you need more details.

Akxe commented 1 month ago

I would suggest using https://www.npmjs.com/package/patch-package; it can even generate the PR here

Akxe commented 1 month ago

As a side note. Do you sign the resulting executable? If so, how? The sign .exe program is probably only for Windows...

bennymeg commented 1 month ago

Thanks.