Archive: Log File Name


Log File Name
Hi Readers.

I'm a beginer using NSIS.
It's seems very easy to use, but I've got a small problem.

In the script I use :
File /r C:\whatever\mydir\*.*

Files number and name can change in this folder.

When the user will unInstall the software I want to UnInstall my files.
The more easy for me is to log the name of those files.

I was thinking to make something like:
-File /r C:\whatever\mydir1\*.*
-names are logged in a file in a section MyDir1

-File /r C:\whatever\mydir2\*.*
-names are Logged in a file in a section MyDir2

When I will Uninstall I just need to read this logfile.
Is there a easy way to do this ?

Thanks U for your help.

BR.
David.


David,

welcome! Are you sure logging is the best solution? Why not deleting the entire installation directory (using wildcards). Doing it that way, you will not need to know which files where installed. So do:
Delete $INSTDIR\*.*

Is this helping or do you still want to log?

Good luck,
-Hendri.


Log
Thanks for your answer.
But yes I still want to log.

In fact my installation is a kind of patch of a software.
But I don't want to list manually all the folder (It's possible but it's a pain...).
If you know a way to logged just a part it's better.

I find out a 2nd way, to include the same folder in the Uninstaller, to extract that in a temp folder, and to make a findfirst, findnext in the temp folder and erase the same file in the normal folder installation.
The problem is the uninstaller is a quite bigger than it should.


Thanks for your support.


David.


David,

if you use NSIS 1.97 use the commands LogSet and LogText to log to install.log. This is the best way to log. It's also possible by using FileOpen and FileWrite, but might be more cumbersome.

Good luck,
-Hendri.