About package an Electron APP on MacOS

Merry Christmas.I created an Electron project and tried to package on 64bit MaxOS.When I execute the command: npm run build-mac64,I got these message:

It seems like the variants $(ProjectName) $(MainJS) $(Electron version) are all invalid.

This APP runs perfact on Windows10, how can I resolve this issue?

Thanks.

What is the version of electron & electron-packager on the mac vs Windows?

The version of electron on macos is 16.0.5, same to Windows10.

@brunofierens Sorry, The vesion of electron on MacOS is 16.0.5 and on Windows10 is 11.0

We have not validated against Electron 16 yet. Can you try to force an older Electron version on macOS?

I tried Electron 11.0 on MacOS which is same to Windows10, but the problem still.I also tried Electron 16 on Windows10 and it works good.

The message showed in terimal means the $(ProjectName) and other variables($(ElectronVersion,$(MainJS),$(Version)) in the package.json are invalid, I suppose the key point is these variables are not defined on MacOS64,or this is a bug.

Could you please double check this?

I make it clear, the offical guide about package on MacOS is below:

But it is not clear enough.

First we have to compile the electron project in delphi on Windows with the 'MacOS 64' build option, pas2j will translate the code from pascal to java script, an error message would be shown in console: Build MacOS 64 on Windows is not support, it dose not matter, an output folder 'Build-MacOS64' under the TMSWeb folder will be generated, this is the key point.

Then copy the 'Build-MacOS64' folder to a Mac and run 'npm run builde-mac64' under the folder. The electron-packager can works correct by this way.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

It is correct that always the app needs to be compiled from Object Pascal code. This is indeed typically first done from the Delphi IDE and the generated compiled files are then copied to the mac and from there packaged as Electron app.