Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next: Windows #141

Closed
maxence-charriere opened this issue Jun 11, 2018 · 39 comments
Closed

Next: Windows #141

maxence-charriere opened this issue Jun 11, 2018 · 39 comments
Assignees

Comments

@maxence-charriere
Copy link
Owner

maxence-charriere commented Jun 11, 2018

Hello, some stuff are happening here.
I'm writing changes that will bring better support for multi-platform dev.
Would like to know what is the next driver you would like to be implement.




@maxence-charriere maxence-charriere changed the title Next driver Next: Android, IOS, Linux or Windows Jun 11, 2018
@maxence-charriere maxence-charriere changed the title Next: Android, IOS, Linux or Windows Next: Android, IOS, Linux or Windows? Jun 11, 2018
@maxence-charriere maxence-charriere self-assigned this Jun 11, 2018
@maxence-charriere maxence-charriere changed the title Next: Android, IOS, Linux or Windows? Next: Windows Aug 29, 2018
@maxence-charriere
Copy link
Owner Author

Windows is what is coming next. I ll use this issue to give news on the development.
Feel free to post your suggestions or any questions related to windows here.

@ghost
Copy link

ghost commented Sep 16, 2018

Windows is what is coming next. I ll use this issue to give news on the development.
Feel free to post your suggestions or any questions related to windows here.

Great!!!

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Sep 22, 2018

Just to give a little news,

Windows dev experience is really pain in the ass...
But, just made a go program work in a UWP:

capture

For the moment I did not use Visual Studio and the build is pretty fast.
Let see how it goes next. Gonna try to launch a window now.

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Sep 27, 2018

Step by step, little by little...

capture2

Now launching the go program with the uwp using desktop bridge.

The hack works that way:

  • Built an UWP with visual studio 2017 in Release mode for x64 with .net native.
  • UWP .dll, .exe and .pri are copied in the goapp directory.
  • When building with goapp win build:
    • create the package.
    • go build.
    • copy the UWP .dll, .exe and .pri into the package.
    • generate the AppxManifest.xml.
    • deploying on local machine.
  • launch the app with start menu.

I still have a problem:
When generating AppxManifest.xml, if I put a different value for the identity name, the uwp program crash at launch.

This is working:

<Identity Name="4a99c091-2185-434d-8088-4b6c643f38fc" Publisher="CN=Maxence" Version="1.0.0.0" />

This is not working:

<Identity Name="goapp" Publisher="CN=Maxence" Version="1.0.0.0" />

I also tried to put a different guid but it does not work either.

If someone have an idea, please let me know!
Can also see the full AppxManifest.xml template.

@txthinking
Copy link

Is there a planned release time? 👍

@maxence-charriere
Copy link
Owner Author

Got a good improvements since last posted update. I don't want to give a release time. Just I expect to have it by the end of the year.

@zet4
Copy link

zet4 commented Oct 16, 2018

This looks awesome, is there anything others can contribute to this to get it rolling sooner? Really itching to play with it.

@maxence-charriere
Copy link
Owner Author

@zet4 Thank for proposing. Right now I'm still in a spot where I'm defining how the communication go/winrt works.
Once it done I could post an update here with some stuff to implements for the ones who would be up to the task.

@maxence-charriere maxence-charriere added working on it The issue is being worked on. and removed enhancement labels Oct 26, 2018
@maxence-charriere maxence-charriere added this to the Windows milestone Oct 26, 2018
@Wulfheart
Copy link

I'm so excited. When do you expect it to be rolled out?

@maxence-charriere
Copy link
Owner Author

@Wulfheart when it will be ready :)

@Wulfheart
Copy link

Wulfheart commented Oct 30, 2018 via email

@maxence-charriere
Copy link
Owner Author

Hello folks, just wanted to give a little update on how it's going.

Progress since last:

  • Go to C# communication.
  • C# to Go communication.
  • Can display hello world example!

What next:

  • CSS files
  • Js to Go communication

Here is a screenshot of the hello world example for now:

capture3

@maxence-charriere
Copy link
Owner Author

