INSTALL-WINDOWS 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. There are many ways to build BadVPN for Windows. It can be built with MSVC or GCC compilers,
  2. and it be built natively from Windows or cross-compiled from Linux. However, this document
  3. only describes building natively from Windows using MSVC.
  4. 1. Get a MSVC compiler, e.g. from Visual Studio, Visual Studio Express or from the Windows SDK.
  5. 2. Choose a directory where built stuff will be installed into; we call it <root>.
  6. 3. Build the NSS library.
  7. NOTE: you can also use the prebuilt version in the BadVPN windows download.
  8. - Install MozillaBuild:
  9. http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe .
  10. - Download the NSS source code that includes NSPR. As of the time of writing the latest version was 3.13.5:
  11. https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_13_5_RTM/src/nss-3.13.5-with-nspr-4.9.1.tar.gz .
  12. Extract it to c:\ so that you have C:\mozilla .
  13. - Open a terminal with access to the Visual Studio compilers and other tools. E.g. if you use the Windows SDK,
  14. activate the following start menu item: Programs -> Microsoft Windows SDK v7.1 -> Windows SDK 7.1 Command Prompt.
  15. - In this terminal, run:
  16. > c:\mozilla-build\start-l10n.bat
  17. - Either a new terminal opens with a bash shell, or a bash shell starts in the existing terminal. Either way,
  18. enter the following commands to finally build NSS: (here paths are written as /driveletter/...)
  19. $ export OS_TARGET=WINNT
  20. $ export BUILD_OPT=1
  21. $ cd <nss_source_dir>/mozilla/security/nss
  22. $ make nss_build_all
  23. Now use a script shipped with the BadVPN source to copy the resulting files into appropriate directories within <root>:
  24. $ <badvpn_source_dir>/scripts/copy_nss ../../dist <root>
  25. 4. Build the OpenSSL library.
  26. NOTE: you can also use the prebuilt version in the BadVPN windows download.
  27. - Install ActivePerl.
  28. - Download the OpenSSL source code and extract it.
  29. - Open a compiler terminal, as was done when building NSS. Inside it, run:
  30. > cd <openssl_source_dir>
  31. > perl Configure VC-WIN32 --prefix=<root>
  32. > ms\do_ms
  33. > nmake -f ms\ntdll.mak
  34. To copy the results into <root>:
  35. > nmake -f ms\ntdll.mak install
  36. 5. Build BadVPN.
  37. - Install CMake. During installation, select the option to include cmake in PATH
  38. to avoid having to type a long path into the terminal.
  39. - Create an empty folder where BadVPN will be built; call it <build>.
  40. - Open a compiler terminal. Inside it, run:
  41. > cd <build>
  42. > cmake <badvpn_source_dir> -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=<root> -DCMAKE_BUILD_TYPE=Release
  43. > nmake
  44. To copy the results into <root>:
  45. > nmake install