Nexus-Mods / NexusMods.App

Home of the development of the Nexus Mods App
https://nexus-mods.github.io/NexusMods.App/
GNU General Public License v3.0
963 stars 47 forks source link

Installing F4SE on Windows via NXM handler fails with `Access Denied` #1088

Open Sewer56 opened 7 months ago

Sewer56 commented 7 months ago

Bug Report

Summary

See https://github.com/Nexus-Mods/NexusMods.App/pull/1071#issuecomment-2007308021 .

On Windows, installing F4SE results in failure.

Steps to reproduce

Use Microsoft Windows.

  Message: 
System.UnauthorizedAccessException : Access to the path 'CustomControlMap.txt' is denied.

  Stack Trace: 
FileSystem.RemoveDirectoryRecursive(String fullPath, WIN32_FIND_DATA& findData, Boolean topLevel)
FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
FileSystem.InternalDeleteDirectory(AbsolutePath path, Boolean recursive)
FileSystem.InternalDeleteDirectory(AbsolutePath path, Boolean recursive)
BaseFileSystem.DeleteDirectory(AbsolutePath path, Boolean recursive)
TemporaryPath.Dispose_Impl()
TemporaryPath.DisposeAsync()
FileOriginRegistry.RegisterDownload(AbsolutePath path, AArchiveMetaData metaData, CancellationToken token) line 80
NxmDownloadProtocolHandler.Handle(Uri url, LoadoutMarker loadout, String modName, CancellationToken token) line 58
NxmDownloadProtocolHandler.Handle(Uri url, LoadoutMarker loadout, String modName, CancellationToken token) line 64
<7 more frames...>
<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
InvocationPipeline.<InvokeAsync>g__FullInvocationChainAsync|2_0(InvocationContext context)
ParseResultExtensions.InvokeAsync(ParseResult parseResult, IConsole console)
ParserExtensions.InvokeAsync(Parser parser, String[] args, IConsole console)
CommandLineConfigurator.RunAsync(String[] args, IRenderer renderer, CancellationToken token)
AVerbTest.Run(String[] args) line 32
Fallout4Tests.CanInstallAndApplyMostPopularMods() line 38

What is the expected behaviour?

Directory cleanup should succeed.

Other information

Haven't investigated into this as it was outside of the current Milestone and/or Sprint scope. This seems to happen when specifically installing F4SE, installing other mods does not seem to reproduce this.

Cause is unknown, maybe something is still holding a handle to a file inside, we don't yet know. We'll need to debug.

LukeNexusMods commented 7 months ago

Is this something the prevents the app from being installed?

Sewer56 commented 7 months ago

Is this something the prevents the app from being installed?

This is an issue of: A random mod fails to install, but only on Windows. In non-game/non-mod specific code (as far as we know currently).

The implication is, there's a good chance there's a deeper underlying issue in play here.

To put this in the context of the current Milestone. There's a non-zero chance that if someone were to install a Stardew Mod, that installation would fail if they were on Windows, if they happened to run into the same issue.