PathTooLongException When Installing on Windows


#1

I’m trying to update to the latest version of Atom, but am running into errors using the standalone installer. I previously installed through chocolatey, so I followed the instructions to update and then uninstall the chocolatey version. When I try to run the windows installer, I get the following error log:

Program: Starting Squirrel Updater: --install .
Program: Starting install, writing to C:\Users\excaliburhissheath\AppData\Local\SquirrelTemp
CheckForUpdateImpl: Failed to load local releases, starting from scratch: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\excaliburhissheath\AppData\Local\atom\packages\RELEASES'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Squirrel.Utility.LoadLocalReleases(String localReleaseFile)
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__28.MoveNext()
CheckForUpdateImpl: Reading RELEASES file from C:\Users\excaliburhissheath\AppData\Local\SquirrelTemp
CheckForUpdateImpl: First run or local directory is corrupt, starting from scratch
ApplyReleasesImpl: Writing files to app directory: C:\Users\excaliburhissheath\AppData\Local\atom\app-0.174.0
IEnableLogger: Failed to write file: C:\Users\excaliburhissheath\AppData\Local\atom\app-0.174.0: System.IO.PathTooLongException: 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.
   at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at NuGet.PhysicalPackageFile.GetStream()
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass8b.<copyFileToLocation>b__8a()
   at Squirrel.Utility.LogIfThrows(IFullLogger This, LogLevel level, String message, Action block)
IEnableLogger: Failed to install package to app dir: System.IO.PathTooLongException: 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.
   at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at NuGet.PhysicalPackageFile.GetStream()
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass8b.<copyFileToLocation>b__8a()
   at Squirrel.Utility.LogIfThrows(IFullLogger This, LogLevel level, String message, Action block)
   at Squirrel.UpdateManager.ApplyReleasesImpl.copyFileToLocation(FileSystemInfo target, IPackageFile x)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass84.<installPackageToAppDir>b__80(IPackageFile x)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<>c__DisplayClass84.<installPackageToAppDir>b__7f()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.UpdateManager.ApplyReleasesImpl.<installPackageToAppDir>d__86.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Squirrel.Utility.<LogIfThrows>d__4b`1.MoveNext()

I’ve tried to resolve this myself a couple of times, but I always get a DirectoryNotFoundException and a PathTooLongException. Any ideas what I can do to fix this?

Thanks.


#2

I too am having the same exact issue :frowning:


#3

Can confirm I’m experiencing same issue :frowning:


#4

This is being tracked here:

Please subscribe to that issue for updates.


#5

Getting this issue too. The issue being tracked is closed so there’s no way to gauge the impact of this limitation. Pretty ridiculous to be honest…


#6

Yes, the bug that I linked before has been closed in favor of this one:

Mentioned in the original issue