abcdgoldfish
3rd January 2011 22:18 UTC
256 char path limit
I have hit the 256 char limit for some files I am trying to install. I've looked around and haven't found any workarounds for NSIS installers. I know that I could possibly use the DOS subst command to fake a shorter path but that comes with its own set of complexities.
Is there an NSIS solution I have missed?
abcdgoldfish
3rd January 2011 22:20 UTC
Update: I meant 225 char limit.
DrO
3rd January 2011 22:40 UTC
the limit should be 260 chars though it also depends upon the length of the path, filename and file extension as to how much of that will be used before a failure happens like you are seeing (which would explain hitting 225 chars as the last working result).
this is basically a built-in limit with the Windows operating system. it can be worked around by working with unc paths though i cannot remember how easy that would be to specify in the installer and ensure that it works as expected.
-daz
Pidgeot
5th January 2011 09:48 UTC
For the exact details, you'll want to look at MSDN, but to the best of my knowledge, you need Unicode to do it (the ANSI version of the Windows API doesn't support that syntax).
However, if there is any possible way for you to do so, you'll probably be much better off making your filenames shorter, or installing to a location that avoids such long paths - it saves you a lot of potential trouble with other programs.
Anders
5th January 2011 20:02 UTC
Originally posted by Pidgeot
For the exact details, you'll want to look at MSDN, but to the best of my knowledge, you need Unicode to do it (the ANSI version of the Windows API doesn't support that syntax).
Just using the unicode build will not help, the application needs to be coded to support it and IIRC not all the shell interfaces support the long paths and relative paths will also stop working so it is probably not something NSIS will support (To mitigate this somewhat, Vista profile paths only use short names like Users and AppData)