Archive: RMDir not RM'ing as anticipated


RMDir not RM'ing as anticipated
Hello folks,

I've included a code snippet from my uninstall section in the hopes that one of you might quickly see what I am doing wrong.

Basically, my install directory should be gone after Uninstall. However, two .gif files and one .exe remain after using the uninstall.

This situation persists even when I attempt to delete each item one by one, with these(*) three files remaining, but the other two do get deleted.

Am I missing anything?

Section Uninstall
...code...
...
...code...
...

;tried it this way too...no luck
;Delete "$INSTDIR\############40.exe"
* ;Delete "$INSTDIR\######.exe"
;Delete "$INSTDIR\Uninst.exe"
* ;Delete "$INSTDIR\logoAnim.gif"
* ;Delete "$INSTDIR\logoStill.gif "

RMDir /r "$INSTDIR"

SectionEnd

Thanks
JP


oh yes, I also tried:

Delete "$INSTDIR"

with no luck, and the correct syntax for RmDir again with the same problem of remaining files.


Are you sure the files are not in use? Can you delete them manually?


This problem occurs even if I have just installed the application ( meaning it hasn't been run yet ) so I am very confident that the files are not being used by any programs. I was able to delete them manually. I'm still looking through old posts to try and find the reason, but I appreciate any help I can get.
Thanks
JP


And you are not opening them for something else in the uninstaller? The only thing I can think of is files being in use or invalid rights.


here is the entire uninstall code:
(sorry about the stupid hash marks...my boss would be worried if i sent out product names...so I'm using them to avoid any issues)

Push "TEMP"
Call un.DeleteEnvStr

DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\#######"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\######"
DeleteRegKey HKLM "Software\########"
DeleteRegKey HKLM "Software\LeCor\###"

WriteRegStr HKLM "Software\########" "name" "removed"
WriteRegStr HKLM "Software\Cor######" "value" "removed"
WriteRegStr HKLM "Software\######Corp" "version" "uit"
WriteRegStr HKLM "Software\LeCor\####" "version" "1.0"


Delete "$INSTDIR\#########40.exe"
Delete "$INSTDIR\######.exe"
Delete "$INSTDIR\Uninst.exe"
Delete "$INSTDIR\logoAnim.gif"
Delete "$INSTDIR\logoStill.gif "

Delete "$INSTDIR"


Can you really remove the files manually while the uninstaller is running? RMDir just calls a normal Windows API, like explorer does.


Sorry for the delay in getting back to you, I was at school all day yesterday. I just ran the installer again. When I uninstalled, I was able to delete the files in question while the uninstall splash screen was still active, so I'm assuming that it indeed allowed me to delete while in the midst of uninstalling.


Just to make sure, can you download Handle, add a message box before the first Delete instruction, run Handle when the message box shows up and make sure non of the files are listed?


Wild guess... Maybe the files are virus-infected and your anti-virus software is blocking access to them? I've had this once, although that situation didn't involve NSIS.