Browse Source

docs: installation: Add instructions for Windows

Remove the old Windows README while we're at it.
Rayyan Ansari 2 years ago
parent
commit
3174904ce3
2 changed files with 36 additions and 48 deletions
  1. 0 48
      README_WINDOWS.rst
  2. 36 0
      docs/installation.rst

+ 0 - 48
README_WINDOWS.rst

@@ -1,48 +0,0 @@
-Borg Native on Windows
-======================
-
-Running borg natively on windows is in a early alpha stage. Expect many things to fail.
-Do not use the native windows build on any data which you do not want to lose!
-
-Build Requirements
-------------------
-
-- VC 14.0 Compiler
-- OpenSSL Library v1.1.1c, 64bit (available at https://github.com/python/cpython-bin-deps)
-  Please use the `win-download-openssl.ps1` script to download and extract the library to
-  the correct location. See also the OpenSSL section below.
-- Patience and a lot of coffee / beer
-
-What's working
---------------
-
-.. note::
-   The following examples assume that the `BORG_REPO` and `BORG_PASSPHRASE` environment variables are set
-   if the repo or passphrase is not explicitly given.
-
-- Borg does not crash if called with ``borg``
-- ``borg init --encryption repokey-blake2 ./demoRepo`` runs without an error/warning.
-  Note that absolute paths only work if the protocol is explicitly set to file://
-- ``borg create ::backup-{now} D:\DemoData`` works as expected.
-- ``borg list`` works as expected.
-- ``borg extract --strip-components 1 ::backup-XXXX`` works. 
-  If absolute paths are extracted, it's important to pass ``--strip-components 1`` as
-  otherwise the data is restored to the original location!
-
-What's NOT working
-------------------
-
-- Extracting a backup which was created on windows machine on a non windows machine will fail.
-- And many things more.
-
-
-OpenSSL, Windows and Python
----------------------------
-Windows does not ship OpenSSL by default, so we need to get the library from somewhere else.
-However, a default python installation does include `libcrypto` which is required by borg.
-The only things which are missing to build borg are the header and `*.lib` files.
-Luckily the python developers provide all required files in a separate repository.
-The `win-download-openssl.ps1` script can be used to download the package from
-https://github.com/python/cpython-bin-deps and extract the files to the correct location.
-For Anaconda, the required libraries can be installed with `conda install -c anaconda openssl`.
-

+ 36 - 0
docs/installation.rst

@@ -13,6 +13,7 @@ There are different ways to install Borg:
   that comes bundled with all dependencies.
 - :ref:`source-install`, either:
 
+  - :ref:`windows-binary` - builds a binary file for Windows using MSYS2.
   - :ref:`pip-installation` - installing a source package with pip needs
     more installation steps and requires all dependencies with
     development headers and a compiler.
@@ -294,6 +295,20 @@ and commands to make FUSE work for using the mount command.
      kldload fuse
      sysctl vfs.usermount=1
 
+.. _windows_deps:
+
+Windows
++++++++
+
+.. note::
+    Running under Windows is experimental.
+
+.. warning::
+    This script needs to be run in the UCRT64 environment in MSYS2.
+
+Install the dependencies with the provided script::
+
+    ./scripts/msys2-install-deps
 
 Windows 10's Linux Subsystem
 ++++++++++++++++++++++++++++
@@ -318,6 +333,27 @@ Use the Cygwin installer to install the dependencies::
     binutils gcc-g++ git make openssh
 
 
+.. _windows-binary:
+
+Building a binary on Windows
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+    This is experimental.
+
+.. warning::
+    This needs to be run in the UCRT64 environment in MSYS2.
+
+Ensure to install the dependencies as described within :ref:`Dependencies: Windows <windows_deps>`.
+
+::
+
+    export SETUPTOOLS_USE_DISTUTILS=stdlib # Needed for pip to work - https://www.msys2.org/docs/python/#known-issues
+    pip install -e .
+    pyinstaller -y scripts/borg.exe.spec
+
+A standalone executable will be created in ``dist/borg.exe``.
+
 .. _pip-installation:
 
 Using pip