Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

keytar.node is not a valid Win32 application and other errors #153

Closed
AstroGD opened this issue Jan 30, 2019 · 12 comments
Closed

keytar.node is not a valid Win32 application and other errors #153

AstroGD opened this issue Jan 30, 2019 · 12 comments

Comments

@AstroGD
Copy link

AstroGD commented Jan 30, 2019

Hey guys, I am encountering the following error:

I am trying to make an electron application using keytar.

Installing the module and then Packaging the App results in this error even when the app is not packaged: A dynamic link library (DLL) initialization routine failed.

I tried running prebuild-electron - no fix.
To fix this issue I needed ro run .\node_modules.bin\electron-rebuild -w keytar -p -f first and then I am able to test my program without packaging it.

Packaging it leaves this error:
image

Then I tried npm run prebuild-electron-ia32 with success.
Trying to run the application without packaging it results in this error: Error: \?\Filesystem\Dev\Electron\Proxy\app\node_modules\keytar\build\Release\keytar.node is not a valid Win32 application.

Packaging it then results in the following: Program works as intended except the keytar part (Storing, deleting and reading the credentials) does not work. It does not give an error or something, it just doesnt work...

For packaging I am using the following command:
electron-packager . --overwrite --asar --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out="../release-builds" --version-string.CompanyName="Author" --version-string.FileDescription="Description" --version-string.ProductName="Name"

I tried everything I could searching in older issues for a solution, but I could not find one.
Do you know what could have happened and how to fix it?

Thanks for helping

@shiftkey
Copy link
Contributor

@AstroGD which version of Electron are you using?

@AstroGD
Copy link
Author

AstroGD commented Jan 30, 2019

3.0.10

@AstroGD
Copy link
Author

AstroGD commented Jan 30, 2019

Ah I see - Theres a major update out that I didn't notice. I'll install this update and try if it works then

@AstroGD
Copy link
Author

AstroGD commented Jan 30, 2019

Okay does not seem to help at all. Im now at Electron Version 3.1.2 - Version 4. seems not to work atm

@AstroGD
Copy link
Author

AstroGD commented Jan 31, 2019

@shiftkey I got my Application now running on Electron 4.0.3 - Still not working

@shiftkey
Copy link
Contributor

It's really hard to say what's happening without a runnable example, but I suspect something is incorrectly choosing a 64-bit version of the binary and the 32-bit OS is not able to run it.

@AstroGD
Copy link
Author

AstroGD commented Feb 1, 2019

Im preparing a runnable example. It just needs some time. Will send it asap

@rvanmil
Copy link

rvanmil commented Feb 6, 2019

I'm seeing this problem too with the electron-builder packager. This is probably happening because of the ABI issues with Electron 4.
My guess is when you use Electron 4.0.4 and keytar 4.3.3 this problem will go away. The only thing missing right now is the prebuilds for keytar 4.3.3 so we can package Electron apps for different architectures than the machine you're running the packager on.

@rvanmil
Copy link

rvanmil commented Feb 6, 2019

As I expected this issue has now been fixed in my case.

@AstroGD
Copy link
Author

AstroGD commented Feb 6, 2019

Testing that on my app tomorrow. Runnable example did encounter some unexpected issues - Still trying to get that done

@AstroGD
Copy link
Author

AstroGD commented Feb 7, 2019

Oh my god finally - Its now working as intended! Thank you very much for sharing your solution @rvanmil
But I needed to take additional steps to make my project working:

1.: Im running at keytar 4.4.0 and electron 4.0.4
2.: I needed to go into the keytar modules package.json and change the prebuild electron script to this: prebuild -t 4.0.4 -r electron --strip (One of the other versions threw an error when running the script)
3.: I needed to rebuild the package with npm run prebuild-electron (In the folder of node_modules/keytar)
4.: I packaged the app for Windows x64
5.: Tested it and it finally worked

I dont know what caused the errors but finally I have a finished and working App.
To make it easier for other people to find a solution I whish you could make a FAQ or Wiki for those errors as it took me now over 2 Weeks to find a solution.

And maybe you should remove some electron versions from your prebuild command as one is clearly not working and I am getting the following error:
"C:\Users\lukas.node-gyp\iojs-1.8.0\x64\iojs.lib : fatal error LNK1106: Ungültige Datei oder Datenträger voll: Positionieren auf 0x280166 nicht möglich. [C:\Users
lukas\Filesystem\Dev\Electron\Proxy\app\node_modules\keytar\build\keytar.vcxproj]"

Which translates to: "Invalid file or disk full: positioning to 0x280166 not possible"

So I guess this issue can now be closed?

@AstroGD
Copy link
Author

AstroGD commented Feb 10, 2019

So Im closing this now as in my case my initial problem has been resolved. Thanks to everyone for the help

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants