I am sharing with the list in case someone had troubles figuring out
the process before and also to have some sort of reference. Serdar you
are invited to start from here in order to create the installer. After
you finish be sure to take the information I am sharing right now and
create a README-Windows file or something similar in the source
directory (try to use markdown for the syntax).

I am just describing the information to get a complete setup on
Windows to run Network Scanner from the source. Tomorrow I will be
investigating the installer issue if I will find a couple of free
hours.

So let's start. I am assuming you have a Python 2.7.x version
installed and that you are able to run pip to install packages (For
any further reference google is your friend). Also I am assuming that
you have C:\Python27\bin in your PATH environment variable.

Once you got this preliminary setup just open a command prompt and type:

$ pip install netifaces
$ pip install ipaddr

Those are dependencies of the network scanner.

Then download the gtk+ bundle from [1]. I have used the latest bundle
[2]. Create C:\GTK directory and extract the bundle inside it. Then
add C:\GTK\bin to the PATH environment variable. At this point you
should be able to run gtk-demo from the console.

Step 2 is to download pygtk-2.24.0.win32-py2.7.msi [3],
pycairo-1.8.10.win32-py2.7.msi [4], pygobject-2.28.3.win32-py2.7.msi
[5] from the pygtk site[6]. Be sure to get the latest versions. Then
install all of them. Now you should be able to use pygtk inside
python. To prove it run python and try something like:

import gtk
w = gtk.Window()
w.show()

If everything's ok it's the turn of mingw. Download the latest version
of mingw-get-inst from [7]. I used mingw-get-inst-20120426.exe [8]. I
installed it using the following options:

Installing:
      mingw-get
      pkginfo
      C Compiler
      C++ Compiler
      MSYS Basic System

Using pre-packaged repository catalogues (20120426).

After this you need to install git. I used github for windows just to
try it out, but I strongly encourage you to go for a command line
installation [9]. Make sure you have the git binary directory in your
path.

Before going on, Python installation needs some adjustments to handle
the new mingw installation:

- Create a file PYTHONPATH\Lib\distutils\distutils.cfg with the
following contents [10]

[build]
compiler = mingw32

- Then edit the file cygwinccompiler.py according to [11]

Now you should be ready to proceed. Start a new mingw shell from the
windows menu. Clone network-scanner and change working directory
accordingly. Fetch the submodules through

$ git submodule update --init

Then you can continue following the umit.sh file to build the deps.

You will notice an error in deps/clann Makefile. Modify the lines:

cp *.so* umit/clann/

to

cp *.pyd* umit/clann/

to skip the error.  Rember to issue the commands such as

$ find ./clann -type d -name '*' -exec mkdir -p ../umit/{} \;
$ find ./clann -type f -name '*' -exec cp {} ../umit/{} \;

Those are still needed.

Libkeybinder seems to be a X11-dependent package so you can skip it.
The others package have no problems except pypcap where you do need
pyrex. Get it from here [12]. Then modify the makefile to skip the
creation invocation of pyrex. Run it explicitly through

$ python /c/Python27/Scripts/pyrexc.py pcap.pyx

Now you have to download the devel pack of winpcap [13]. Extract the
WpdPack directory inside deps/pypcap. Then create a directory
C:\Python27\PC and copy inside it the contents of the WpdPack/Include
directory. Then issue:

$ python setup.py config --with-pcap=WpdPack/
$ python setup.py bdist_wininst

You should get an installer (msi) for pypcap in the dist directory.
Install it. May be it also good to pubblish it somewhere so we can
avoid this phase at the next release cycle.

We are almost over. Install pywin32-217.win32-py2.7.exe from [14]. Then issue

$ python bin/umit

You will notice some errors regarding libkeybinder. Comment out the
responsible lines since libkeybinder is a X11 only library that is not
portable at all.

You got Network Scanner running from the source.

Of course be sure to install Nmap otherwise it will be pointless.
Sorry for possible typos or errors but I write it down in one go.

[1] http://www.gtk.org/download/win32.php.
[2] 
http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/gtk+-bundle_2.24.10-20120208_win32.zip
[3] 
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/pygtk-2.24.0.win32-py2.7.msi
[4] 
http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pycairo-1.8.10.win32-py2.7.msi
[5] 
http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.28/pygobject-2.28.3.win32-py2.7.msi
[6] http://www.pygtk.org/downloads.html
[7] http://mingw.org/
[8] 
http://downloads.sourceforge.net/project/mingw/Installer/mingw-get-inst/mingw-get-inst-20120426/mingw-get-inst-20120426.exe
[9] http://msysgit.github.com/
[10] http://stackoverflow.com/questions/3297254/pip-mingw-compile
[11] 
http://stackoverflow.com/questions/6034390/compiling-with-cython-and-mingw-produces-gcc-error-unrecognized-command-line-o
[12] http://brl.thefreecat.org/python-pyrex/
[13] http://www.winpcap.org/devel.htm
[14] http://python.net/crew/mhammond/win32/Downloads.html

--
Best regards,
Francesco Piccinno

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Umit-devel mailing list
Umit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/umit-devel

Reply via email to