0

I have a small SWT based java application. On installation swt-win32-*.dll is installed with my application in C:\Program Files\myapp\win32.

When I looked at my application in process explorer I noticed that the dll is loaded from:

C:\Users\[Username]\AppData\Local\Temp\swtlib-32\swt-win32-*.dll 

On Windows XP it ends up in:

C:\Documents and Settings\[Username]\Local Settings\Temp\swt-win32-*.dll

Whenever I delete it from the temp folder and restart my application the dll is copied there again. The other dlls my application depends on don't show this behaviour.

Who copies the dll (my application doesn't)? What's the reason behind it?

bbuser
  • 918
  • 11
  • 33
  • 1
    This is the kind of trick that apps use to bypass UAC. Chrome uses it too. They can silently update the DLL. So can viruses. – Hans Passant Aug 08 '11 at 12:24

1 Answers1

1

I don't know Java very well, but if it's inside the JAR (or any kind of archive, really), then it has to be extracted into real file before it can be loaded (because OS provides no other supported way to do it).

Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224
  • Your are right and I am wrong. The dll is indeed in the jar and it is extracted from there. Thank you for your answer. I deleted my misguided comment in shame;-). – bbuser Aug 09 '11 at 08:24