Skip to content

Instantly share code, notes, and snippets.

@ravipudi
Last active February 18, 2025 12:19
Show Gist options
  • Save ravipudi/c12716015ea0607fa5ab90184bc82396 to your computer and use it in GitHub Desktop.
Save ravipudi/c12716015ea0607fa5ab90184bc82396 to your computer and use it in GitHub Desktop.
Electron - Creating a windows portable executable

How to create a portable windows application without an installer from an electron project:

  1. Clone the electron-quick-start repo:
git clone https://github.com/electron/electron-quick-start
  1. yarn
  2. Make your application - probably edit main.js to navigate to some URL
  3. yarn add electron-packager
  4. Edit package.json - update the 'name' and add a new script 'packager':
{
  "name": "my-app-name",
  ...
  "scripts": {
	"start": "electron .",
    "packager": "electron-packager ./ --platform=win32"
  }
}
  1. 'npm start' will bring up the application
  2. 'npm run packager' will package the app for windows. You will see a new directory 'my-app-name-win32-x64' in the top directory of the project, with a my-app-name.exe
@jrobbl
Copy link

jrobbl commented Feb 18, 2025

@pa-0
And what other alternative for portability you find better?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment