Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add electron-packager examples #137

Open
pookpal opened this issue Jun 5, 2017 · 5 comments
Open

add electron-packager examples #137

pookpal opened this issue Jun 5, 2017 · 5 comments

Comments

@pookpal
Copy link

pookpal commented Jun 5, 2017

eg.

@pookpal
Copy link
Author

pookpal commented Jun 5, 2017

create new folder in app such as imgs, and then add icon both ico and icns

"buildAll": "electron-packager ./app --all --out ./OutApp --version 1.4.6 --overwrite --icon=./app/imgs/logo.ico",

"buildWin": "electron-packager ./app --platform=win32 --arch=ia32,x64 --out ./OutApp --version 1.4.6 --overwrite --icon=./app/imgs/logo.ico",

"buildMac": "electron-packager ./app --platform=mas --arch=x64 --out ./OutApp --version 1.4.6 --overwrite --icon=./app/imgs/logo.icns",

@travisstaloch
Copy link

Hello and thank you for the example scripts. I am trying to use the buildWin script you provided, leaving off the icon as I'm having troubles with that for now. This allows the build to complete. But when i run the created exe, I keep getting the error below. The error message 'SyntaxError: Unexpected token import' indicates that the javascript interpreter isn't groking import (es5 feature I think). This app has been working fine when started with npm run app. Any ideas what the problem could be? I made sure to npm run build before release building but I don't think that is the problem...

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
C:\Users\Travis\Documents\Code\Projects\miner-manager\release-builds\Miner Man-win32-ia32\resources\app\client\index.js:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { import './promise-polyfill'
                                                                                                                                                           ^^^^^^
SyntaxError: Unexpected token import
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Object.<anonymous> (C:\Users\Travis\Documents\Code\Projects\miner-manager\release-builds\Miner Man-win32-ia32\resources\electron.asar\browser\init.js:171:8)
    at Object.<anonymous> (C:\Users\Travis\Documents\Code\Projects\miner-manager\release-builds\Miner Man-win32-ia32\resources\electron.asar\browser\init.js:173:3)
    at Module._compile (module.js:571:32)

@travisstaloch
Copy link

I was able to get this working by copying package.json into app folder and changing a line

  "main": "client/index.js",

to

  "main": "index.js",

here is my script entry:

"buildWin": "electron-packager ./app --platform=win32 --arch=ia32,x64 --out ./release-builds --version 0.1.0 --overwrite",

@motin
Copy link

motin commented Apr 26, 2018

electron-builder seems more straightforward to use

@motin
Copy link

motin commented Apr 28, 2018

Maybe this issue can be closed in favor of #115?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants