You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asar target and prepackaged option support for it #1102
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.
@pauliusuza Crash fixed. But prepackaged is not for your use case. @wojtkowiak Could you please share your experience — how do you use already packed asar files?
So I found a temporary workaround by packing app.asar through the electron-builder, and including the remaining .asar files through extraResources key:
However, it would be really great if electron builder would have a feature which would simply pack the whole folder and it's contents if it has app.asar file without running additional checks.
I am not sure what this problem is actually about. @pauliusuza if you are packing your app to asars yourself you just need to turn off asar packing in electron-builder, the rest should work. I am using electron-builder programmatically so I am just setting asar to false in build options. @develar is there a cli switch for that?
@pauliusuza So — you have some folder where asar files are located (app.asar is required, no other electron files) and just want to pack it into .app or .dmg or any other electron-buidler target?
Just curious — why electron-builder is not suitable to produce required asar files?
@develar yes. Mostly for flexibility - we want to separate the build process and packaging process. Asar files would be built in one CI process (which is complex and takes more time) and stored on a cdn, and packaging would run in another process on demand.
We have a use case where we need to be able to build 20-30 different apps on demand on CI re-using same .asar files, but only changing app name and branding.
Using electron-builder? Or using asar tool programmatically? I just want to understand to be sure that implemented solution will be the best solution (not workaround).
The first step of the process would be running asar tool programmatically (through gulp or npm script) and pack the required files into .asar archives, it would then store those .asar files into a CDN. This would run on CI on each commit.
Second step would be executed on demand. It would fetch the latest .asar files from CDN, store them into a folder, apply required customization / branding, and run electron builder to pack all of this into a distributable format.
changed the title [-]Crash: app-update.yml not found when using --prepackaged[/-][+]asar target and prepackaged option support for it[/+]on Jan 11, 2017
So just a note for --prepackaged /dir
If app.asar already exists in the /dir, then it should check for existence of the package.json and index.js files inside the app.asar file, and not in the /dir folder itself.
How can i specify project directory through options and point it to a subfolder containing asar files?
Project folder contains files which should not be packaged, and there is no way to exclude them.
Error: Application entry file "index.js" in the "/Users/pro/repository/test-project/dist/mac/Test Project.app/Contents/Resources/app.asar" does not exist. Seems like a wrong configuration.
// index.js file exists:
$> asar list /Users/pro/repository/test-project/temp/asar/app.asar
/index.js
/package.json
Additional files in the asar folder were not copied to the Resources
Would it not be simpler just to ignore the app folder packaging step if a specific flag is set, so we can include the .asar files via extraFiles / extraResources?
Activity
fix: Crash: app-update.yml not found when using --prepackaged
develar commentedon Jan 11, 2017
@pauliusuza Crash fixed. But
prepackagedis not for your use case. @wojtkowiak Could you please share your experience — how do you use already packed asar files?pauliusuza commentedon Jan 11, 2017
So I found a temporary workaround by packing app.asar through the electron-builder, and including the remaining .asar files through extraResources key:
However, it would be really great if electron builder would have a feature which would simply pack the whole folder and it's contents if it has app.asar file without running additional checks.
build --fromAsar ./path/to/folder/containing/app.asar_file/Would you consider adding this feature?
develar commentedon Jan 11, 2017
@pauliusuza It is already supported (#759)
What error do you get?
wojtkowiak commentedon Jan 11, 2017
I am not sure what this problem is actually about.
@pauliusuza if you are packing your app to asars yourself you just need to turn off asar packing in electron-builder, the rest should work. I am using
electron-builderprogrammatically so I am just settingasarto false in build options. @develar is there a cli switch for that?pauliusuza commentedon Jan 11, 2017
@develar it's checking for package.json and index.js files, so if I simply point it to a folder with asar files the build step fails.
develar commentedon Jan 11, 2017
@pauliusuza So — you have some folder where asar files are located (
app.asaris required, no other electron files) and just want to pack it into.appor.dmgor any other electron-buidler target?Just curious — why electron-builder is not suitable to produce required asar files?
pauliusuza commentedon Jan 11, 2017
@develar yes. Mostly for flexibility - we want to separate the build process and packaging process. Asar files would be built in one CI process (which is complex and takes more time) and stored on a cdn, and packaging would run in another process on demand.
We have a use case where we need to be able to build 20-30 different apps on demand on CI re-using same .asar files, but only changing app name and branding.
develar commentedon Jan 11, 2017
Using electron-builder? Or using asar tool programmatically? I just want to understand to be sure that implemented solution will be the best solution (not workaround).
pauliusuza commentedon Jan 11, 2017
Sure, thanks.
The first step of the process would be running asar tool programmatically (through gulp or npm script) and pack the required files into .asar archives, it would then store those .asar files into a CDN. This would run on CI on each commit.
Second step would be executed on demand. It would fetch the latest .asar files from CDN, store them into a folder, apply required customization / branding, and run electron builder to pack all of this into a distributable format.
develar commentedon Jan 11, 2017
Got it. So:
asarwill be added. electron-builder will just pack your app intoapp.asar.--prepackagedwill detect — is it fully prepackaged directory (has electron files) or not.[-]Crash: app-update.yml not found when using --prepackaged[/-][+]asar target and prepackaged option support for it[/+]pauliusuza commentedon Jan 11, 2017
@develar thanks, that sounds good
pauliusuza commentedon Jan 11, 2017
So just a note for
--prepackaged /dirIf app.asar already exists in the
/dir, then it should check for existence of thepackage.jsonandindex.jsfiles inside theapp.asarfile, and not in the/dirfolder itself.5 remaining items
develar commentedon Feb 2, 2017
Asar target — if need, please open separate issue.
pauliusuza commentedon Feb 2, 2017
Sorry, this does not work.
How can i specify project directory through options and point it to a subfolder containing asar files?
Project folder contains files which should not be packaged, and there is no way to exclude them.
develar commentedon Feb 2, 2017
current working directory or set explicitly using
--projectCLI.pauliusuza commentedon Feb 2, 2017
We are using electron-builder programmatically, not through CLI - is it possible to add a config parameter for the project directory?
develar commentedon Feb 2, 2017
Set
projectDirelectron-builder/packages/electron-builder/src/packagerApi.ts
Line 11 in 60e1406
pauliusuza commentedon Feb 2, 2017
Can't get this to work.
Error: Application entry file "index.js" in the "/Users/pro/repository/test-project/dist/mac/Test Project.app/Contents/Resources/app.asar" does not exist. Seems like a wrong configuration.
Additional files in the asar folder were not copied to the Resources
pauliusuza commentedon Feb 2, 2017
Running this in cli
TypeError: Cannot read property 'directories' of undefined
at /Users/pro/repository/test-project/node_modules/electron-builder/src/packager.ts:122:68
pauliusuza commentedon Feb 2, 2017
Would it not be simpler just to ignore the app folder packaging step if a specific flag is set, so we can include the .asar files via extraFiles / extraResources?
develar commentedon Feb 2, 2017
@pauliusuza Is it possible to send me your directory with asar files to test?
pauliusuza commentedon Feb 2, 2017
@develar I will send you an email shortly
test: prepackaged asar electron-userland#1102
test: prepackaged asar electron-userland#1102
test: prepackaged asar #1102
pauliusuza commentedon 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:
yansenlei commentedon Nov 14, 2018
@pauliusuza Have you successfully build a separate app.asar?