asticode / go-astilectron-bundler

Bundle your Astilectron app with ease
MIT License
129 stars 68 forks source link

Bundler on Windows creates console window. #16

Closed FloThinksPi closed 6 years ago

FloThinksPi commented 6 years ago

When Opening the Gui of the Demo Project(https://github.com/asticode/go-astilectron-demo) on windows, there is also a empty CLI besides the Electron GUI.

So i suspect the -ldflags -H=windowsgui flag is not set properly in https://github.com/asticode/go-astilectron-bundler/blob/c9aa756170b8ee1a40f9f3640d34e8f6fbc80f6b/bundler.go#L435-L437

Or does the bundler.json needs any adaption here ?

Best Regards Florian :)

asticode commented 6 years ago

@FloThinksPi are you working on Windows 10 or on a lower version? Which version of Go are you using?

FloThinksPi commented 6 years ago

Hi @asticode I am on Windows 10 and Go 1.10

asticode commented 6 years ago

@FloThinksPi Could you test on Go 1.10.1 ? I've tested it with Windows 10 and it's working properly.

sebaap commented 6 years ago

I'm seeing the same behavior on Windows 10 with Go version go1.10.1 windows/amd64

asticode commented 6 years ago

ha, so you're building a windows binary from a windows machine?

I'll try that.

sebaap commented 6 years ago

Yes, exactly.

asticode commented 6 years ago

ok, can anyone test building a windows binary on a linux machine like I did and say whether it works with Go 1.10.1 and Windows 10?

In the meantime I'll investigate building a windows binary with a windows machine.

sebaap commented 6 years ago

I tested it building on linux with go version go1.10.1 linux/amd64 and running it on Windows 10 and the problem persists

asticode commented 6 years ago

Damn, that's a bummer.

A few questions:

FloThinksPi commented 6 years ago

I compiled one on Linux for Windows and will try if this occurs when i am back from Work. I Use git for Windows in cygwin but the shell that opened was a windows cmd. I will make a scrrenshot also when i am back home.

sebaap commented 6 years ago

In my case I used a virtual machine created just for this test, running Linux Mint, to build the Windows executable. Here is a screenshot of how it looks like:

win10

asticode commented 6 years ago

Mmm one thing I notice is that the name on the top left of the window is Electron instead of Astilectron demo. Did you use the default demo project? If so that may be a lead...

sebaap commented 6 years ago

Yes, I used the default demo project. Just added the environments option in the bundler.json file in order to build it for windows in the linux machine. When building in windows I didn't change anything. In both cases the empty console appears and the window title is Electron

asticode commented 6 years ago

@SebaArriagada could you try the following:

I want to check whether the problem is caused by an older version of electron or astilectron used.

sebaap commented 6 years ago

The versions are:

        VersionAstilectron      = "0.20.0"
        VersionElectron         = "1.8.1"

I managed to get rid of the empty console but I don't know the reason behind it. In the first attemps I did a git clone of the demo repo instead of a go get as the readme file says (my bad, I'm sorry). I'm pretty new in Go, and I'm very used to just clone a repo. Do you know why that append? Is this still a bug? Thanks for your time.

asticode commented 6 years ago

No worries about the git clone: if you do it, others do it, therefore the project needs to be compatible with it :) The fact that you managed to get rid of the empty console is very good news. I don't know whether this is linked to the Electron version as I think it is.

@FloThinksPi could you:

sebaap commented 6 years ago

One think I forgot to point out is that I didn't update anything from the tests I did before. The test that work and the ones that not, were built with the same astilectron project's versions (go-astilectron, go-astilectron-bundler and go-astilectron-bootstrap). The only difference was the demo project.

asticode commented 6 years ago

hey guys, could you check out the last answer of this issue and see if that helps in any way?

sebaap commented 6 years ago

hey @asticode, seems like the last answer is about how to reproduce the problem. I managed to solve it by using go get in linux, but in windows I haven't been able to get rid of the empty console. Seems to be a go problem, so I gave up with go and decided to go back to javascript. Anyway, if you need me to test something just let me know.

asticode commented 6 years ago

Hey guys,

Seems like the issue is indeed in GO and will be fixed in the next version: https://github.com/golang/go/issues/24232#issuecomment-392309327. Seems like it will also be backported to 1.10.

I'll close this issue for now, but feel free to reopen it if the problem is still there even after upgrading GO.

Cheers