Archive: putting a date at the top of install.log


putting a date at the top of install.log
hello, i'd like to put the current date and time into my installer.log (on the first line) when my installer finishes.

the problem with this is that i cannot use FileOpen [...] a

because that does not really append to the file, it replaces.

so instead of looking like this:

Install date: <date>
\path\to\file1
\path\to\file2
\path\to\file3

I get this:

Install date: <date>
o\file2
\path\to\file3

any plugin or NSIS patch or anything that fixes this bug?

the install.log file is very large by the way (100kb+), this replacing does not happen when the logfile is smaller.


Use FileSeek to seek to the end of the file.


but i want the text to be on the top of the file, not the end?


Then you want to prepend. Open a new file, write the new line, write the original file into it and finally copy over the new file. You could also use some functions from the Wiki or the headers like FileJoin to make the process simpler.


i'm writing to a .tmp file, and then writing the timestamp to the real file followed by writing the .tmp file into the real file.

that worked like a charm thanks