Archive: Writing a log file


Writing a log file
I am trying to do something which I assume is simple, but can't find any tutorial or help on it. All I want to do is have some sort of log file that is generated on install. It implies that if I use DetailPrint messages and then use SetDetailsPrint both, I would get some sort of log file.

1) Is this correct?
2) Where is this log file?
3) Can I call the file something else and/or change the path?


From the NSIS manual :rolleyes:

4.9.12.1 LogSet

on|off

Sets whether install logging to $INSTDIR\install.log will happen. $INSTDIR must have a value before you call this function or it will not work. Note that the NSIS_CONFIG_LOG build setting must be set (scons NSIS_CONFIG_LOG=yes) on compile time (it is not by default) to support this. See Building NSIS for more information about recompiling NSIS.
People seem to hate the manual :cry:

Thanks for the help. Trust me, I went through the manual a dozen times, but couldn't find anything. Everything I found implied that SetDetailsPrint was the way to do logging, not downloading a specialized build and using LogText. Heck, if you type "logging" into the NSIS User Manual, LogSet never even comes up! I still don't even understand what SetDetailsPrint both is supposed to do.

Unfortunately, the output generated by LogText seems to be too verbose for my needs. I use the XML library which seems to generate about 300 "Jump: 224". Plus, I want to have a log file for install and un-install. I will probably just roll my own macro that writes to a file.


DetailPrint will write a line to the installer screen, that's the listbox the user will see during install. You can make the text appear right over the listbox only (textonly), you can add a new line to the listbox only (listonly), or you can add a line to listbox *plus* make that new line appear right over the listbox (both). Note that the text label right over the listbox will *always* be visible, while the listbox itself is hidden unless the user clicks "Show Details". Hope it's clear now...


I also think there is a plugin that will "suck out" the information that displayed during install. You could take that data, and write it to a file...


Thanks LoRd_MuldeR. This back and forth actually got me to a point I'm happy. I hadn't set AutoCloseWindow false, so my install/un-install messages weren't being displayed to the user long enough to be useful. I think I'm going to put everything useful into that window for now. Work on persisting the information another day.

Thanks again for the help.