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
Getting path to asar.unpacked #6262
Comments
FWIW, I ended up just doing I see edge-cs is doing the same thing to load binaries: anaisbetts/edge-cs@686758a Just felt like I might be missing an API to get the path of a file without having to care if it's in an unpacked asar. |
Yeah, this is the way many apps convert to raw file paths. There should probably be an API (or better docs) added for this since it is a common case when you need the actual path on disk |
Hello, this problem should be fixed directly with the When doing something like |
My workaround for this problem: https://github.com/epsitec-sa/hazardous |
@Skywalker13 Does it affect performance? |
I've optimized as much as possible (I use a cache in hazardous) but yes, it affects a little bit the performances when bootstrapping the app (it's not magic, when hundred In order to be sure to keep very good performances, it's a good idea to avoid adding all You can easily test |
@Skywalker13 thanks, I agree with @kevinsawicki, electron should provide an API to do the path translation, so |
@pmoleri you're welcome |
@Skywalker13 thank you! Worked for |
@rameerez you're welcome ... |
@Skywalker13 Thank you so much, I truly believe that’s how it should work natively! Hazardous saved my life. |
you're welcome |
@Skywalker13 -- you saved me a headache! ps - getting something out of node_modules and out of asar worked for me thus: electron-userland/electron-builder#390 (comment) |
Given the conversation above, it appears that the actionable issues in this have been addressed. In that event, i'm going to go ahead and close this, but please feel free to @ me if something else arises! |
for future reference. |
Hazardous is broken since electron >= v2 |
I look forward to your continued maintenance to the latest version of electron. |
This is really rediculous. The files in asar.unpacked should be prior to the ones in asar. |
My app is using node-notifier to create toaster notifications in windows 10. Node notifier eventually ends up calling an exe file with some parameters. One of the parameters I'm passing in is a path to a .png to use as an icon in the toaster. However, when I package my app up in an asar, the icon doesn't display. I believe this is because it doesn't have an understanding of how to read the asar. So then I added the .png to an unpacked folder. However, I don't know how to get the "real" path to the unpacked asar folder. I'm using
path.join(app.getAppPath(), 'assets/img/my.png')
, which gets translated toC:\Users\kyle\Documents\Github\project\pack\v0.36.12\win32-x64\resources\app.asar\assets\img\my.png
, which is almost correct, I just need it to be app.asar.unpacked.The text was updated successfully, but these errors were encountered: