|
|
|
|
#1 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
abort function woes
I dont expect anyone to just magically know why my $INSTDIR isnt fully being deleted, I've tried moving all file handles off it before cleaning up, etc. I dont get why it leaves behind 6 directories in $INSTDIR, all empty, plus , its very odd to me that none of these directories were used or referenced or allocated a file handle etc.
the whole $INSTDIR is empty too (0 bytes total), but has a subtree still existing with these 5 directories and their relevant subdirs, it cleans up $TEMP and other install locations fine, just not $INSTDIR, as I said before I've setoutpath to somewhere other than $INSTDIR before cleaning up. any clues would be appreciated although I know someone can't just magically know, well maybe. thanks people. Function .onAbort # stale file handles would stop something being deleted RMDir /r "$CFDIR\customtags\icm" SetOutPath $CFDIR RMDIR /r "$INSTDIR" RMDIR /r $INSTDIR RMDIR $INSTDIR RMDir /r "$TEMP\${gossTemp}" Delete $TEMP\testlogin* Delete c:\adminapi.log RMDir /r "c:\inetpub\wwwroot\web" SetOutPath $TEMP FunctionEnd edit: yeah, I know theres 3 rmdirs for instdir in there but that was merely me testing stuff
|
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
What does $CFDIR contain?
-Stu |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
e:\cfusionMX7
the location of the ColdFusionMX7 install |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
In which case, SetOutPath $CFDIR will probably fail if E:\ is a CD drive because it is not a writable path.
Try using SetOutPath $TEMP. -Stu |
|
|
|
|
|
#5 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
its not the cdrom drive,
its the location of the installed CF.I place some files in $CFDIR\customtags\ but .onAbort cleans up $CFDIR absolutely fine. its just $INSTDIR that leaves behind 6 directories, with subdirs, that I didn't even use or reference in the install, very odd, I mean directories that I DID reference got deleted ok.
|
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
What happens if you try and delete the undeleted folders yourself further down in the script (with RMDir).
-Stu |
|
|
|
|
|
#7 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
let me try deleting $INSTDIR somewhere else. a minute
|
|
|
|
|
|
#8 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
I called it in my tidy function that is executed within
!define MUI_PAGE_CUSTOMFUNCTION_SHOW "FinishShow" and , it leaves the same directories behind exactly. hmm! |
|
|
|
|
|
#9 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
ah sorry , I misunderstood, I can delete the directories inside, but I'd only want to delete them onabort, as they are the actual files I'd want to install! hehe.
I'll try deleting them individually in the abort function a minute. |
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I don't mean $INSTDIR, but the highest level folder in it that wasn't deleted.
-Stu |
|
|
|
|
|
#11 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
I tried deleting the subdirs individually in my .onAbort but they dont delete.
Function .onAbort # stale file handles would stop something being deleted RMDir /r "$CFDIR\customtags\icm" RMDIR /r "$INSTDIR" RMDir /r "$TEMP\${gossTemp}" Delete $TEMP\testlogin* Delete c:\adminapi.log RMDir /r "c:\inetpub\wwwroot\web" SetOutPath $TEMP RMDIR /r "$INSTDIR" RMDIR /r "$INSTDIR\cache" RMDIR /r "$INSTDIR\icm" RMDIR /r "$INSTDIR\media" # why doesnt this delete $INSTDIR fully? # it leaves behind completely irrelevant folders that we didnt even use in the installation FunctionEnd |
|
|
|
|
|
#12 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
I've tried NSExec'ing a batchfile with:
rmdir /q/s %1 and then calling it with $INSTDIR as the parameter, but no such luck |
|
|
|
|
|
#13 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
${Locate} the remaining directories and remove them one by one :-)
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#14 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
I am thinking about that you know hehe, I've already closed the locate plugin by that point as I use it earlier in the install, but yeah, its not a bad idea at all.
|
|
|
|
|
|
#15 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
RmDir /r could cause an unwanted removal by accident.
It's better, when you know that your installation creates files/directories on target that you want to clean up, to ${Locate} them and remove them by the safe way. :-) Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#16 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
Hi, again, I've tried this and it leaves the same folders from before, there MUST be something saying that I cannot delete it, but I'm unsure as to what as I never referenced any of these dirs inside the $INSTDIR.
its funny how the subdir I make in $TEMP cleans up perfectly and I was referencing that all the way through, and running various things from that location. anyway, heres my code, I know theres an RMDIR and a Delete, I was just trying things out, seems I can't get the locate method to work for me either, I use the locate method in the same way to set file permissions for the whole subtree, so I'm stumped ![]() Function delete # callback function for locate, just delete current file Delete $R9 RMDir $R9 Push $0 FunctionEnd # custom abort function, called on setup abort Function .onAbort # stale file handles would stop something being deleted RMDir /r "$CFDIR\customtags\icm" RMDir /r "$TEMP\${gossTemp}" Delete $TEMP\testlogin* Delete c:\adminapi.log RMDir /r "c:\inetpub\wwwroot\web" SetOutPath $TEMP # why doesnt this delete $INSTDIR fully? # it leaves behind completely irrelevant folders that we didnt even use in the installation RMDir /r $INSTDIR ${locate} "$INSTDIR" "/L=FD /M=*.*" "delete" call unloadLocate FunctionEnd |
|
|
|
|
|
#17 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
if I put a messagebox in the callback function displaying $R9, I can see the files locate finds, and they are the right ones.
however, calls to rmdir and delete do nothing .. woot! (ponders to think what file handles are on the dirs, none) |
|
|
|
|
|
#18 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Please attach your script. Also, which NSIS version are you using?
-Stu |
|
|
|
|
|
#19 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
I'm using NSIS 2.16
I'd love to attach my script but I think its out of company policy ![]() sigh, it'd be nice of course if those rogue dirs would dissapear, everything else I tell to dissapear does, regardless of file handles used or whatever.
|
|
|
|
|
|
#20 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
In which case, send it to afrowuk [at] tiscali [dot] co [dot] uk
-Stu |
|
|
|
|
|
#21 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
will do, dont tell anybody though *touches nose*
|
|
|
|
|
|
#22 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
sent
|
|
|
|
|
|
#23 |
|
Member
Join Date: May 2006
Location: Devon, UK
Posts: 65
|
Sorted, I moved the locate line to near the end of the finish page, and now it seems its working perfectly, I had it in a section before obviously being activated by the MUI_PAGE_INSTFILES page, maybe a handle was getting allocated there in the middle, who knows.
anyway it works great now, so thanks everyone for looking, now onto other issues hehe!
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|