HeinrichApfelmus / threepenny-gui

GUI framework that uses the web browser as a display.
https://heinrichapfelmus.github.io/threepenny-gui/
Other
437 stars 77 forks source link

added instructions for packaging with Electron #169

Closed jerbaroo closed 7 years ago

jerbaroo commented 7 years ago

relates to #111 and #52

I recommend reading the instructions as rendered markdown rather than in the "Files changed" menu

HeinrichApfelmus commented 7 years ago

This looks very useful, thank you!

However, there is one small problem: If I understand this correctly, when using the Electron packager to generate an application package, the package will still depend on a precise location of the executable via the relBin variable in electron.js.

Could you change your pull request so that the executable is automatically built and copied to the right location when building a package?

I have done something like this in my HyperHaskell project, you can probably just adapt the Makefile and provide a new one in doc/electron/Makefile.

jerbaroo commented 7 years ago

Yep, I'll have a look at that in the next few days

jerbaroo commented 7 years ago

Just an update that I've been a bit busy but have some free time to tackle this shortly

HeinrichApfelmus commented 7 years ago

I know the feeling. 😉 I'd be happy to include this in the upcoming 0.8 release if you can find the time, but no worries if not, there's always a next release.

jerbaroo commented 7 years ago

relBin is a relative path from electron.js to the Haskell application binary (which is copied to the application bundle). I've added instructions for Stack users on how to build the Haskell application binary to an explicit location (e.g. stack install --local-bin-path bins instead of stack build), such that relBin can be set to something consistent like ./bins/your-app-exe.

The previous electron-packager instructions would copy the entire directory (including the Haskell application binary) to the packaged app. Added instructions on ignoring things like app/, src/, and .stack-work/.

Also added a link to a minimal full working example.

HeinrichApfelmus commented 7 years ago

Thanks a lot for this! I will highlight this in the README.