//
//  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
//
//      https://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 Npcap.
It is available from https://npcap.com/[here].

So in order to install things correctly:

1. install the version Npcap from above location.
2. Add `%SystemRoot%\System32\Npcap\` to your System's `PATH`
3. Possibly reboot

After this all should be working.

If not, have a look here for possible help: https://github.com/kaitoy/pcap4j#about-native-library-loading[here]

NOTE: If you had WinPcap installed, you need to uninstall this and make sure the files `Packet.dll` and `wpcap.dll` are deleted in the `%SystemRoot%\System32\` directory. Otherwise `pcap4j` will incorrectly detect a wrong version.

=== 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.

=== 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.

=== WinBuilds

We 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.

When running the setup, be sure to leave the setting on the `line ending conversions` on `Checkout Windows-style, commit Unix-style line endings`, this will cause specially in the generated code, a lot of false-dirty files, however when selecting other options that check out the code with Unix line endings (the repo is in this state) the build will fail.

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)
