When running makensis Installer.nsi on my installer I am running into a MAX_PATH length problem it seems.
When it runs the line
File /r "..\Name-Of-App\*"
I get an error:
File: failed opening file "..\Name-Of-App\long\path\name"
When checking what the absolute path becomes, it ends up at 262 characters.
Now I have enabled long path on Windows, so that should not be the problem.
I moved the source code and everything related somewhere with a shorter path, and it builds correctly.
At this point I assume it's either a bug or a missing feature inside nsis
Since this is known for 10 years and a fix was deemed unnecessary, one has to assume it is an intended limitation of NSIS.
Thank you for the response, I hope it can one day be included.
I never saw this Pull/Patch request, so than you so kuch for that. I at least have the possibility to compile my own NSIS. So I will probably do that with that patch (if it still works). I hope one day it can be incorporated to the main release
No worries. Let me know if you are successful in self-compilation. I have not had the time yet to try and would still be interested such that we can finally use deeper directory hierarchies.
If you are, we should make a case for the importance of finishing that PR. Apparently it needs some cleanup/corner cases.
It MIGHT be possible to add a makensis.exe.manifest file to NSIS\Bin that unlocks long path support (the policy/registry entry also needs to be set). This has never been tested and might crash or not work.
Last edit: Anders 2024-04-10
I am not sure if a software automagically becomes long file path aware by just specifying it in the manifest (which needs to be done in VS and should be done in your build system, not on a users machine).
You probably need to use the new Windows API functions as well (suffixed with W or 2).
See the last paragraph on https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry
Why would I suggest it if it has zero chance of working?
I agree with @anders_k that similar approaches have been used by other projects in the past, and their mileage was pretty good. For example, ninja (build system) has recently updated their code with the manifest, and have pretty ok long path support.