[Gpg4win-devel] Kleopatra sometimes fails to load with Dll Errors (Possible Solution)

Andre Heinecke aheinecke at intevation.de
Tue Oct 8 19:39:51 CEST 2013


Hi,

If you have problems launching Kleopatra because you get some errors 
like "Could not find entry point in Library XY" or some such dll errors we 
think that we found a solution.
Under:
	http://files.gpg4win.org/kleopatra-tmp/kleowrap.exe

You can find an updated wrapper that you can use to replace the old wrappers 
for kbuildsycoca4.exe and kleopatra.exe in "<Program Files>\GNU\GnuPG"

Just download it, verify the signature, or that the checksum matches:

SHA1: d7eba342596f6476a5799e8b2bd2a9d67ea8c8aa  kleowrap.exe

And replace the kleopatra.exe und kbuildsycoca4.exe with that executable (You 
have to rename it, of course)

You should now no longer get those incompatible DLL errors.


Long Story:
kleowrap.exe is a small wrapper Program that calls CreateProcess to launch a 
Program that has the same name, but is placed in the \bin subfolder. Before 
launching this other process it sets the working directory to it's 
installation location e.g. "<Program Files>\GNU\GnuPG" this is done so that 
the Windows Loader can Pick up the libraries (DLL's) in that folder. 
KDE Software (like Kleopatra) expects that it lives in a \bin subdirectory and 
it searches all other files (such as icons or help) based on that assumption, 
while for Gpg4Win all libaries are placed in the GnuPG directory. Making this 
wrapper neccessary.

Now this usually works (and originally always worked), but since Windows XP 
Service Pack 2 the default is no longer to search the working directory 
before the system paths because of security concerns. Those security concerns 
are not really relevant for us because we explicitly set the working 
directory in the wrapper before calling the actual executable.

We did not notice this change. (Yeah it's been quite some time ;-) )

The impact of this was that now for example an incompatible QtCore4.dll, 
installed by some bad software into c:\windows\system32, is preferred to the 
one in our directory, causing Kleopatras startup to fail.

We'll package a solution for this problem in the next Gpg4Win release (which 
might take some time so I've decided to let you know about this beforehand) 
at which point we will remove the kleopatra-tmp folder.

The modified sourceode kleowrap.c lies next to the exectuable. The only change 
to the released version is the SetDllDirectory (pgm); in line 339.


Regards,
Andre

-- 
Andre Heinecke |  ++49-541-335083-262 |  http://www.intevation.de/
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.wald.intevation.org/pipermail/gpg4win-devel/attachments/20131008/26a92a95/attachment.sig>


More information about the Gpg4win-devel mailing list