dtylman / gowd

Build cross platform GUI apps with GO and HTML/JS/CSS (powered by nwjs)
MIT License
432 stars 43 forks source link

Bundle nwjs during build for a standalone executable? #6

Closed daluu closed 6 years ago

daluu commented 7 years ago

Hi, pardon my inexperience. Looks like this project requires nwjs installed to run?

I like go in that it can build self contained binaries that tend to also be small footprint. It would be nice for future enhancement to build scaffolding on top of this project such that you can bundle the nwjs requirement into the compiled go binary so that instead of

nw . in the current path where the code is compiled, we could do ./myGoAppName, and where we can use go build and go install (or some other final build process) on the scaffolding to produce a standalone self-contained binary that will run w/o installing nwjs for it is packaged in with the compiled app.

Initially this could just target the platform being built on, and later look into cross-compile support (compile once and you get binaries for *nix, Mac, Windows).

For me, w/o the self contained binary feature, I don't see that much benefit of go w/ nwjs, I could just use other language with it instead.

dtylman commented 6 years ago

Well, I was thinking about that, but nwjs itself is not statically linked, so it is not possible to just link everything inside. And also the HTML / JS part of the app must be also packed.

This means you must provide some kind of installation when distributing go + nwjs app.

So you can call nwjs from your go main, (execute) if you want one starting point. But if find that cumbersome and quite useless as you can just provide a shortcut with nw <my-app> ...

Hope this helps...

Danny.

daluu commented 6 years ago

Thanks for the feedback. Didn't know nwjs wasn't fully self contained.

MostHated commented 5 years ago

I want to say that https://github.com/gobuffalo/buffalo does some things that might make this doable. They are able to put everything within a single self contained binary and they have a lot of stuff. Perhaps looking over what they do might shed some light on some possibilities?

dtylman commented 5 years ago

BTW: what about nw builder, it bundles everything easily and you can customize the app name (and Icon on Windows). Doesn't that helps?