question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

asar target and prepackaged option support for it

See original GitHub issue
  • electron-builder 11.2.3:
  • OSX:

Builder crashes when trying to package app with --prepackaged command with the following error:

Error: ENOENT: no such file or directory, 
open '/Users/pro/repository/desktop_app/dist/mac/Desktop.app/Contents/Resources/app-update.yml'
at /Users/pro/repository/desktop_app/node_modules/electron-builder/src/macPackager.ts:101:13

In my package.json: {"dist": "npm run compile && build --prepackaged ./asar"} where ./asar is the folder containing app.asar, core.asar and node_modules.asar files

What I want is to be able to point electron-builder into a folder containing app.asar and it would package the apps for distribution.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:27 (26 by maintainers)

github_iconTop GitHub Comments

6reactions
pauliusuzacommented, Jan 17, 2017

@develar I posted a 50$ bounty for this.

2reactions
pauliusuzacommented, Feb 3, 2017

Thanks @develar for checking out the code. Leaving a comment here if someone has the same issue (this should be documented somewhere eventually)

Important bit is to specify the electronVersion and projectDir parameters. Working example:

import * as builder from 'electron-builder';
let config = {
    appId: 'com.asar.test',
    directories: {
        buildResources: './build_resources'
    },
    electronVersion : '1.5.0'
}
builder.build({
    projectDir: './path/to/folder/with/asar/files',
    config: config
}).then(() => {
    console.log('done');
}).catch((error) => {
    console.log(error);
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Options | electron-packager
Functions to be called after your app directory has been packaged into an .asar file. Note: afterAsar will only be called if the...
Read more >
Tech Services & Support - Target
Phone support. Call for help: 1-833-TGT-Tech. Available 7am–11pm CST.
Read more >
How to use the electron-builder.build function in ... - Snyk
MAC.createTarget(); break; case "linux": console.log("Using build configuration to Linux (64-bit)."); target = Platform.LINUX.createTarget(); break; default: ...
Read more >
Packaging and distributing Electron applications using ...
So far, we haven't packaged the application as we were only running the application using either the $ electron or $ electron-webpack commands....
Read more >
Configuration - Electron Forge
platform : the target platform for the app ; arch : the target architecture for the app ; outputPaths : an array of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found