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

Build application already packaged with electron-packager #1273

Closed
debelop13 opened this issue Feb 17, 2017 · 10 comments
Closed

Build application already packaged with electron-packager #1273

debelop13 opened this issue Feb 17, 2017 · 10 comments
Labels

Comments

@debelop13
Copy link

Hello,

I will try to explain my problem,

My app (ember app) was built with ember electron (underhood it have electron-packager). I have created .app and .exe -with .dll and some stuff-, and is working correctly.

And I want to create .dmg/.exe adding Code Signing.

Exists any way to build .dmg and .exe with electron-builder once was compilated with electron-packager?

Thanks!!!

@develar
Copy link
Member

develar commented Feb 17, 2017

Please see in the readme Pack Only in a Distributable Format

Keep in mind that default quality of electron-packager result is worse than electron-builder pack. At least, please enable asar in the electron-packager to make your app faster on Windows (and reduce code sign time).

@develar
Copy link
Member

develar commented Feb 17, 2017

Also, electron-builder will not sign your app exe — only installer. Hmm...

@debelop13
Copy link
Author

But I have an importan option in electron-packager that I didn't found in electron-builder, that is ignore a folder by platform.

electron:package --platform=darwin --arch=x64 --ignore=vendor/Windows

@develar
Copy link
Member

develar commented Feb 17, 2017

@debelop13 electron-builder allows you do it in a more simple and easy way using glob pattern — please see files Please see also https://github.com/electron-userland/electron-builder/wiki/Options#file-patterns

"build": {
  "files": ["!vendor/Windows${/*}"]
}

@debelop13
Copy link
Author

debelop13 commented Feb 17, 2017

But I want to ignore for platform:

electron:package --platform=darwin --arch=x64 --ignore=vendor/Windows

electron:package --platform=win32 --arch=x64 --ignore=vendor/macOS

@develar
Copy link
Member

develar commented Feb 17, 2017

You have three solutions:

  1. Simply specify option per platform:

    "build": {
      "win": {
        "files": ["!vendor/Windows${/*}"]
      },
      "mac": {
        "files": ["!vendor/macOS${/*}"]
      }
    }
  2. You can use ${os} (expanded to mac, linux or win according to current platform) and ${arch} in the pattern. So, rename your folder — macOS to mac, and Windows to win And use ["!vendor/${os}${/*}"]

  3. Pass extra configuration as CLI: -c.files='!vendor/Windows${/*}' Not recommended because it is not readable and can leads to bash escaping issues.

I recommend solution 2, but if you don't wan't to rename folders, you can use solution 1.

If you don't want to specify build config in the package.json, you can use electron-builder.yml or electron-builder.json or electron-builder.json5 in the root of your project or through the --config <path/to/yml-or-json5> option.

@debelop13
Copy link
Author

My app does not work once is packaged with electron-builder, because when is running it has different bugs.

I try to Pack Only in a Distributable Format, but it neither does not work.

Using

./node_modules/.bin/build --prepackaged

./node_modules/.bin/build --prepackaged electron-builds/example-8.0.21-darwin-x64
or
./node_modules/.bin/build --prepackaged electron-builds/example-8.0.21-darwin-x64/example-8.0.21.app

Bash it shows nothing: neither errors nor where is the compiled

I am doing something badly

@develar
Copy link
Member

develar commented Feb 20, 2017

Strange. What version of electron-builder do you use?

@debelop13
Copy link
Author

./node_modules/.bin/build --version
13.11.1

@dperetti
Copy link

dperetti commented Feb 21, 2017

Same as @debelop13 here.

#1284

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

No branches or pull requests

3 participants