-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
sqlite3 db-file is not found within app.asar #1474
Comments
Please use extraResources https://github.com/electron-userland/electron-builder/wiki/Options#Config-extraResources |
thanks for the hint, but it seems to be not very handy... i end up here:
and here: const dbFile = path.join(__dirname, '/appData.db').replace('/app.asar', ''); hmmm... |
Update: add examples to doc. |
Did it work? |
as mentioned above, it works only if i toggle the path like here: I stopped testing here as I switched to a completely different setup using pouchdb... cheers, jo |
Fix on electron side is required. https://www.npmjs.com/package/hazardous |
cool, thanks :) |
"extraResources": ["appData.db"], Worked for me!!! |
hi evryone |
thanks buddy, worked for me |
Worked for me too |
I used it that way, and everything worked out fine. //########################################## const Path = require('path') const config = { |
happy easter,
Trying to create a build for mac osx, also working on a mac.
This is a part of my package.json to show what i use (based on electron-boilerplate-sqlite):
This is how i set the path to the db-file
const dbFile = path.join(__dirname, '/appData.db');
In the build the path is like this:
/Users/[USERNAME]/[PATH-TO-CONTENT]/Contents/Resources/app.asar/app/appData.db
... and I end up with an error:
SQLITE_CANTOPEN: unable to open database file
Now setting asar to false in the build-options. The path is now like this:
/Users/[USERNAME]/[PATH-TO-CONTENT]/Contents/Resources/app/app/appData.db
The app works fine.
How can i solve this problem?
regards, jo
The text was updated successfully, but these errors were encountered: