I’m looking to package all of my app into one file.exe that doesn’t need other files and folders to run, so that my users can copy this file.exe and have everything they need and can move it to anywhere on their computer and still run it. How do I do this?
Asked
Active
Viewed 4,029 times
2
-
Have you looked into electron-forge? https://github.com/electron-userland/electron-forge – Matt Holland Aug 18 '17 at 21:51
-
yes, but I have no idea how to use it, and the docs are confusing – Jacob Weisenburger Aug 19 '17 at 16:18
-
Possible duplicate of [How to deploy an Electron app as a executable or installable in Windows?](https://stackoverflow.com/questions/31286924/how-to-deploy-an-electron-app-as-a-executable-or-installable-in-windows) – GorvGoyl Oct 25 '17 at 19:06
1 Answers
3
I used a package called electron-winstaller
This takes a already packaged installer with all the .dll
files and puts them into a single .exe
To package you can use this script:
var installer = require('electron-winstaller');
var path = require('path');
console.log("packaging into a exe...");
resultPromise = installer.createWindowsInstaller({
appDirectory: './AppName-win32-ia32',
outputDirectory: './installers',
exe: 'AppName.exe',
setupExe: 'FinalExeName.exe',
noMsi: true,
iconUrl: 'IconUrl',
setupIcon: 'IconPath'
});
resultPromise.then(function () {
console.log("Installer created");
require('electron').app.quit();
});

Joshua
- 5,032
- 2
- 29
- 45