pojala/electrino

Windows Support

styfle opened this issue Β· 21 comments

Has anyone thought about how to support windows?

I was thinking of using WebView which supports Windows 8 and Windows 10.

In apps compiled for Windows 10, WebView uses the Microsoft Edge rendering engine to display HTML content. In apps compiled for Windows 8 or Windows 8.1, WebView uses Internet Explorer 11 in document mode.

There's a sample UWP app available on GitHub.

Thoughts?

kek91 commented

I think that's implied in #4 (but the subject could perhaps be changed to something else to clarify cross platform support), but that's a great tip so you should probably post it in that issue incase this gets closed

WebView would be a nice option. I've done some experiments for something similar to Electrino on UWP but nothing serious, maybe I can help here!

@kipters I've also began to experiment with WebView in a UWP app but am not really fond of the Windows Store deployment scenario. Do you know if it's possible to embed Edge into a WPF app? The Browser control seems to only embed IE in WPF apps unfortunately.

@frankhale There's the WebView for WPF, docs

That is the docs for the UWP WebView.

@frankhale I've looked into it but I couldn't find anything about embedding Edge in desktop apps 😞

UWP may still be an option since UWP != Windows Store, you can deploy non UWP apps to the store and you can install UWP apps from outside the store (but yes, no support for 7 or 8.x)

I'll dig up on my PC to see if I can find my old prototype and clean it up a bit

@kipters oh I see. I got tripped up on the setting that I had to set when developing UWP which allows apps to be installed outside the store. The settings menu makes it look like it's only available for developers and of course Microsoft makes it sound like setting that is the worst security decision I could ever make. This is why I assumed that UWP needed to be deployed to Windows Store (I thought that option wouldn't be available for non developers).

@frankhale IIRC the "allow sideload" option is enabled by default for every user (the three possible options are "only from the store", "allow sideload", "dev mode") since Anniversary Update.

The only caveat with out-of-the-store installs is that the .appx must be signed

All, it seems tht13 added windows support in #11 so take a look if you get a chance.

tht13 commented

#11 uses the chakra JavaScript engine and Edge for the viewing browser. It implements the same functionality as the initial hello world implementation of webview on Mac OS but in c# Vs objective c.

Has anyone considered Windows 7 support? I really don't want to build apps for Windows 7, but most usage statistics suggest 45-49% of the world is still using Windows 7... which happens to be the largest slice of the OS pie. Obviously Chakra/Edge isn't available.

How can I use this on Windows? Specifically 7,8.1,10? Can somebody give detailed instructions?

@Jimster121 - It can't be used on Win7 because Win 7 doesn't support Edge/Chakra. I'm sure someone else can chime in regarding Win8/10 (I didn't end up moving forward on this).

Can IE 11 be used instead of Edge? If yes, then how? Can WebKit be used using this command from the Linux port issue? #1 (comment)

@Jimster121 IE11 is too old, it doesn't make sense to use it instead of Edge, Edge is more future proof. Moreover, WebKit is no go, embedding it in an app defeats the purpose of Electrino

tht13 commented

Elecrtino on windows is not dependent on either IE11 or Edge, it is dependent on the Chakra JS engine which is a part of Edge and Win10 (It uses the Edge rendering engine, but that is baked into Win10). As such Elecrino is only compatible with Win10. Win8 may be compatible if the Chakra engine dlls are shipped with it but this then defeats the purpose of Electrino which is to use system dlls to run the rendering and execution of the JS code.
Win10 is the first version of windows which provides developer access to a system level JS engine.

If you want Win7/8 then just stick with Electron. Another solution to this problem which I have considered is a Electron version controller which installs global versions of Electron for the system to share, so if two applications (say VSCode and Slack) are using the same version, it only gets installed once in a common location, but thats an idea for another project.

kek91 commented

That's a great idea @tht13

Would this also be beneficial for system performance (specifically less memory usage) since they're working from the same engine or would it only save disk space from not having duplicate installs?

Either way, strange it hasn't been implemented already in Electron core or as a npm module.

Win8 may be compatible if the Chakra engine dlls are shipped with it but this then defeats the purpose of Electrino which is to use system dlls to run the rendering and execution of the JS code.

How large can these files be? If they are small, I have no problem shipping them with my app, but guess I'll have to use Electron to support Windows 7 which is not ideal because according to this, Windows 7 & 10 have the most users which is around 40%

tht13 commented

@kek91 As you would still need to launch seperate instances of Electron for each program the benefit would only be with disk space/installers. I think one of the main issues as to why no one has done this yet is because there are so many different versions of Electron and not many people will have more than 2 or 3 Electron apps installed anyway.

@Jimster121 I believe the Chakra dlls are about 14MB, so they should be shippable, but that is excluding however large Elecrino will become in terms of its replication of the NodeJS API and Electron modules.

While this project is a nice idea I am not currently actively working on it. I would advise sticking to Electron.

Can you give me some instructions on how to make the app including the required DLLs? I would like to test it.

@tht13: Another solution to this problem which I have considered is a Electron version controller which installs global versions of Electron for the system to share, so if two applications (say VSCode and Slack) are using the same version, it only gets installed once in a common location, but thats an idea for another project.

@kek91: Would this also be beneficial for system performance (specifically less memory usage) since they're working from the same engine or would it only save disk space from not having duplicate installs?

Either way, strange it hasn't been implemented already in Electron core or as a npm module.

@tht13: As you would still need to launch seperate instances of Electron for each program the benefit would only be with disk space/installers. I think one of the main issues as to why no one has done this yet is because there are so many different versions of Electron and not many people will have more than 2 or 3 Electron apps installed anyway.

The idea of a common Electron runtime, which users could install for all their Electron-using applications, has already been discussed for a while in electron/electron#673β€”currently with no resolution.