Archive: Problem building NSIS on Windows 7 64bit


Problem building NSIS on Windows 7 64bit
  Hi,

I've been successfully compiling NSIS on one machine, actually I only really want to compile my own versions of the UI exes but I've been using scons and compiling the whole thing, it's worked fine. That was visual Studio 2005 on Win XP

My new development machine however is running Windows 7 64 bit, still Visual Studio 2005, I've updated to the very latest trunk and scons but when I try to build using scons I get

BgImage.cpp
Contrib\BgImage\BgImage.cpp(154) : error C2065: 'GWL_WNDPROC' : undeclared ident
ifier
Contrib\BgImage\BgImage.cpp(391) : error C2664: 'CallWindowProcA' : cannot conve
rt parameter 1 from 'long (__cdecl *)(HWND,unsigned int,unsigned int,long)' to '
WNDPROC'
This conversion requires a reinterpret_cast, a C-style cast or function-
style cast
scons: *** [build\release\BgImage\BgImage.obj] Error 2
scons: building terminated because of errors.
I want to build a 32 bit installer, I just happen to be on a 64 bit machine, anybody got any ideas?

First off, to change the UI's you can just use Resource Hacker, no need to compile.

To get around this problem you can skip compiling the plugins (SKIPPLUGINS=all)

As far as the errors go, it does seem like there is some 64 bit stuff going on since GWL_WNDPROC should work just fine for 32 bit code.

If you still want to compile:

change oldProc = (void *)SetWindowLong(hwndParent, GWL_WNDPROC, (long)WndProc); to

oldProc= (void *)SetWindowLongPtr(hwndParent, GWLP_WNDPROC, (LONG_PTR)WndProc); 

and
return CallWindowProc(
(long (__stdcall *)(HWND,unsigned int,unsigned int,long))oldProc,hwnd,message,wParam,lParam);

to
return CallWindowProc(

(WNDPROC)oldProc,hwnd,message,wParam,lParam);

I've been unsuccessful building NSIS on anything other than XP 32 with VS2005 and the 2003 SDK. Even then I had to hack the scons script to import the correct paths from the environment.

Stu


I'm going to try the resource editor route.

Any recommendations? So far I've found Resource Hacker, XN Resource Editor and ResEdit, but I have no idea how they differ or how good they are.

Also, I'm about to do a search for it, but does anyone know how to make a bitmap the background to a dialog or a set of controls? There seems to be no explicit z-ordering of controls that I can see, so if things overlap then anything can happen.


the z-ordering is primarily based on the order the controls on a dialog resource are specified.

-daz


Originally posted by Afrow UK
I've been unsuccessful building NSIS on anything other than XP 32 with VS2005 and the 2003 SDK. Even then I had to hack the scons script to import the correct paths from the environment.

Stu
Try another scons version?

Tried 1.0 and 2.0. I had to modify the NSIS scons script.

Edit: IIRC the error was "can't open Windows.h" or along those lines so it wasn't picking up my SDK path. In the end I had to get it to read LIB from the environment to get it to build. Don't have the actual code with me mind.

Stu


Well, have you reported it on their bug tracker?


No I haven't because I haven't tried building anything else with scons so I assumed it's a problem with the NSIS scons script rather than with scons itself. Perhaps it is scons though.

This is similar to the code I had to add (taken from http://stackoverflow.com/questions/2...ws-h-and-scons):

import os
env = Environment(ENV={'PATH': os.environ['PATH']})

env['ENV']['TMP'] = os.environ['TMP']
env.AppendUnique(CPPPATH=os.environ['INCLUDE'].split(';'))
env.AppendUnique(LIBPATH=os.environ['LIB'].split(';'))
I think it was the CPPPATH/INCLUDE rather than LIB that needed to be set.

Stu

Hi, I am trying to build NSIS sources on win7 x64 with visual studio 2010 express.
(SCONS 2.1, wxWidgets 2.8.12, Python 2.7.2).

I compiled successfully NSIS Menu with wxWidgets, but when I try to do SCONS command
I got this error:


C:NSIS_ANSIsrc>scons

scons: Reading SConscript files ...
>Mkdir("build\release\config")
>Delete("nsis-14-Nov-2011.cvs")
>Delete(".instdist")
>Delete(".test")
>Using Microsoft tools configuration
KeyError: 'LIB':
File "C:\NSIS_ANSI\src\SConstruct", line 352:
envs = SConscript('SCons/Config/ms')
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.1.0\SCons\Script\SConscript.py", line 614:
returnmethod(*args, **kw)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.1.0\SCons\Script\SConscript.py", line 551:
return_SConscript(self.fs, *files, **subst_kw)
File "C:\Python27\Scripts\..\Lib\site-packages\scons-2.1.0\SCons\Script\SConscript.py", line 260:
exec _file_ in call_stack***91;-1***93;.globals
File"C:\NSIS_ANSI\src\SCons\Config\ms", line 63:
libdirs = defenv***91;'ENV'***93;***91;'LIB'***93;.split(os.pathsep)

>C:NSIS_ANSIsrc>
What is wrong with this?
-Pawel

Ps: NSIS Unicode from Jim compiles correctly...

Scons 2.1 is very recent, we have not tested with it at all (I'm using 1.2)

Why would you use 2010 to compile the ansi version anyway? I don't think it supports the older windows versions so you might as well use unicode...

You could compare the "...\Scons\Config\ms" files and merge over any changes that might be 2010 specific...


Hi Anders,
Thanks for repley. Will try with older Scons. And maybe VS 2005.
However, if I can build Unicode NSIS it seems that I don't need ANSI build anymore.
But, just wanted to try if this is possible on my machine.
-Pawel


I built it successfully. Thanks Anders.
Win7 x86, NSIS 2.46, Scons 1.2, Python 2.6.2, wxWidgets 2.8.10, VisualStudio 2008 Express (+ Windows SDK).
-Pawel