You are here

Launcher breaks for long name folders with spaces

19 posts / 0 new
Last post
lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
Launcher breaks for long name folders with spaces

If I try to create a launcher for a folder like C:\Users\[user]\Documents\test this\PortableApps\something (note test this) then it fails (complaining about the name= of the program and if I also remove spaces from the name= then it complains about the folder itself).

But if all I do is create a symlink to it from c:\something and run the launcher on it then it works perfectly.

Could you make sure it supports long name folders with spaces?

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Until 3.0

The current version has a max string length of 1024. With very long paths and command lines, you're gonna hit that. Longer paths won't be possible until the major update to PA.c Launcher 3.0 which doesn't have an ETA. For now, you'll need to use shorter paths.

Sometimes, the impossible can become possible, if you're awesome!

lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
Why doesn't it alert about it?

Not sure I understand why this limit is needed, but can you at least recognize such folders and refuse to run the launcher on them?

Alternatively, you can offer to symlink them to shorter folders, then unsymlink them after the action is done.

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Compiler Limitation

NSIS 2.x has a 1024 character string limit, which is what is breaking it. This is the first mention of the issue I recall seeing since the launcher was released over a decade ago, so that's probably why it was never trapped for and alerted on. The 2.x release won't be updated with a message. The 3.x release (eventually) will up the limit to 8K character strings.

Symlinks require admin rights and are not an option within something like the PA.c Launcher.

Also worth noting that Windows has a ~256 character limit on paths by default, so most apps are written with that in mind.

Sometimes, the impossible can become possible, if you're awesome!

lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
But these are portable versions

Meaning the apps' default locations aren't relevant, since we're talking about portable versions that can be put anywhere.

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Compiled Apps Are Different

The compiled apps don't have the same limitation as they aren't internally constructing these long command lines that hit the 1024 character limit. Some of the apps themselves, of course, won't be able to run from longer paths due to their own limitations.

Sometimes, the impossible can become possible, if you're awesome!

lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
What about a tempoary move/copy?

If symlink is an issue due to admin rights (although you can ask for a temporary admin right), how about moving/copying the program into a place like program files, then move/copy it back?

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Admin Rights

We won't be asking for admin rights to compile apps with the PA.c Launcher. Moving to Program Files also requires admin rights. If you're compiling apps with the PA.c Launcher, use a shorter path. Any of the standard install locations will work without issue (external root, C: root, USERPROFILE. etc).

Sometimes, the impossible can become possible, if you're awesome!

lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
What if you use a place that needs to admin rights?

Like USERPROFILE?

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Admin

USERPROFILE doesn't require admin rights. We don't support installs to locations requiring admin rights. Never have.

Sometimes, the impossible can become possible, if you're awesome!

lwc
Offline
Last seen: 2 weeks 5 days ago
Translator
Joined: 2006-04-26 06:35
Exactly

If USERPROFILE doesn't require admin rights, it sounds like a perfect place to move/copy the long folder into in order to be able to create a launcher from it.

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Future Fix

As I mentioned above, a change to detect and handle this will not be coming to the PA.c Launcher 2.x series. It will be handled in the eventual 3.x release at some point in the future. Until then, please run it from a shorter path.

Sometimes, the impossible can become possible, if you're awesome!

Mark888
Offline
Last seen: 7 months 3 weeks ago
Joined: 2022-09-28 11:21
Hello @John T. Haller,

Hello @John T. Haller, I've tested app path that is longer than 256 characters but sure is less than 270, and the launcher refused to launch the app.

So, as I see it, the 1024 max string length is not the issue, at least it should allow app path length that is around 1000 character (right?). And for me (and most other users) 1000 characters is more than enough (unlike 256 - it's to little)

If any help, we can use the prefix \\?\ trick when launching apps to work around the issue as mentioned in the below links:

Microsoft: Maximum Path Length Limitation

Stackoverflow

Long Paths in .NET - Part1

Long Paths in .NET - Part2

Long Paths in .NET - Part3

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Wrong Topic

The "Launcher" here is the PA.c Launcher's generator which is used to build the AppNamePortable.exe launcher. This is limited but has nothing to do with running an app.

If you're unable to run an app from an AppNamePortable.exe launcher, it's likely that the launch string is over 1024 characters. This is NOT the app path but the launch string. Instead just:

"X:\Absurdly\Long\Path\AppNamePortable\App\MyApp.exe"

The launch string is:

"X:\Absurdly\Long\Path\AppNamePortable\App\MyApp.exe" --portable --no-splash --data="X:\Absurdly\Long\Path\AppNamePortable\Data\settings" --log="X:\Absurdly\Long\Path\AppNamePortable\Data\logs"

If you're referring to the PA.c Platform's Menu, that's something entirely different.

Sometimes, the impossible can become possible, if you're awesome!

Mark888
Offline
Last seen: 7 months 3 weeks ago
Joined: 2022-09-28 11:21
Thank you for explaining it.

Thank you for explaining it.

What I meant was the "Start=Relative\App\Path\Name.exe" line in appinfo.ini. Whenever the Absolute path length is greater than 260 characters, the app can not be opened from the PortableApps start menu.

Can it be fixed? Should I open another thread for this issue?

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Launcher or Platform

Again, are you referring to the Launcher or to the Platform?

Please post the full launcher ini for analysis as well.

Sometimes, the impossible can become possible, if you're awesome!

Mark888
Offline
Last seen: 7 months 3 weeks ago
Joined: 2022-09-28 11:21
Sorry, I got mixed up between

Sorry, I got mixed up between those 2. I meant the PortableApps Platform.

Whenever the Absolute path length is greater than 260 characters, the app can not be opened from the PortableApps Platform.

Mark888
Offline
Last seen: 7 months 3 weeks ago
Joined: 2022-09-28 11:21
Another useful link from

Another useful link from Microsoft

John T. Haller
John T. Haller's picture
Offline
Last seen: 8 hours 5 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Separate Issue

This would be a separate issue entirely. You can create a new post discussing it and asking for it a feature addition for it if you'd like in the PortableApps.com Platform forum. I'm not sure if I will implement this as even when you enable long paths in Windows 10/11 with the LongPathsEnabled registry key, apps themselves won't work with it unless they explicitly opt in and advertise that to Windows via a manifest entry. Most apps won't work with paths that long. Even Windows Explorer won't. I think the majority of apps we make available will fail in such a situation. Please create a new topic if you'd like to discuss further and avoid replying here so it doesn't keep notifying the folks above who are discussing something different.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments