quote:
Originally posted by Matty
Well I just realized the way of doing it (I actually forgot I did this with coding Plugins I was coding in VB so I could overwrite them.)
@echo off
reloadplugins.exe
regsvr32 /u /s "C:\program files\messengerplus! 3\plugins\screenshotsender.dll"
reloadplugins.exe
del /q "C:\program files\messengerplus! 3\plugins\screenshotsender.dll"
Echo Compile the dll now.
pause
regsvr32 /s "C:\program files\messengerplus! 3\plugins\screenshotsender.dll"
reloadplugins.exe
So basically I reloaded and unregistered the dll so that it could be deleted. Something like this would need to be done so that the DLL could be deleted.
I discovered something using your method...
First I stopped the script, unregistered the dll, and deleted the dll - it worked fine.
Next time I stopped the script, unregistered the dll, and tried removing the dll from Plus Preferences - it did not work.
Then I stopped the script, left the dll registered, and deleted it - it worked.
Then I stopped the script, left the dll registered and tried deleting it from Plus Preferences - it did not work.
Finally, I stopped the script, close the WLM main window, then tried removing the script from Plus Preferences - it worked.
Thus I discovered that the dll is only locked until the WLM window is open. You can even leave WLM running, just close the main window, and the dll becomes unlocked. Unfortunately this means that unregistering a dll won't help unload a dll.
EDIT:
Here's the method I'm going to use.
Script contains the dll, but does not register it in ScriptInfo.xml.
When script is run it copies the dll to a different directory. Before doing this it checks if the dll already exists in new directory or not. It also registers the dll after copying it.
Script now uses this dll copied to a different directory. Now that this dll is in a different directory, when the script is deleted the dll in its directory won't be the one that is locked, and won't deny access.
This is the only method that I can think of to solve this problem. Hopefully as more people use dll's they'll come up with a better solution.