Hi all - first off, thanks for all the hard-work and effort in creating a fantastic installer package. I love it!
I'm working on an installer that makes numerous calls to a .DLL that I've written that contains a lot of proprietary stuff. I've extracted the .DLL into the PLUGINSDIR, in hopes that when the installer dies, the .DLL disappears.
After running various tests - the .DLL still remains in the PLUGINSDIR after the installer has exited.
Is it possible there is an open file handler to the .DLL prior to the "DELETE PLUGINSDIR" call?
How can I ensure the handle is released prior to the folder being removed?
I've seen some code-snippets while searching the forum - I've tried a few, but I'm not having any luck - what do you recommend?
I believe one call I was using was System:Free 0 or something along those lines (sorry, dont have the code handy).
Suggestions?
.DLL Call/PLUGINSDIR - File wont delete on Installer Exit.
5 posts
Try changing the working directory to something other than $PLUGINSDIR with SetOutPath. However, if the dll remains then it sounds like a problem with the dll. Can you manually delete it after calling it?
Stu
Stu
Originally posted by Afrow UKI never really change to the PLUGINSDIR in my script, but I took your suggestion and did a SetOutPath to $TEMP for kicks at the end of the script to see what that would do... MySetup.DLL remained in the plugins dir - the rest of the files that were used by the setup.exe disappeared.
Try changing the working directory to something other than $PLUGINSDIR with SetOutPath. However, if the dll remains then it sounds like a problem with the dll. Can you manually delete it after calling it?
Here's the jist of what I'm doing, some code removed:
Does "System" have a handle on that .DLL that hasn't been released?
; Initialize our plugin directory
InitPluginsDir
File /oname=$PLUGINSDIR\MySetup.DLL "${CLIENT_INSTALL_PATH}\work\Utilities\MySetup.dll"
System::Call '$PLUGINSDIR\MySetup::Function1(t "$INSTDIR", t r0r0, i r1r1 ) i .r2'
System::Call '$PLUGINSDIR\MySetup::Function2(t "$INSTDIR", t r0r0, i r1r1 ) i .r2'
System::Call '$PLUGINSDIR\MySetup::Function3(t "$INSTDIR", t r0r0, i r1r1 ) i .r2'
SetOutPath "$TEMP"
I tried to Delete the .DLL after one of the calls - it wouldn't go anywhere.. am I missing something?
add "?u" at the end of the last call
Originally posted by AndersThat did the trick.. Is there a single call that will tell "System" to release the/all the handle(s)?
add "?u" at the end of the last call