-1

I build and run many Electron apps on Windows. I noticed that all of them have the same common api files / libraries to run. They all take about 30mb of space.

I'm thinking of installing these files in the system, maybe moving them to system32 folder or the GAC, and then removing them from all my electron apps.

I would have an installer package for electron files, let's say "electron-dependencies" a bit like a regular redist package that can be is installed, and once it's there, all Electron apps run using the same files with much smaller size.

Would this actually work? Any drawbacks or thoughts on this?

I believe in the future Microsoft could support Electron (they already do with VSCode and maybe with their new Chrmoium Browser) by including these libraries on Windows out of the box.

closed as primarily opinion-based by gnat, JimmyJames, Jörg W Mittag, BobDalgleish, Kilian Foth Dec 14 '18 at 7:28

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • It would make a lot more sense if Electron apps used a shared copy of the browser engine, much like Cordova apps do. But I think that's probably something best left to OS vendors. – GrandmasterB Dec 12 '18 at 21:20
3

No.

From the Electron tutorial:

At this point, you'll need to install electron itself. The recommended way of doing so is to install it as a development dependency in your app, which allows you to work on multiple apps with different Electron versions.

This is a clear advice that if you try to install Electron libraries just once inside the system32 folder or a similar central place, and not inside each application's folder, you cannot easily mix different versions. Worse, you might produce version conflicts with other Electron apps where you are not the author and which definitely use a different Electron lib version than your apps.

So don't make the same error as Microsoft several years ago, when they provided just one MFC.DLL and one MSVCRT.DLL directly in the Windows system folder, allowing each program just to install a newer version of those DLLs by replacing the older ones (and sometimes replacing newer versions by older ones). This caused so much trouble that this phenomenon got the name "DLL hell".

Of course, today, modern Windows systems have means and conventions to provide different versions of the same libraries and frameworks in parallel. For example, the global assembly cache (GAC) you mentioned is designed specificially to avoid version conflicts. But its usage is restricted to .NET libraries ("assemblies"), and AFAIK Electron is node.js based, not .NET framework based, so better follow the instructions from their manual.

Not the answer you're looking for? Browse other questions tagged or ask your own question.