Compiling NSIS to add Logging
I am new to NSIS and have really liked the product so far. My problems did not start until I tried to add the logging feature to the product. Reading through the documentation I found that I needed to install Python and SCons. I downloaded the latest of each. I had to back off of the latest version of SCON because of some problems and ended up with version 0.96.91 (I could not use 0.96.92, don't remember the problem, but going back to 0.96.91 fixed it). I have VC++ 6.0 installed, but realized I needed a new version of the VC++. The only one available from Microsoft was the VC++ Express 2005. So I downloaded and installed it. Then I started getting errors about Unresolved Symbols. I fixed that issue by setting up the Environmental variables MSSDK and VCToolkitInstallDir=c:\Program Files\Microsoft Visual Studio 8/VC directory.
The next issue I ran into when running the scons MSTOOLKIT=yes command was the cl.exe had a missing module. It could not find mspdb80.dll. I found the file in the C:\Development_Tools\Microsoft Visual Studio 8\Common7\IDE directory. That directory was in the PATH environmental variable but still was not able to find it. I ended up copying that file to the System32 directory.
I also had a problem where I would get an error saying that a good copy of the libcp.lib file could not be found. I had to go into the ms file in the SCon/Config directory and comment out the lines that looked for a copy of the libcp.lib file. I was then able to get past that error.
The next problem I ran into was unresolved errors for symbol __security_cookie and __security_check_cookie. Through more searching on the web I determined that I needed to include the bufferoverflowU.lib in the link statement for certain modules. I finally figured out that I could add the file to the list of libs in the SConscript file in the directories of the modules that were getting the error.
I seem to be moving forward, but after 2 days of working with the app it seems a little excessive to simply add logging to the NSIS installer. Once I am able to get it to compile it is still not clear to me how I actually on the Logging feature. The help files says that "NSIS_CONFIG_LOG must be set in the cmpile configuration file (config.h) on compile time(it is not by default)". I don't know if that means I need to edit the config.h file or if I need to edit some scon file so that it includes a define switch when compiling the software. I ended up editing the SCons/config.py file from:
cfg.Add(
BoolOption(
'NSIS_CONFIG_LOG',
'enables the logging facility. turning this on (by uncommenting it) adds about 4kb, but can be useful in debugging your installers.',
'no'
)
)
to this
cfg.Add(
BoolOption(
'NSIS_CONFIG_LOG',
'enables the logging facility. turning this on (by uncommenting it) adds about 4kb, but can be useful in debugging your installers.',
'yes'
)
)
Is that what I need to do to turn on logging?