Skip to content

Electron on Windows

Flynn Duniho edited this page May 30, 2024 · 1 revision

Notes on building electron on Windows!

The goal is to take the Electron App (which is just a NodeJS express server with some additional websocket services we've added) and build a binary that runs in the Windows environment.

Development Environment Requirements

  • SourceTree 3.0+ for Windows (supports GitLab)
  • Personal Access Token (PAT) created in GitLab repo by administrator, sent to developer
  • Git for Windows, including Git Bash installed globally
  • NodeJS for Windows installed globally
  • A working shell (powershell, gitbash, or something else) that has Windows paths and environment variables set in a compatible way with a Unix-y setup.
  • Visual Studio Code terminal, loading one of the above shells

Path Issues

  • Git Bash has to be in the Path
  • NodeJS has to be in the Path
  • Powershell or Git Bash (a wrapper around CMD) use windows-style paths
  • WSL shell runs in a LINUX environment, and isn't suitable

Script Execution Issues

  • running a program under Windows is different; the scripts crash
  • getting debug output from NodeJS under Windows seems different too (possibly it's due to missing environment variables to enable debug output from Node?)

Electron Packager

  • The tool used to create the binary for windows must run on Windows.
  • The packager works on a built directory that contains all the files that are served by the standalone server appliance app (meme.app on MacOS).
  • To create the built directory, we need to be able to run webpack from the command line before we can even run the packager.
  • Currently it doesn't work, but maybe it's a day to do it? Maybe three days? Hard to tell.