diff --git a/doc/src/faq.rst b/doc/src/faq.rst index 66f1ad07c..f88063507 100644 --- a/doc/src/faq.rst +++ b/doc/src/faq.rst @@ -121,6 +121,22 @@ you have installed. * `for x64 (64 bit) Windows `_ +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 + `_ + Single-file executables ----------------------- diff --git a/source/bases/common.c b/source/bases/common.c index ea600311e..68f811256 100644 --- a/source/bases/common.c +++ b/source/bases/common.c @@ -6,6 +6,10 @@ #include #include +#if MAXPATHLEN < 1024 +#define MAXPATHLEN 1024 +#endif + #if defined(MS_WINDOWS) #include #define PY3_DLLNAME L"python3.dll"