Archive: Generate list of files and directories for uninstaller


Generate list of files and directories for uninstaller
When your installer include many files for install, it's take much time to write in uninstall section files and directories than will be deleted.

It's script to generate list of files and directories for uninstaller with command line support (/? for help)

Script used headers


Uninstaller will remove only unmodified files


Files description:
"unListDate.nsi" - List generator (unListDate.exe) script
"Test.nsi"         - Test script
"TestFiles\*.*"  - Test script files

Scripts used headers


"unList" v1.1
"unListDate" v1.1

Changes:
-Cosmetic improvements
-unList command line now based on unListDate

Scripts used headers


Thanks
I've come to the forums searching for answers a number of times since I started using NSIS. (Love it, btw.)

A number of those times, the answer (and often with useable script as well) has come from Instructor.

I registered just to reply to a particuarly useful post to say thanks.

Jess


You are welcome :)


"unList" v1.2
"unListDate" v1.2

Changes:
1. Code clean up
2. Better errors check
3. Added command line option to turn off MessageBoxes

Attachment with binaries (scripts used headers)


"unList" v1.3
"unListDate" v1.3

Changes:
-added file filter as command option (Patrick Graf)


P.S.
Patrick I could not send you reply on your e-mail.


"unList" v1.4

Changes:
-combine unList and unListDate to one script and added /DATE=[0|1] parameter (Matei "Ambient.Impact" Stanca)


Great job
Hi Instructor,

thank you from a very satisfied user of "UnList" :)

BR.


Greetings guilhem.martin, from a very satisfied developer of "UnList" :)

"unList" v1.5

Changes:
-updated to support latest version of GetOptions function


'GetTime' should be called using System time instead of local time. Otherwise all files will be ignored after the time has been changed to daylight saving time!

Two lines must be modified therefore:

${GetTime} '$9' 'M' $0 $1 $2 $3 $4 $5 $6

into

${GetTime} '$9' 'MS' $0 $1 $2 $3 $4 $5 $6


and

FileWrite $R4 `$PREFIX$3un.GetTime} "$UNDIR_VAR\$9" "M" $$0 $$1 $$2 $$3 $$4 $$5 $$6$\r$\n`

into

FileWrite $R4 `$PREFIX$3un.GetTime} "$UNDIR_VAR\$9" "MS" $$0 $$1 $$2 $$3 $$4 $$5 $$6$\r$\n`


Good point


Hi Instructor.

Thank you for this very cool tool. I know some idiots who installed really some products directly into the $ProgramFiles directory. This tool keep these idiots secure on uninstalltion.

PLEASE, Could you announce this wonderful tool on WikiPage of NSIS (http://nsis.sourceforge.net/Category:Related_Software)? Thank you very very much. :-)


Hello

For me this script occasionally neglects to uninstall a file, even though the file has not been modified. The problem occurs because two different values are returned for the file's timestamp.

When unList.exe is run, the line

${GetTime} '$9' 'MS' $0 $1 $2 $3 $4 $5 $6

returns one value for the file's timestamp.

unList.exe then autogenerates the line e.g.

${un.GetTime} "$INSTDIR\Workbooks\Math\primeNumbers.xls" "MS" $0 $1 $2 $3 $4 $5 $6

which runs as part of my uninstaller but when that line runs it returns a timestamp one second into the future, causing the subsequent test

StrCmp "$0/$1/$2-$4:$5:$6" "27/04/2006-15:02:08" 0 +3

to return false.

A quick fix is to exclude seconds from the comparison e.g. in unList.nsi change line

FileWrite $R4 `$PREFIXStrCmp "$$0/$$1/$$2-$$4:$$5:$$6" "$0/$1/$2-$4:$5:$6" 0 +3$\r$\n`

to

FileWrite $R4 `$PREFIXStrCmp "$$0/$$1/$$2-$$4:$$5" "$0/$1/$2-$4:$5" 0 +3$\r$\n`

Regards,
Eric


Hi Instructor!

I have noticed that if I ask unList to create log for empty directory then it:
1) Delete log file, that should be created
2) Doesn't create log file

Is it intension? If it is, then I have another question: Why it doesn't create empty log?