Old 3rd January 2011, 22:18   #1
abcdgoldfish
Junior Member
 
Join Date: Jan 2009
Posts: 35
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 is offline   Reply With Quote
Old 3rd January 2011, 22:20   #2
abcdgoldfish
Junior Member
 
Join Date: Jan 2009
Posts: 35
Update: I meant 225 char limit.
abcdgoldfish is offline   Reply With Quote
Old 3rd January 2011, 22:40   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
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
DrO is offline   Reply With Quote
Old 5th January 2011, 09:48   #4
Pidgeot
Senior Member
 
Pidgeot's Avatar
 
Join Date: Jan 2002
Location: Denmark
Posts: 136
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.
Pidgeot is offline   Reply With Quote
Old 5th January 2011, 20:02   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,424
Quote:
Originally Posted by Pidgeot View Post
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)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
256 char limit, path length limit

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump