Archive: Change location of install.log?


Change location of install.log?
Hello all.

I just updated my NSIS to 2.02, then downloaded the Advanced logging special build of makensis.exe so I could use the LogSet feature and get an install log. All this went fine.

My problem now is that I would like to change the target file for the log info from $INSTDIR\install.log to something else. Is this possible? Thanks.


Something like the following should allow you to change the directory (to $TEMP in this case), but install.log will stay:

Function .onInit
Push $INSTDIR
StrCpy $INSTDIR $TEMP
LogSet on
LogText "log started"
Pop $INSTDIR
FunctionEnd

kichik, that’s excellent, thanks so much.

One other question, can I add a date and/or time stamp to the log file? That way when the user runs the next update in the future, and it appends, I can see when it was run? Thanks.


You can use the NSISdt plug-in from the Archive downloads page to get the current date and write that to the log using LogText.


Thanks again, the NSISdt plug-in works very well.