Archive: delete problem, please help.


delete problem, please help.
Hi !

I am in a great trouble as I can not fix a last issue with my installer for a month now, and this is my last hope.

Fact details :

- I am using NSIS 2.0
- I had created nsis script for a ToolBar aI had created.
- Everything is perfect, except that in case Uninstall, the installation directory not deleted, most probably because of the unregistered DLL.
- Because of the toolbar speciality, I have to remove all files instant, no reboot or mark for reboot is possible.
- I tested the dll, and it is perfectly possible to delete manually, so I am suer I am doing something wrong in my script.
- What am I doing : search and close all IE instances, unregister the dll, and delete the hole folder.
- I pleaced enough Sleeps as well at least I believe.

Here it is :

;-----------------------------------------------
Section "Uninstall"

SetAutoClose false
SetOutPath $INSTDIR
SetDetailsView show

loop:
FindWindow $0 "IEFrame"
IntCmp $0 0 done
IsWindow $0 0 done
System::Call 'user32::PostMessageA(i,i,i,i) i($0,16,0,0)'
Sleep 200
Goto loop
done:

Sleep 2000

UnRegDLL "$INSTDIR\toolbar.dll"

Sleep 2000

RMDir /r "$INSTDIR"

Sleep 2000

DeleteRegKey HKCU Software\Toolbar6
DeleteRegKey HKLM SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MyToolbar

Exec '"$PROGRAMFILES\Internet Explorer\IEXPLORE.EXE" "http://www.sample.com"'

Sleep 2000

BringToFront

SectionEnd ;
;-----------------------------------------------

Can You help me please ?

Big thank you in advance,

Moore


So what is the result? A folder with a DLL or an empty folder?


The result is, that directory stays with vary number of files.

toolbar.dll stays, and everything under as well, and if there is any subdir, it stays as well.

Hoever, my target is to remove the hole dir with everything in it. Thats why I am using RMDir /r.

BIG THANKS FOR YOUR EFFORT, I am really lost...

Moore


Then the file is still in use by Internet Explorer or the Windows Explorer. Maybe a reboot is required, why is this such a problem?


No, the file not used at least I can delete it with File Explorer easily.

This toolbar is used on high central servers, therefore they can NOT be removed or logged off easily.

But back to the problem :

- If I can delete it manually, but NSIS cant. What can be the different ? I think nothing more than time. So is there anyway, I can wait until the file would be deleted ? As giving higher value for Sleep is not the visest idea..


Using sleep is never a good idea. But does it work if you wait a little longer?


No, it seems ony, if I delete it manually. I really dont understand it....


Are you sure all browsers are closed? Can you even remove the whole folder at once in Windows Explorer?


Yes, I can remove the complete folder as well. And yes, I am sure that all IE closed. Very strange. But I have to solve it somehow...


I have no idea but try to do:

Delete "$INSTDIR\toolbar.dll"

to find if it possible to delete the dll from the uninstaller


I have a new info.

If I close IE windows manually, the hole uninstall process working OK, the directory instantly removed !

So it seems the IE clos routine part visible closing IE windows but not practically. However tas manager dont show them...

Any idea ?


Try using SendMessage instead of that PostMessage call.


Can you correct that part of my code please ? As when I simply rewritten it to SendMessage it did not compiled.

THANKS A LOT,

Moore


SendMessage $0 16