- NSIS Discussion
- delete problem, please help.
Archive: delete problem, please help.
coolice
7th March 2004 12:48 UTC
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
Joost Verburg
7th March 2004 13:09 UTC
So what is the result? A folder with a DLL or an empty folder?
coolice
7th March 2004 13:12 UTC
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
Joost Verburg
7th March 2004 13:17 UTC
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?
coolice
7th March 2004 13:21 UTC
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..
Joost Verburg
7th March 2004 13:38 UTC
Using sleep is never a good idea. But does it work if you wait a little longer?
coolice
7th March 2004 13:40 UTC
No, it seems ony, if I delete it manually. I really dont understand it....
Joost Verburg
7th March 2004 13:41 UTC
Are you sure all browsers are closed? Can you even remove the whole folder at once in Windows Explorer?
coolice
7th March 2004 13:44 UTC
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...
Cecilio
7th March 2004 14:12 UTC
I have no idea but try to do:
Delete "$INSTDIR\toolbar.dll"
to find if it possible to delete the dll from the uninstaller
coolice
7th March 2004 15:50 UTC
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 ?
Joost Verburg
7th March 2004 17:26 UTC
Try using SendMessage instead of that PostMessage call.
coolice
7th March 2004 17:32 UTC
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
Joost Verburg
7th March 2004 19:11 UTC
SendMessage $0 16