Archive: Compiling NSIS to add Logging


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?


http://nsis.sourceforge.net/Special_Builds

-Stu


Thanks for the reply,

It looks like what I need but I'm not sure what to do with the download. I downloaded it and unzipped it. I ran the makensis.exe and it listed options that I could use to run it. My first question is where do I need to run it from and where do I put the other files that are in the zip (i.e. the Stubs directory)? My second question is what is it suppoe to do? Does it update some configuration files so that I can build the software with the options I want enabled (i.e. logging) or does it actually build the software as well as enable to options I want by using the /Ddefine switch?


Put it in the NSIS folder of course :p
Also make sure you move the stubs folder in there too if there is one.

It enables logging when you have LogSet on set.

-Stu


SCons 0.96.92 has support for 2005, iirc. If not, the next version should have it. However, there are a few incompatibilities with our SConstruct.

If you still wish to build, stick to VC 6. That's what I use for the official releases.


Well "mwright" at least your story of issues you encountered was well written and can be of help for others who try to complete a build themselves, thanks.

Probabbly you best use the special build version for direct results ;)


Thanks for all of your replys. The special build is what I needed. I guess I should have searched more before trying to build the source. I just throught that since the help file said "NSIS_CONFIG_LOG must be set in the cmpile configuration file (config.h) on compile time(it is not by default)" the route to go was to compile up the source. Again, thanks for taking the time to help me.