PeculiarVentures / graphene

A simple layer for interacting with PKCS #11 / PKCS11 / CryptoKI for Node in TypeScript. (Keywords: Javascript, PKCS#11, Crypto, Smart Card, HSM)
MIT License
169 stars 34 forks source link

message: "Win32 error 126" #140

Closed abdalahshaban07 closed 3 years ago

abdalahshaban07 commented 3 years ago

load ok when run in dev mod. but throw error{ message: "Win32 error 126" method: "Load" name: "NativeError" nativeStack: " at Error (native) PKCS11::Load:135 "} when build it and use app.exe

microshine commented 3 years ago

Please doublecheck path to PKCS#11 library. Looks like your application uses the wrong path.

ERROR_MOD_NOT_FOUND

126 (0x7E)

The specified module could not be found
abdalahshaban07 commented 3 years ago

i agree with you but if wrong path how work in dev mode electron .

but not work when wrap it with electron builder and generate app.exe and install it then not work like dev mode

microshine commented 3 years ago

Are you using the absolute path to PKCS#11 library?

abdalahshaban07 commented 3 years ago

let dllPath = path.join(__dirname, '../../../lib/eps2003csp11.dll') let mod = graphene.Module.load(dllPath)

microshine commented 3 years ago

Print dllPath variable. Looks like compiled app.exe uses another value for __dirname

abdalahshaban07 commented 3 years ago

ok dllpath change when build electron but i solved it