Archive: Building NSIS


Building NSIS
I am attempting to compile NSIS. Compiling the first time is always the hardest thing for me when trying to get an open source project setup.

I downloaded and extracted nsis-2.40-src.tar

Via the links on this page:
http://nsis.sourceforge.net/Building_NSIS_from_SVN

I have installed:
Platform SDK 2003 R2 with all options checked.
SCons v1.1 (I forget what the problem was, but the older version gave me errors about it not being a new enough version, so I installed v1.1)
Python 2.5.1

I already have Visual Studio Team System 2008 SP1 installed with Microsoft Visual Studio C++ 2008 as one of the components. However, when installing I chose the C# developer profile, so I'm not sure if this would affect the build scripts ability to find what it needs.

I was going to install Visual Studio 2005 Express as well, but all roads on microsoft's website lead to Visual Studio 2008 Express.

This is my command prompt log:
L:\Development\Code\Nsis\nsis-2.40-src>scons
scons: Reading SConscript files ...
Delete("nsis-25-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
*** Couldn't find a good version of libcp.lib

L:\Development\Code\Nsis\nsis-2.40-src>

Any help would be greatly appreciated as usual.


I was going to install Visual Studio 2005 Express as well, but all roads on microsoft's website lead to Visual Studio 2008 Express.
Here's the Microsoft url: Visual Studio 2005 Express

Thanks. That seemed to do the trick. Now it can't find windows.h though. Is the script looking for it based on the include directories configuration in VS C++ Express? Or do I need to add that to the path?

Also, is this the correct version of the windows SDK that it needs?
"C:\Program Files\Microsoft SDKs\Windows\v6.1\Include"


L:\Development\Code\Nsis\nsis-2.40-src>scons
scons: Reading SConscript files ...
Delete("nsis-26-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for memset requirement... (cached) yes
Checking for C library gdi32... (cached) no
Checking for C library user32... (cached) no
Checking for C library pthread... (cached) no
Checking for C library iconv... (cached) no
Checking for C library version... (cached) no
Checking for C library dl... (cached) no
Checking for C library gdi32... (cached) no
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) no
Checking for C library user32... (cached) no
Checking for C library version... (cached) no
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\release\AdvSplash\advsplash.obj /c Contrib\AdvSplash\advsplash.c /no
logo /GS- /O1 /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS
advsplash.c
Contrib\AdvSplash\advsplash.c(4) : fatal error C1083: Cannot open include file:
'windows.h': No such file or directory
scons: *** [build\release\AdvSplash\advsplash.obj] Error 2
scons: building terminated because of errors.

L:\Development\Code\Nsis\nsis-2.40-src>SET INCLUDE=%INCLUDE%;C:\Program Files\Microsoft SDKs\Windows\v6.1\Include

L:\Development\Code\Nsis\nsis-2.40-src>scons
scons: Reading SConscript files ...
Delete("nsis-26-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for memset requirement... (cached) yes
Checking for C library gdi32... (cached) no
Checking for C library user32... (cached) no
Checking for C library pthread... (cached) no
Checking for C library iconv... (cached) no
Checking for C library version... (cached) no
Checking for C library dl... (cached) no
Checking for C library gdi32... (cached) no
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) no
Checking for C library user32... (cached) no
Checking for C library version... (cached) no
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /Fobuild\release\AdvSplash\advsplash.obj /c Contrib\AdvSplash\advsplash.c /no
logo /GS- /O1 /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS
advsplash.c
Contrib\AdvSplash\advsplash.c(4) : fatal error C1083: Cannot open include file:
'windows.h': No such file or directory
scons: *** [build\release\AdvSplash\advsplash.obj] Error 2
scons: building terminated because of errors.


I've used the Windows SDK Configuration tool to set me version to 6.1. I've added ""C:\Program Files\Microsoft SDKs\Windows\v6.1\Include" to the Include paths in Visual Studio 2005.

I've also tried running scons from the the Windows SDK command prompt, the VS 2005 command prompt, and the VS 2008 command prompt.

What is the method scons uses to search for includes?


I've never tried to compile NSIS and I don't have SCONS, so I don't know the answer to your questions about the SDK version and how SCONS includes are set up.

Don


Originally posted by AaronLS
L:\Development\Code\Nsis\nsis-2.40-src>scons
scons: Reading SConscript files ...
Delete("nsis-26-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
...
Hello,
I am also trying to compile this sources... But, dont know why, Scons can't be found. So, I dont see this:
"scons: Reading SConscript files ...".
Could you write here what did you do to compile it (try to compile)?
I mean, what programs did you installed (versions), what environments path did you add, etc...
I am looking for a simple description how to build this sources on Windows (XP) platform. I wanted to translate NSIS to my language (program + docs), but It is impossible without possibility to build it... (have to say, that there was time I did it, with NSIS 2.23 version... and now I cant do it, don't know what am I doiing wrong).

Ps: Kichik, maybe you will find some time to write some simple guide?

Regards,
-Pawel

I installed these things:
Platform SDK 2003 R2 with all options checked.
SCons v1.1
Python 2.5.1
Visual Studio 2005 Express

I was following this guide:
http://nsis.sourceforge.net/Building_NSIS_from_SVN

It seems my issue might be related to this, but not knowing much about python or scons, I'm not sure how to work around it.
http://www.nabble.com/Installing-Win...d15966956.html

I may just need to setup a virtual machine for the build.


Pepe, also, after installing Python and Scons, you have to add them to your PATH environment variables. Somewhere under the Python directory there is a subdirectory with a scons batch file in it. You have to add that path to your "PATH" environment variable.


I think I figured out the problem. I installed the "Windows Server 2008" version of the paltform SDK accidentally. The download page for the 2003 version has a "Web Install" link that I clicked and it downloaded the 2008 version, because I didn't read he note next to the link saying it was for 2008 because it "superceded" the 2003. If I had been paying attention I would have seen the correct version was at the bottom of the page.

I'll know for sure if this was it after I get the virtual pc setup.


Bah, that didn't do it. Still the same windows.h error.


Originally posted by AaronLS
Pepe, also, after installing Python and Scons, you have to add them to your PATH environment variables. Somewhere under the Python directory there is a subdirectory with a scons batch file in it. You have to add that path to your "PATH" environment variable.
Could you write it more detail. What directory?
What is this path exactly.
And to run compilation we are going to main folder of NSIS, or NSIS source folder? (to write in console the "Scons" command).
Regards,
-Pawel

I have been running scons in the nsis source folder, where the sconstruct file is. Not sure if this is right or not.

Here's a guide on environment variables:
http://vlaurie.com/computers2/Articles/environment.htm


Originally posted by AaronLS
Here's a guide on environment variables:
http://vlaurie.com/computers2/Articles/environment.htm
Thanks, but I know what are environment variables.
I thought, you will write in this thread your variables, that you have added. Then, I could be sure it will work on my computer too.
-Pawel

The only thing that seems to have done any good is this:
C:\Python25\Scripts

I found this as well and have gotten a little further:
http://nsis.sourceforge.net/Docs/AppendixG.html

I've gotten a little further I guess, but I'm not sure if I'm setting the VCToolkitInstallDir correctly.

C:\nsis-2.40-src>set VCToolkitInstallDir=C:\Program Files\Microsoft Visual Studio 8\.

C:\nsis-2.40-src>set MSSDK=C:\Program Files\Microsoft Platform SDK

C:\nsis-2.40-src>scons MSTOOLKIT=yes
scons: Reading SConscript files ...
Delete("nsis-28-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for memset requirement... (cached) yes
Checking for C library gdi32... (cached) yes
Checking for C library user32... (cached) yes
Checking for C library pthread... (cached) no
Checking for C library iconv... (cached) no
Checking for C library version... (cached) yes
Checking for C library dl... (cached) no
Checking for C library gdi32... (cached) yes
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) no
Checking for C library user32... (cached) yes
Checking for C library version... (cached) yes
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
"C:\Program Files\Microsoft Platform SDK\bin\Win64\link.exe" /nologo /opt:nowin9
8 /map /entry:DllMain /NODEFAULTLIB /dll /out:build\release\AdvSplash\AdvSplash.
dll kernel32.lib user32.lib gdi32.lib winmm.lib build\release\AdvSplash\advsplas
h.obj build\release\AdvSplash\SHLIBEMITTER.obj
Creating library build\release\AdvSplash\AdvSplash.lib and object build\relea
se\AdvSplash\AdvSplash.exp
advsplash.obj : error LNK2019: unresolved external symbol ___security_cookie ref
erenced in function _WndProc@16
advsplash.obj : error LNK2019: unresolved external symbol @__security_check_cook
ie@4 referenced in function _WndProc@16
build\release\AdvSplash\AdvSplash.dll : fatal error LNK1120: 2 unresolved extern
als
scons: *** [build\release\AdvSplash\AdvSplash.dll] Error 1120
scons: building terminated because of errors.

C:\nsis-2.40-src>


Originally posted by AaronLS
The only thing that seems to have done any good is this:
C:\Python25\Scripts
I got this error, when I have added some variables...

C:\Program Files\NSIS\src>scons
scons: Reading SConscript files ...
Delete("nsis-28-Oct-2008.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for memset requirement... (cached) yes
Checking for C library gdi32... (cached) no
Checking for C library user32... (cached) no
Checking for C library pthread... (cached) no
Checking for C library iconv... (cached) no
Checking for C library version... (cached) no
Checking for C library dl... (cached) no
Checking for C library gdi32... (cached) no
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) no
Checking for C library user32... (cached) no
Checking for C library version... (cached) no
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /nologo /GS- /O1 /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /c
Contrib\AdvSplash\advsplash.c /Fobuild\release\AdvSplash\advsplash.obj
advsplash.c
Contrib\AdvSplash\advsplash.c(4) : fatal error C1083: Cannot open include file:
'windows.h': No such file or directory
scons: *** [build\release\AdvSplash\advsplash.obj] Error 2
scons: building terminated because of errors.

Any idea why my system cant find this file? (I have added the path to directory with this file to Visual Studio Include)
-Pawel

That was the error I was originally getting.

I isntalled the Platofrm SDK for Windows 2003 and C++ 2005 Express, then followed the direction from the link above. Here it is again:
http://nsis.sourceforge.net/Docs/AppendixG.html

The specific steps from that page I followed was to run these three commands:
set MSSDK=C:\Path\To\Platform SDK
set VCToolkitInstallDir=C:\Path\To\VCToolkit
scons MSTOOLKIT=yes

Where C:\Path\To\Platform SDK is something like C:\Program Files\Microsoft Platform SDK\, you'll have to browse around for it.

I don't know what VCToolkitInstallDir is supposed to be set to. I tried setting it to my VS C++ 2005 isntall directory.

I now get the linking errors above. I also tried the parameter to skip all plugins, and it gets alot further, but eventually I get the same link error again.


VCToolkitInstallDir is only for the very old and probably no longer available VC Toolkit. I use it to build the nightly build because it's a standalone version which doesn't require the GUI and runs fine on WINE. For Visual C++ Express, it should just work once you properly install the latest Platform SDK. Missing windows.h means you haven't properly installed and configured Platform SDK.


Yes, you are correct, the Windows.h error was because I was installing the wrong 2008 platform SDK instead of the 2003 version. I've gotten past that, but haven't been able to proceed beyond the error "advsplash.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _WndProc@16"

I have tried this on a couple different setups on clean WinXP virtual machines.

I will verify this evening, but I think if I don't set VCToolkitInstallDir then I get an error about it not being set. These are the commands I am using:

C:\nsis-2.40-src>set VCToolkitInstallDir=C:\Program Files\Microsoft Visual Studio 8\.

C:\nsis-2.40-src>set MSSDK=C:\Program Files\Microsoft Platform SDK

C:\nsis-2.40-src>scons MSTOOLKIT=yes

I have also tried:
set VCToolkitInstallDir=C:\Program Files\Microsoft Visual Studio 8\VC\.

Edit: Also I have tried the option to skip compiling plugins, but I still get the same error on a different obj file.


Again, VCToolkitInstallDir is only for VC Toolkit and should not be used for Visual C++ Express 2008. Platform SDK 2003 is also very old and you should install the latest to make sure it works best with Visual C++ Express 2008. Once you get SCons to properly recognize you're using 2008 version by not using VCToolkitInstallDir, it'll automatically add /GS- which should disable the security cookie.


Thanks. I was getting the link error using VS C++ 2005(not 2008) with the Windows Server 2003 platform SDK.

I will try 2008 C++ Express with the Windows Server 2008 Platform SDK. I'm not sure if scons supports this yet though, because I saw some others having issues with the 2008 Platform SDK because the directory structure has been changed around.