<p dir="auto">As everyone knows, Electron is great in terms of easiness of designing GUIs, but has some severe security and memory issues. The need to lock a version of Chromium and Node.js into each app means no easy way to quickly solve security issues (each developer has to update their own app's version manually) and it also means a system running several Electron apps will have 150 MB in it's memory multiplied by the number of open apps, even if they require the same version of the framework. This could also mean more than 1 GB of memory used for stuff as simple as desktop widgets.</p>
<p dir="auto">A possible solution was proposed by the <a href="https://medium.com/dailyjs/put-your-electron-app-on-a-diet-with-electrino-c7ffdf1d6297" rel="nofollow">Electrino</a> project, but I think it's kind of an overkill.</p>
<p dir="auto">What I think would be the ideal fix to all of the aforementioned, would be to provide an installable "Electron libraries" distribution, which would ideally also be able to receive automatic updates, and an option for developers to release a "lite" version of their app. When the first electron-lite app is loaded, the system starts the installed "Electron libraries", and when another app is started, the same libraries are called. This way not only every app weights less on storage, but also on memory, and we're sure that none of them executes old, security-flawed versions of Node and Chromium.</p>
<p dir="auto">Of course this won't (at least immediately) replace the default way of installing electron apps, but developers could suggest, in their install site, to download the lite version + the electron libraries (if the user doesn't already have them installed), so that the amount of informed users who will prefer the safest option will increase.</p>
<ul dir="auto">
<li>Electron version: 1.82</li>
<li>Operating system: Windows 10 - Windows Subsystem for Linux</li>
</ul>
<p dir="auto">With Windows Subsystem for Linux it is now possible to run Windows executables from bash.</p>
<p dir="auto">To reproduce the <code class="notranslate">%HOMEDRIVE%%HOMEPATH%</code> folder creation issue:</p>
<ol dir="auto">
<li>Enable Windows Subsystem for Linux in Windows 10</li>
<li>Download and extract Electron to <code class="notranslate">C:\Program Files\Electron\</code></li>
<li>Add a convenience alias to bash to run electron by just typing 'electron' and pressing enter:</li>
</ol>
<p dir="auto">Update your <code class="notranslate">.bashrc</code> file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="alias electron=&quot;/mnt/c/Program\ Files/Electron/electron.exe&quot;"><pre class="notranslate"><code class="notranslate">alias electron="/mnt/c/Program\ Files/Electron/electron.exe"
</code></pre></div>
<ol start="4" dir="auto">
<li>
<p dir="auto">Close out and reenter your bash shell for Windows Subsystem for Linux. Run your newly aliased <code class="notranslate">electron</code> command.</p>
</li>
<li>
<p dir="auto">The current folder you were in when you ran <code class="notranslate">electron</code> will now have a new folder titled <code class="notranslate">%HOMEDRIVE%%HOMEPATH%</code>.</p>
</li>
</ol>
<p dir="auto">It looks like the folder is intended to store some logs, as its complete structure is:</p>
<p dir="auto"><code class="notranslate">%HOMEDRIVE%%HOMEPATH%\AppData\Roaming\Electron\logs</code></p>
<p dir="auto">Would love to find a solution to this to stop these directories from being created.</p>
<p dir="auto">Thanks!</p>