Folks, I warn you, the code is pretty dirty right now but...

capture4

On this note, I going to sleep now.

@Wulfheart
Copy link

Even if the code is really dirty: Can we use it right now?

@maxence-charriere
Copy link
Owner Author

@Wulfheart Unfortunately it need a lot of polish. I will do a release when it will be usable. I don't want to drop something that hacky and scare the people who want to try it. But the prototype is here and now I can build on the top until it become enough good.

Omg, I spent months to get there 😭 .

@atlasdatatech
Copy link

Very looking forward to

@maxence-charriere
Copy link
Owner Author

Working hard on it, the goapp tool is in a spot where i m satisfied. If you want to try it you can go to the 4.0.0 branch.

You will need a windows machine. Mingw64 and the windows 10 sdk to make it work.

You also will need to install the goapp cmd tool from this branch.

Very experimental and a lot of stuff is missing. The hello world example is working. Did not test the others since its far to be feature complete.

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Dec 13, 2018

Just some little news about this:

  • Working on a new example that allow to enumerate and test what the package can do. It helps a lot with the Windows implementations.
  • App can be opened from file or url.
  • Working on window related feature now.
  • Just implemented frosted background.
  • Starting the UWP messy window handling...

And here is what it looks like:
capture5

Here is the Mac version to see how it compares:
screen shot 2018-12-13 at 9 45 12 am

@zet4
Copy link

zet4 commented Dec 13, 2018

Looks awesome, though I feel like Apple fanboys might complain about windows looking apps on their platform haha

@maxence-charriere
Copy link
Owner Author

Well, it is css so you just shape it the way you want :D

@zet4
Copy link

zet4 commented Dec 13, 2018

I am curious though, what's the performance like, compared to say, Electron.

@maxence-charriere
Copy link
Owner Author

In term of the graphic performances it is like comparing Edge vs Chrome.

This is more smooth, use less battery and is less heavy. Electron rendering supports better standards and is more stable.
Sometime later it would not matter anymore since Microsoft will provide Chrome based webview. When it happen this package will have an option to chose which rendering engine to use, and will default to the Chrome based one for better cross platform compatibility.

No need to compare the javascript part since the javascript layer is just a bridge between the webview and Go. All other computations are Go native code which gonna be faster and more memory efficient than Electron 's javascript.

All of this is theory and to be honest, I did not benchmark the cost of passing data from go to UWP|Cocoa.
I let raw graphic performances to the expert in this domain (Google, Apple, Microsoft). This package is about giving a good and easy to use API to build app with Go.

@enggjiten
Copy link

enggjiten commented Dec 14, 2018

can you share build steps for windows
I tried with below commands
.\goapp.exe win init

Getting error with below commands
.\goapp.exe win build
.\goapp.exe win run -dev

.\goapp.exe win build -dev -v
‣ creating app.app
‣ building executable
‣ installing uwp dependencies
‣ reading settings
x fork/exec C:\Users\user\AppData\Local\Temp\goapp\app\app.exe: This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

Am i missing something

@maxence-charriere
Copy link
Owner Author

@enggjiten are you on 32 or 64 bit Windows ?

@enggjiten
Copy link

I have 64-bit Windows 10 Pro.
Go version:
go version go1.11.2 windows/amd64
MingW64 \x86_64-8.1.0-win32-seh-rt_v6-rev0

@maxence-charriere
Copy link
Owner Author

What version of the Windows 10 sdk you have ?

@enggjiten
Copy link

Windows 10 SDK (10.0.17763.132) latest one available with Windows 10 1809
My Windows 10 version 1803.
Could it be problem ?

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Dec 14, 2018

No just trying to see the differences.

A couple of thing:

  • Can you run goapp win run -h and copy/paste the output.
  • Can you go build your program after commenting the part that uses app.Run, add a fmt.Println("whatever") and try to launch the generated program to see if the error is there too.

Also did you go install the github.com/murlokswarm/app/cmd/goapp program after switching to the 4.0.0 branch ?

@enggjiten
Copy link

enggjiten commented Dec 14, 2018

