//
//  Licensed to the Apache Software Foundation (ASF) under one or more
//  contributor license agreements.  See the NOTICE file distributed with
//  this work for additional information regarding copyright ownership.
//  The ASF licenses this file to You under the Apache License, Version 2.0
//  (the "License"); you may not use this file except in compliance with
//  the License.  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

== Windows

=== Git

Checking:

 git --version

If you get any successful output, you probably don't need to do anything.

In order to install it, please download end execute the installer from https://git-scm.com/download/win[here] and make sure to have it add the git executable to your systems `PATH`.

=== LibPCAP

A special version of LibPCAP is available for Windows, which is called WinPCAP.
It is available from https://www.winpcap.org/[here].

However this is a based on a very old version (1.0) of LibPCAP and in order to read PCAPNG files we require a libpcap version 1.1.0 or greater.
A patched windows version can be found here: https://sourceforge.net/projects/winpcap413-176/
(At this location is a patched version based on libpcap 1.7.4)

So in order to install things correctly:

1. install the version WinPCP from above location.
2. Then download the patched version from the sourceforge link and unpack it somewhere.
3. After that copy bin\x64\wpcap.dll from archive to \Windows\System32
4. Copy bin\wpcap.dll from archive to \Windows\SysWOW64

After this all should be working.

=== gcc

Checking:

 gcc --version

If you get any successful output, you probably don't need to do anything.

On windows we will be using something called WinBuilds, which is sort of a package consisting of a typical build environment consisting of multiple build tools. So please look at the WinBuilds chapter at the end of the Windows section.

=== g++

Checking:

 g++ --version

If you get any successful output, you probably don't need to do anything.

On windows we will be using something called WinBuilds, which is sort of a package consisting of a typical build environment consisting of multiple build tools. So please look at the WinBuilds chapter at the end of the Windows section.

=== dotnet

Checking:

 dotnet --version

If you get any successful output, you probably don't need to do anything.

Usually this is already installed on Windows machines.

Download the installer from https://dotnet.microsoft.com/download/dotnet-core/3.1[here]
(Be sure to download an installer from the second column labeled `Build apps - SDK`)

=== python

Checking:

 python --version

If you get any successful output, you probably don't need to do anything.

You can get Python from https://www.python.org/downloads/release/python-2716/[here].

Make sure directory containing `python.exe` is added to your systems `PATH`.
Also make sure you restarted your IDE and or console window after changing the `PATH` settings for the changes to take effect.

=== bison

Checking:

 bison --version

If you get any successful output, you probably don't need to do anything.

For Bison, please download the Setup installer version from http://gnuwin32.sourceforge.net/packages/bison.htm[here] (When using the zip version the bison.exe couldn't find some DLL files)
It seems the official 2.4.1 version has issues when installed in a directory which's path contains spaces. Please make sure you replace the exe with a patched version form http://marin.jb.free.fr/bison/bison-2.4.1-modified.zip[here]
(More infos on this issue https://sourceforge.net/p/gnuwin32/bugs/473/[here])

It seems there are issues if these tools are installed in paths with spaces.
So if it is for example installed in the 32 bit `Programs (x86)` directory, the build will probably fail.

Make sure all tools `bin` directories are added to your systems `PATH`.
For tools like OpenSSL be sure to add the directory containing the `openssl.exe` (Usually the root directory).
Also make sure you restarted your IDE and or console window after changing the `PATH` settings for the changes to take effect.

=== flex

Checking:

 flex --version

If you get any successful output, you probably don't need to do anything.

Please download the Flex compiler from http://gnuwin32.sourceforge.net/packages/flex.htm[here] (Ideally download the binary zip distribution)

Make sure it's `bin` directory is added to your systems `PATH`.
Also make sure you restarted your IDE and or console window after changing the `PATH` settings for the changes to take effect.

=== WinBuilds

He have tested WinBuilds with the bundle found http://win-builds.org/doku.php/download_and_installation_from_windows[here].

WARNING: Please use the installer. When using the zip distribution and manually adding that to the `PATH` the build will fail without a log output as some binaries can't find some of the DLL files.

WARNING: When installing in virtual machines. Make sure to run the installer from a path referring to a local hard-disk `C:`, `D:` ... when using Paralells the location of the `Downloads` or `Desktop` is a shared directory on your Mac.

WARNING: When installing in virtual machines. Please *don't* install to any of Windows' `Program Files` directories. Strange things will happen.

When running the installer, make sure to select the options:
- Native Windows
- x86_64
Not quite sure which elements are really needed, better just install all of them.

Make sure it's `bin` directory is added to your systems `PATH`, however the installer should have taken care of this.
Also make sure you restarted your IDE and or console window after changing the `PATH` settings for the changes to take effect.

=== OpenSSL

It is encouraged to build them yourself, but binaries can be downloaded from sites like:
https://slproweb.com/products/Win32OpenSSL.html[this]

Usually I download the 64Bit installer.

Be sure to add the `bin` directory to the systems Path.

=== Clang

Pre-Compiled Clang executables seem to be shipped with `Visual Studio Community` edition. So if you have this installed, just make sure the executables are available on the path.

If not, it's a little tricky to find pre-compiled binaries for windows.

Seem the versions available https://releases.llvm.org/download.html[here] to the trick.
Download and install the `LLVM` package.

Select to add the LLVM to the path (doesn't matter if just for the current user or for all)
