Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

cached files with URL and filename > 260 characters issue and possible solution

Open 42wim opened this issue 3 years ago • 1 comments

I'm making a manifest for Microsoft Edge and I'm getting the filename too long problem.

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
URL http://msedge.f.tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/c6c3d5da-8cd4-4d17-a52d-9c1b4e9f4ff0?P1=1619294442&P2=404&P3=2&P4=W82qhGeOfF%2bacPu5vkB5FNoZKDucQJEnJ87E0P%2bMAYsiVsgr%2fsrFQA%2fnkdaAVPqIh6m%2b83hjYL%2fCtbpRhTCOXg%3d%3d#/dl.7z is not valid

I don't see anyway to make the URL shorter as this is the full URL, the problem is caused by the cache dir that caches apps with $app $version $url

https://github.com/lukesampson/scoop/blob/3d67b7d37c4a2714e8942724d4677dcbd3678f01/lib/install.ps1#L107

Is there any reason we actually need that URL there ? $app $version should be enough I think ?

If not we can:

  • add the hash instead of the url
  • or make our own hash of $app $version $url

Also I did enable the LongPathsEnabled in the registry and I'm on Windows 10 2004, but this didn't fix the issue. I'm now running a fork with only $app $version in the cache directory and it works fine.

Any thoughts? (I can make a PR for this)

42wim avatar Apr 17 '21 20:04 42wim

I suggest using the sha1 of the URL to replace the original URL.

Cologler avatar Sep 09 '22 07:09 Cologler