I have an electron app, that also operates on files in the same directory. These are not files the user selects, or files bundled inside the electron application, but I do need to reference them
for example:
- /Users/test/Documents/myapp.app
- /Users/test/Documents/example.zip
I need to know where that application is located, e.g.:
- /Users/test/Documents
But instead when test.app
is ran I get:
- /Users/test/Documents/myapp.app/Contents/Resources/app/
Resulting in errors when it tries to access /Users/test/Documents/myapp.app/Contents/Resources/app/test.zip
, or if I use a relative path, /test.zip
.
How would I reliably access example.zip in this scenario? Note that I cannot bundle it with my app, it's being placed there by somebody else, so moving it is not an option, and it's a file I'm expecting to be there.