Quick Setup
UNIX: Installation
All the tools required are usually installed on a UNIX
developer machine.
If a tool is not already installed on your system, you
will typically use the installation package from your
distribution (by your favourite package manager: aptitude, yum,
synaptics, ...).
If an install package is not available, or you have a
reason not to use it (maybe because it's simply too old), you
can install that tool from source code. The following sections
will provide you with the webpage addresses where you can get
these sources.
Win32: Step-by-Step Guide
A quick setup guide for Win32 with recommended
configuration.
Warning!
Unless you know exactly what you are doing, you
should strictly follow the recommendations!
Install Microsoft C compiler and Platform SDK
You need to install:
C compiler:
Download and install "Microsoft Visual C++
2008 Express Edition SP1." (This is a very large download.)
Install MSVC the usual way. Don't forget to install
vcvars32.bat or call it manually before building Wireshark.
vcvars32.bat will set some required environment (e.g. the
PATH) settings.
You can use other Microsoft C compiler variants!
It's possible to compile Wireshark with a wide range
of Microsoft C compiler variants. For details see
!
Don't use Cygwin's gcc!
Using Cygwin's gcc is not recommended and will
certainly not work (at least without a lot of advanced
tweaking). For further details on this topic, see
.
XXX - mention the compiler and PSDK web installers -
which significantly reduce download size - and find out the
required components
Wireshark development depends on several environment variables,
particularly PATH. You can use a batch script to fill
these in, for example
Why is this recommended? While this is a huge download,
the 2008 Express Edition is the only free (as in beer)
version that includes the Visual Studio integrated
debugger. Visual C++ 2008 is also used to create official
Wireshark builds, so it will likely have fewer development-related
problems.
Install Cygwin
Download the Cygwin installer and start it.
At the "Select Packages" page, you'll need to select
some additional packages, which are not installed by default.
Navigate to the required Category/Package row and click on
the "Skip" item in the "New" column so it shows a version
number for:
Archive/unzip
Devel/bison
Devel/flex
Interpreters/perl
Utils/patch
Web/wget
After clicking the Next button several times, the setup
will then download and install the selected packages (this
may take a while).
Why this is recommended: Cygwin's bash version is
required, as no native Win32 version is available. As
additional packages can easily be added, the perl and alike
packages are also used.
Install Python
Get the Python 2.6 installer from:
and install Python
into the default location (C:\Python26).
Why this is recommended: Cygwin's Python package
doesn't work on some machines, so the Win32 native package is
recommended.
Install Subversion Client
Please note that the following is not required to build
Wireshark, but can be quite helpful when working with the
sources.
Why this is recommended: updating a personal source
tree is significantly easier to do with Subversion than
downloading a zip file and merging new sources into a
personal source tree "by hand".
Subversion
If you want to work with the Wireshark Subversion
source repositories (which is highly recommended, see
), it's recommended to
install Subversion. This makes the first time setup easy
and enables the Wireshark build process to determine your
current source code revision. You can download the setup
from
and simply
install it.
TortoiseSVN
If you want to work with the Wireshark Subversion
source repositories (which is highly recommended, see
), it's recommended to use
TortoiseSVN for your everyday work. You can download the
setup from
and simply
install it.
Install and Prepare Sources
Tip
It's a good idea to successfully compile and run
Wireshark at least once before you start hacking the
Wireshark sources for your own project!
Download sources : Download Wireshark sources into:
C:\wireshark using TortoiseSVN
right click on the C:\ drive in Windows
Explorer
in the upcoming context menu select "SVN
checkout..." and then set:
URL of repository: "
http://anonsvn.wireshark.org/wireshark/trunk/"
Checkout directory:
C:\wireshark
TortoiseSVN might ask you to create this
directory - say yes
TortoiseSVN starts downloading the sources
if the download fails you may be behind a
restrictive firewall, see
for alternative
download methods
Edit config.nmake: edit the settings in
C:\wireshark\config.nmake, especially:
VERSION_EXTRA : Give Wireshark your "private"
version info, e.g.: -myprotocol123 - to distinguish
it from an official release!
PROGRAM_FILES : Where your programs reside,
usually just keep the default: C:\Program Files
2
MSVC_VARIANT : Make sure the variant for
your compiler is
uncommented, and that all others are commented out. For example,
if you're using Visual C++ 2008 Express Edition, find the line
and remove the comment character (#)
from the beginning of the line. Then, find the line
and comment it out, by prefixing a hash (#).
1
1Compiler dependent: This step
depends on the compiler you are using. For compilers other than
Visual C++ 2008, see the table at
.
2International Windows might use
different values here, e.g. a German version uses
C:\Programme - take this also in account where
C:\Program Files appears elsewhere.
Prepare cmd.exe
Prepare cmd.exe - set environment and current dir.
start cmd.exe
call C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat
to set environment variables of Visual C++ 2008 Express Edition.
1,2
cd C:\wireshark to jump into the source
directory
1Compiler dependent: This step
depends on the compiler variant used, for other variants than
the recommended Visual C++ 2008 Express Edition see the table
at
!
2International Windows might use
different values here, e.g. a German version uses
C:\Programme - take this also in account where
C:\Program Files appears elsewhere. Note: You need
to repeat steps 1 - 4 each time you open a new cmd.exe!
Install Libraries
If you've closed cmd.exe in the meantime,
prepare cmd.exe again.
nmake -f Makefile.nmake setup downloads libraries
using wget and installs them - this may take a while
...
If the download fails you may be behind a
restrictive firewall, see the proxy comment in
.
Distclean Sources
The released Wireshark sources contain files that are
prepared for a UNIX build (e.g. config.h).
You must distclean your sources before building the
first time!
If you've closed cmd.exe in the meantime,
prepare cmd.exe again
nmake -f Makefile.nmake distclean
to cleanup the Wireshark sources
Build Wireshark
Now it's time to build Wireshark ...
If you've closed cmd.exe in the meantime,
prepare cmd.exe again
nmake -f Makefile.nmake all
to build Wireshark
wait for Wireshark to compile - this may take a
while!
run C:\wireshark\wireshark-gtk2\wireshark.exe
and check if it starts
check Help/About if it shows your "private" program
version, e.g.: Version &WiresharkCurrentVersion;.x-myprotocol123
- you might run a release version previously installed!
Tip: If compilation fails for suspicious
reasons after you changed some source files try to "distclean"
the sources and make "all" again
Debug Environment Setup (XXX)
XXX - debug needs to be written, e.g. an idea is the
create a simple MSVC workspace/project(s) to ease Visual
Studio debugging
Optional: Create User's and Developer's Guide
Detailed information to build these guides can be found in the file
docbook/README.txt in the Wireshark sources.
Optional: Create a Wireshark Installer
Note: You should have successfully built Wireshark
before doing the following!
If you want to build your own
wireshark-win32-&WiresharkCurrentVersion;.x-myprotocol123.exe,
you'll need NSIS.
NSIS:
Download and install NSIS
You may check the MAKENSIS setting in the file
config.nmake of the Wireshark sources.
vcredist_x86.exe :
Download the C-Runtime redistributable for Visual
C++ 2008 Express Edition SP1 (vcredist_x86.exe)
and copy it into C:\wireshark-win32-libs
1
If you've closed cmd.exe in the meantime,
prepare cmd.exe again
nmake -f Makefile.nmake packaging
build Wireshark installer
run
C:\wireshark\packaging\nsis\wireshark-win32-&WiresharkCurrentVersion;.x-myprotocol123.exe
and test it - it's a good idea to test also on a different machine
than the developer machine.
1Compiler dependent: This step
depends on the compiler variant used; for other variants than
the recommended Visual C++ 2008 Express Edition SP1 see the table
at !