-
Notifications
You must be signed in to change notification settings - Fork 1
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
How to correctly call win-ca with app.asar? #1
Comments
Unfortunately, I have no experience with asar, but what I understand:
Nope, this is NOT permission issue. File Try patching
Folder So far, it seems to me, current version of |
I tested Now you should test it under This is fallback.js.zip to replace I think, you'd better mark |
|
Still doesn't work in asar for me. Got the same problem:
Inspecting the asar shows the Another problem is you don't expose this as a configuration property for the application - see https://www.npmjs.com/package/regedit: it exposes path to executable VBS scripts through |
Yeah, I cannot understand how this ASAR thing works at all.
This can do the trick, but I cannot test it right now. Can you patch
I don't believe one should mess with this. It is hardly the case.
As I mentioned earlier, the problem is that I don't understand how ASAR works. I believe it should work seamlessly but it doesn't. We can make some workarounds for ASAR of course (eg. to copy roots.exe to some temporary folder). But when to apply that scenario? If we are not under ASAR we shouldn't do all these stupid things. I believe ASAR should do the job. It is responsible. For me everything should just work with ASAR as if no ASAR involved. By the way, I tried to find source code of ASAR's execFile[Sync] and failed. Do you know where it is? One should rather make Pull Request to that repo, I suppose ;-) |
@vogoltsov I just published Please try it with ASAR. |
I'm using v3.2.0, and get the same error:
|
For me it works with |
Well, v3.2.1 is published with @M0rious's patch. Feel free to test and report. |
Works now for me! Thanks!!! |
I have added
require('win-ca')
at the top of the main.js file. It works fine when I am running the application from VS Code and when the modules are left unpacked. As part of the build process I am packaging electron using asar, i.e. with"build":{"asar": true}"
in package.json. When I run it this way I am getting the following error.Stack: Error: spawn path\to\electron\resources\app.asar\node_modules\win-ca\lib\roots ENOENT
at exports._errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
at onErrorNT (internal/child_process.js:374:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:607:11)
at startup (bootstrap_node.js:167:16)
at bootstrap_node.js:589:3
I believe this is due to permission issues since the file exists. I've also tried
require('win-ca/fallback')
with the same result.I also noticed app.asar.unpacked directory is also created with win-ca inside. When I try to explicitly use this, i.e.
require('path\to\electron\resources\app.asar.unpacked\node_modules\win-ca')
, I get the following error.Stack: Error: Cannot find module 'split'
My question is am I importing the package correctly given the way my app is set up? Have you run into this issue and know of a way to correctly implement?
The text was updated successfully, but these errors were encountered: