- NSIS Discussion
- RMDir not RM'ing as anticipated
Archive: RMDir not RM'ing as anticipated
tardo0807
10th September 2003 17:32 UTC
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
tardo0807
10th September 2003 18:01 UTC
oh yes, I also tried:
Delete "$INSTDIR"
with no luck, and the correct syntax for RmDir again with the same problem of remaining files.
Joost Verburg
10th September 2003 18:16 UTC
Are you sure the files are not in use? Can you delete them manually?
tardo0807
10th September 2003 18:28 UTC
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
Joost Verburg
10th September 2003 18:45 UTC
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.
tardo0807
10th September 2003 18:53 UTC
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"
Joost Verburg
10th September 2003 20:39 UTC
Can you really remove the files manually while the uninstaller is running? RMDir just calls a normal Windows API, like explorer does.
tardo0807
12th September 2003 16:46 UTC
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.
kichik
12th September 2003 18:54 UTC
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?
lzandman
13th September 2003 09:16 UTC
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.