Correct me if i am doing something wrong here.
I built the latest goapp.exe with 4.0.0 repo.
Go to \app\examples\demo
Run src\github.com\murlokswarm\app\examples\demo> ..\..\cmd\goapp\goapp.exe win build -v

Output::
creating demo.app
‣ building executable
github.com/murlokswarm/app/drivers/win
# github.com/murlokswarm/app/drivers/win
....\drivers\win\driver.go:259:3: unknown field 'TitlebarHidden' in struct literal of type app.WindowConfig
....\drivers\win\window.go:59:3: cannot use c.OnMove (type func(app.Window)) as type func(float64, float64) in field value
....\drivers\win\window.go:60:3: cannot use c.OnResize (type func(app.Window)) as type func(float64, float64) in field value
....\drivers\win\window.go:61:3: cannot use c.OnFocus (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:62:3: cannot use c.OnBlur (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:63:3: cannot use c.OnFullScreen (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:64:3: cannot use c.OnExitFullScreen (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:65:3: cannot use c.OnMinimize (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:66:3: cannot use c.OnDeminimize (type func(app.Window)) as type func() in field value
....\drivers\win\window.go:67:3: cannot use c.OnClose (type func(app.Window) bool) as type func() bool in field value
....\drivers\win\window.go:67:3: too many errors
x exit status 2

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Dec 14, 2018

oh, yes this is normal! the last 4.0.0 merge come from Mac modifications, it should work on window-on-Windows branch.

@maxence-charriere
Copy link
Owner Author

Just warn you if you arrive to launch it, support is super limited now, still a lot of work to do in order to make it usable to build something.

Also, goapp win run without -dev option is making the app crash.

Let me know how it goes.

@enggjiten
Copy link

enggjiten commented Dec 14, 2018

Just for future documentation purpose, adding this link.
https://pureinfotech.com/install-unsigned-windows-10-apps-powershell/

@enggjiten
Copy link

UWP App built and installed.
When i try open it try to do something but could not open up.

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Dec 14, 2018 via email

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Dec 16, 2018

Some news:

  • Went as far as I can with the window UWP limitations.
  • I don't know what Microsoft smoke but their API is the biggest mess up I ever seen.
  • Now handle multiple windows.
  • handle Window.OnClose.
  • Compo Navigation from <a> tag is working.
  • Improved code stability (but still far from the expected standard 😡 UWP APIs).

And here is the screenshot with multi-window support:

capture6

Next:

  • Make example about app opening
  • Menus
  • File pickers
  • Popup Notification
  • Share
  • Controller

@enggjiten
Copy link

enggjiten commented Dec 17, 2018

i tried again with branch 4.0.0

Run below command and got result as below.

\src\github.com\murlokswarm\app\examples\demo> ..\..\cmd\goapp\goapp.exe win
run -dev
start : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ start goapp-demo://
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

x exit status 1

Instead of UWP app, can we run executable container ?

@maxence-charriere
Copy link
Owner Author

what do you mean by executable container ?
Is the app is at least installed ? when you go on the start menu and type demo.

@enggjiten
Copy link

enggjiten commented Dec 17, 2018

Yes, it is built and installed but not running.
I got eventviewer logs

Unable to start a DCOM Server: jiten_1.0.0.0_neutral__xgkf2qwfy5v6a!jiten as Unavailable/Unavailable. The error:
"2"
Happened while starting this command:
"C:\Users\jiten\Documents\golaunch\src\github.com\murlokswarm\app\examples\demo\demo.app\uwp.exe" -ServerName:jiten.AppXqanewx1bwvrv122c6t62bx49f5nwzagk.mca

Let me know if you know the solution of this.
I am not sure about exe name, it is looking of uwp.exe while demo.exe is generated during run.

@maxence-charriere
Copy link
Owner Author

maxence-charriere commented Feb 18, 2019

Just a heads up here. The windows driver is too hacky and unstable. I experienced a lot with it and I don't think its good to go in a release.

During the past week I though about the future for this package. I posted another issue that deals with that question:
#262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants