Closed ThomasKranitsas closed 5 years ago
What version of electron are you using?
"electron": "^2.0.2"
@MatteoMeil any update here?
I built a project time ago with an older version of Electron (1.x) and all went well. These days I haven't so much time but as soon as possible I'll try with newer version
Please give it a try once you find some time. This is a blocker for me. Thanks!
same problem here :(
Hi @MatteoMeil, did you have time to look into that?
@ThomasKranitsas
Slightly hacky fix, but a fix nonetheless for us was to alter the following in src/windows_printer.js:
var dllPath = fs.realpathSync(__dirname + '/../lib/windows/windows_printer.dll');
if (fs.existsSync('./resources/app.asar.unpacked/node_modules/node-native-printer/lib/windows/windows_printer.dll')) {
dllPath = fs.realpathSync('./resources/app.asar.unpacked/node_modules/node-native-printer/lib/windows/windows_printer.dll');
}
And then adding the --asar.unpack=*.dll
flag instead of --asar=true
in our electron-packager command.
It's not perfect, but it now runs as expected in both our live and dev builds and hopefully helps someone else out.
I'm sorry for this long period of absence due to a lot of work and study.
I took a look around and I manage to understand that this problem is releated to edge.js and every other fork (see this issue).
So, getting ideas from @ChrisWeaver1's comment, I will add a flag to correctly get the path in production.
After building my electron app using
electron-builder --win --ia32 --x64
, running the installed executable throws aCould not load windows_printer.dll. File could not be found
error.I can see the
windows_printer.dll
file in theAppData\Local\Programs\<APP NAME>\resources\app.asar.unpacked\node_modules\node-native\printer\lib\windows
Am I missing any step? Any ideas?