Skip to content

Commit

Permalink
doc: add faq 'Removing the MAX_PATH Limitation' (#2388)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotduarte committed May 10, 2024
1 parent 3f220d9 commit 8a97a6d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/src/faq.rst
Expand Up @@ -121,6 +121,22 @@ you have installed.
* `for x64 (64 bit) Windows
<https://aka.ms/vs/17/release/vc_redist.x64.exe>`_

Removing the MAX_PATH Limitation
--------------------------------

Windows historically has limited path lengths to 260 characters. This meant
that paths longer than this would not resolve and errors would result.

Support for long paths is enabled for executables built in **cx_Freeze** as
long as the administrator activate the "Enable Win32 long paths" group policy
or sets ``LongPathsEnabled`` to ``1`` in the registry key
``HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem``.

After changing the above option, no further configuration is required.

.. seealso:: `Enable Long Paths in Windows 10, Version 1607, and Later
<https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later>`_

Single-file executables
-----------------------

Expand Down
4 changes: 4 additions & 0 deletions source/bases/common.c
Expand Up @@ -6,6 +6,10 @@
#include <compile.h>
#include <osdefs.h>

#if MAXPATHLEN < 1024
#define MAXPATHLEN 1024
#endif

#if defined(MS_WINDOWS)
#include <libloaderapi.h>
#define PY3_DLLNAME L"python3.dll"
Expand Down

0 comments on commit 8a97a6d

Please sign in to comment.