Nmap Development mailing list archives

[PATCH] RE: [PATCH] RE: Zenmap Build Guide


From: "Rob Nicholls" <robert () robnicholls co uk>
Date: Wed, 10 Nov 2010 18:04:54 -0000

Hi David,

Sorry for the slow and rather lengthy reply, I hit an annoying issue that I
think explains the comment in the Zenmap Build Guide about GTK+ 2.16 working
on Windows 7 but not on XP. I don't think it's a GTK problem, I think it's a
"built on Windows 7" problem, which I suspect is more of a py2exe problem!

After playing with depends.exe and doing some investigative work I spotted
that py2exe was including some of my Windows 7 DLLs, which XP didn't seem to
like (and the error message logged to zenmap.exe.log wasn't very helpful).
After I told py2exe to exclude four DLLs by editing setup.py (see attached
patch) it now seems to run okay on XP and Vista (where I initially saw the
same problem).

When I tried it on a clean Vista (SP1) VM it initially displayed this
Windows error message:

The application has failed to start because its side-by-side configuration
is incorrect. Please see the application event log for more detail.

Rather oddly, it seemed to work fine on a clean Windows 7 VM, so perhaps MS
already include native support for the 2008 runtimes? I couldn't find
anything online to prove that though.

I then installed the 2008 SP1 (with ATL) redistributable hoping that Zenmap
might be happy, and it was! I suspect either Python are wrong when they say
the 2008 RTM version should be used, or (much more likely) the 2008 SP1
redistributable also installs 2008 RTM files at the same time (why else is
Microsoft's installer more than twice as large as the older version?). I
presume that means that Nmap's 2008 SP1 with ATL redistributable was sorting
out our Zenmap issues without us realising (if we'd supplied a manifest and
specific DLLs we probably would have seen it sooner).

I'll do some more digging, but we probably need to re-include the 2008
redistributable (we could probably drop down to the 2008 with ATL fix
redistributable, rather than 2008 SP1 with ATL, and halve the size of the
vcredist.exe we need to supply) or go the less elegant route of including a
manifest and the required DLLs with zenmap.exe.

A workaround might be to compile Python ourselves using VC++ 2010 (if that's
possible?) as we might be able to get away with using the same 2010
redistributable? This would mean something else for us to maintain though.

Rob

-----Original Message-----
From: nmap-dev-bounces () insecure org [mailto:nmap-dev-bounces () insecure org]
On Behalf Of David Fifield
Sent: 06 November 2010 21:24
To: Rob Nicholls
Cc: nmap-dev () insecure org
Subject: Re: [PATCH] RE: Zenmap Build Guide

On Sat, Nov 06, 2010 at 04:12:49PM -0000, Rob Nicholls wrote:
Thanks for that! I had assumed that the error message was down to what 
I'd installed, which it was in a way, but it seems it was down to the 
source code. Although the page you provided says it's a fix for Python 
2.7, it seems to fix the problem with my Python 2.6.6 based installation.

I've attached a patch that tweaks the line to say 
subprocess._subprocess.STARTF_USESHOWWINDOW in zenmapCore\NmapCommand.py.

I just committed something that tries both names, and only raises an
exception if neither of them work.

I also noticed that http://www.py2exe.org/index.cgi/Tutorial#Step52 
says we should be distributing the Visual C++ 2008 Redistributable 
(and not the SP1 version we used to install, and not the 2010 version 
that's currently in
SVN) when using Python 2.6 or above with py2exe. I'd already updated 
the Nmap installer and Visual C++ 2008 SP1 redistributable to use the 
new 2010 version, but should I look into adding the Visual C++ 2008 
RTM (with the ATL
fix) redistributable to the Nmap installer to support Zenmap?

I'm not entirely sure why no one has complained about Zenmap not 
working (I'll try the installer on a clean installation of Windows 7 
at some point to see what happens). Perhaps the VC++ 2008 SP1 
redistributable allowed Zenmap to run okay (even though py2exe claim 
SP1 is the wrong version), or people have already installed it (either 
with older versions of Nmap or for other applications). It will make 
the Nmap installer a bit bigger though :(

Is there a chance that it will work with the 2010 redistributable package?
Seeing as how we apparently were not shipping the proper package for py2exe
anyway.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Attachment: zenmap_py2exe_dll_excludes_win7.diff
Description:

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/

Current thread: