Closed justijndepover closed 7 years ago
Probably it is packed into asar and cannot be accessed externally. Please use https://github.com/electron-userland/electron-builder/wiki/Options#BuildMetadata-extraResources (see #751).
Is it also possible to add a rule in my package.json build to unpack the file?
"asar.unpack" : "/app/*/document/*.pdf",
The files are located as following:
/app/nl/document/jaydess-notice.pdf
/app/nl/document/mirena-notice.pdf
/app/fr/document/jaydess-notice.pdf
/app/fr/document/mirena-notice.pdf
Excuse me if I ask stupid questions but i don't really understand the asar packaging.
@justijndepover Please do not use asar.unpack
. It is supported, but I strongly advice you to use more smart and more user-friendly extraResources or extraFiles
.
e.g.:
"build": {
"extraResources": "app/*/document/*.pdf"
}
Please see https://github.com/electron-userland/electron-builder/issues/751#issuecomment-247590609
Thanks, that worked!
Solution — pdf
files should be not packed to asar automatically.
Inside my app I have a link to open up an external pdf file. For this to work properly I send a message with IPC from my render process to my main process.
inside my main I have
inside my render process i have
When i use
npm start
to run my application everything works fine. But when i build my app with electron-builder nothing happens when I try to open the file. No errors show up in my console. Am I doing something wrong with my paths? Or could it be that the electon-builder does not include the pdf's to my package? They live inside myapp
directory