|
|
#1 |
|
Junior Member
|
Hi everybody, I have a problem which many people here has been solving, but even after reading through lots of topics i didnt find my answer. I have this section:
PHP Code:
Now i have no idea what to do more. It looks like a bug in RMDir to me, because in official Scripting Reference is told that only $OUTDIR can block directory from being removed. And i dont want to delete it by some !system commands. Can you help me? Thanks a lot for every response. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
first off, doing SetOutPath "c:\" might not be the best thing to do, the user might not have a c: drive, do SetOutPath with $temp or $desktop
You might have a plugin or something like that with a handle open to $instdir, or if $instdir contains a COM dll or something that could be loaded in some other process. To get around all of this, add the reboot flag to rmdir IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
|
Well, i searched through my plugins - none of them is holding that path (I even tried to disable all of them - didnt help). Then i showed to myself a message window with all system registers during the uninstallation ($0, $1 .. $9, $R0 .. $R9). Not a single one has been holding way to that directory. There is a possibility that somewhere inside my program is that path pushed into stack. Is there a possibility that stack is blocking it? Or do you have any ideas what else could still hold that handle? Thanks a lot!
Backtassaar |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
just having the path on the stack or in a variable will not stop you from deleting
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2006
Location: Springfield, Virginia, USA
Posts: 45
|
In case you're still looking for a solution to this: I had the same problem, and I couldn't find any reason the empty folder could not be deleted by RmDir. After trying many things, I moved the RmDir statement to the very end of the -un.post section, so it's the very last command that executes; and that fixed it.
The only statements I had between the previous and final locations of the RmDir statement were statements deleting registry values and shortcuts. My best guess is the problem was caused by having a QuickLaunch shortcut pointing to a location that used to be inside the now-empty directory I was trying to delete. Perhaps that's what was holding on to the handle for the empty directory. -Mark |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Just a note for you people using RMDir /r on $INSTDIR (which is potentially very harmful to a user's computer).
http://nsis.sourceforge.net/Validating_$INSTDIR_before_uninstall Stu |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|