Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add faq 'Removing the MAX_PATH Limitation' #2388

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/src/faq.rst
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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