Archive: Advanced Logging with Speical Builds


Advanced Logging with Speical Builds
I have looked at this link and downloaded the software. I see no information on what to expect. Should I see a install.log file? Are there special keywords to use in my script?

http://nsis.sf.net/Special_Builds


Did you see the manual ? Did you include a 'LogSet On' command?


Thanks I did see that I just did not register with me.


Can't find build with advanced logging.
I am new to NSIS. I want to enable advanced logging with the hope of reading that log file at uninstall time and using it to only remove files that were installed.

I tried turning LogSet on and got the error NSIS_CONFIG_LOG not defined.

I located a thread from 2006 -http://forums.winamp.com/showthread.php?postid=1051549 - that showed where to download special builds, including one with logging on. The Special Builds page is http://nsis.sourceforge.net/Special_Builds.

However the build with logging enabled is just a ZIP file that only contains MAKENSIS.EXE and a Stubs folder. This does not look like a 'built' program to me.

Am I missing something? The thread referenced above said I wouldn't have to build this.

Thanks in advance for your help...


Yes, I was quite annoyed that NSIS did not support logging right out of the box, when other installers do. The rationale was that it affected the size of the installer.

Plus, if you build a script with logging, you have to hack it so that it doesn't explode if you try to build your script on a system which doesn't have the "special logging build".

Seems to me it should be possible to have a single executable and a checkbox or internal flag to enable logging support such that it wouldn't affect the executable size if logging wasn't enabled. That, and a mechanism for the script to force logging on, if it is needed. For any silent installs, which are common for the work that I do, a log is a necessity.

Anyway, enough of that rant. Here is the hack in case you want log support, but don't want it to explode if you happen to have a system without the "special logging build".

!macro Logger What
!ifdef NSIS_CONFIG_LOG
LogSet "${What}"
!endif
!macroend

!macro Log What
!ifdef NSIS_CONFIG_LOG
LogText "${What}"
!endif
!macroend

This allows you to do "Logger On", and LogText "Blah", and it works if you use either build.

IMHO, I would have pushed to eliminate the special builds, just to avoid maintaining three separate executables (and probably code branches too) for every release.


WACaveman: I appreciate the error trap, but this still doesn't solve my issue. I can't seem to find the build that enables logging -- and I'm certainly not in the mood to download the source code and rebuild the project. Heck, I've only been at this for four days!

Does anyone know where I can get this build?


However the build with logging enabled is just a ZIP file that only contains MAKENSIS.EXE and a Stubs folder. This does not look like a 'built' program to me.
Those files are replacements for the files installed by the standard installer. These replacements support logging, unlike the standard files.

I now see what you mean.

However, as a newbie I'd be reluctant to unzip files over an already-installed package, never mind recompiling the whole darn thing. The hazards of open source, I guess...

Thankfully I've talked to my boss and we've come up with a simpler way to solve my problem, so I'm abandoning the whole 'log all installed files' issue.

Thanks for the input, though.


Fear not - it is simple enough. Just make sure the version you are unzipping is the same as the version which is installed, and it is easy enough to rename the original file, and stub directory in case you are worried about screwing things up. The backup is always a good idea anyway.