Created
September 22, 2017 22:40
-
-
Save sistemaon/28f78c82f3f2e7ab77e95f7869431be0 to your computer and use it in GitHub Desktop.
packing and building electron windows app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const electronInstaller = require('electron-winstaller'); | |
resultPromise = electronInstaller.createWindowsInstaller({ | |
appDirectory: './release-builds/packagers/AppName-win32-ia32', | |
outputDirectory: './release-builds/packagers', | |
authors: 'AppCompany Dev', | |
exe: 'AppName.exe', | |
name: 'AppName', | |
iconUrl: 'D:/sistemaon_windows_10_pro/appIcon.ico', | |
setupIcon: 'D:/sistemaon_windows_10_pro/appIcon.ico', | |
setupExe: 'AppName.exe', | |
setupMsi: 'AppName.msi', | |
noMsi: false | |
}) | |
resultPromise.then(() => console.log("It worked!"), (e) => console.log(No dice: ${e.message})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "AppName", | |
"productName": "AppName", | |
"version": "1.0.0", | |
"license": "MIT", | |
"description": "AppName description", | |
"author": "AppName Company Dev", | |
"devDependencies": { | |
"electron-packager": "^9.1.0", | |
"electron-winstaller": "^2.6.3" | |
}, | |
"scripts": { | |
"pack:win_ia32": "node packager.js", | |
"build": "node builder.js" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const packager = require('electron-packager') | |
const options = { | |
'dir': '.', | |
'name': 'AppName', | |
'platform': 'win32', | |
'appCopyright': 'App Ltda.', | |
'arch': 'ia32', | |
'overwrite': true, | |
'out': './release-builds/packagers', | |
'prune': true, | |
'asar': true, | |
'icon': 'D:/sistemaon_windows_10_pro/appIcon.ico' | |
} | |
packager(options) | |
.then((appPaths) => { console.log(appPaths) }) | |
.catch( (err) => { console.log(err) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pack First: | |
npm run pack:win_ia32 | |
Build Second ( or last thing you do): | |
npm run build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment