Delete Files From Log: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
No edit summary |
|||
| Line 24: | Line 24: | ||
... | ... | ||
</highlight-nsis> | </highlight-nsis> | ||
Revision as of 18:54, 14 January 2012
| Author: Namrok (talk, contrib) |
Description
I wrote a function that will read the log file written out using "Dump log to file" and delete just those files that were written, as well as any empty directories left. Just push the location of the logfile onto the stack before you run it. It will leave it there, so you could always pop it off again.
Bo: Depending on which compression you use, this might not work, because for example the lzma compressor generates log files with file entries that do not have the trailing "...100%" that this script relies on.
Bo: This script needs "Get_parent_directory" renamed to un.GetParent to work.
Boris: This script is not compatible with ZipDLL_plug-in. To use it with zipdll make the following changes:
...
StrCpy $R5 $R4 11
;MessageBox MB_OK "Filetest: $R5"
StrCmp $R5 " Extract :" ChangeFile ; Line specifies a file
...
ChangeFile:
StrCpy $R2 $R4 1024 12 ; Get the new file
StrLen $R5 $R2
IntOp $R5 $R5 - "2"
StrCpy $R2 $R2 $R5 ; trims off the the newline
Delete "$R1\$R2" ; Try to delete the new file
Goto NewLine
...