halfmanbear / SLAM

SymLink Advanced Mod-manager for DCS
https://buymeacoffee.com/halfmanbear
2 stars 0 forks source link

SLAM may not like Uninstalling DCS Terrain Mods that are on another drive using a Symbolic Link #5

Open YSIAD-PIR opened 1 month ago

YSIAD-PIR commented 1 month ago

I can confirm that SLAM works perfectly when installing Mods like Caucasus Redone and Caucasus CGTC only when the Caucasus Terrain folder is in the \DCS World OpenBeta\Mods\terrains\Caucasus in the DCS Root Folder.

Situation: I recently moved some of my DCS terrains (like Caucasus) to another SSD Drive, using a Symbolic Links so I could free up space on my Main DCS SSD. As a result when I Install Terrain Mods using SLAM on a Caucasus Folder that is located on another drive using a Symbolic Link I get an Unhandled exception has occurred error when Uninstalling the Selected Mod.

Summary: System.Management.Automation.RuntimeException: Failed to remove symbolic link: Access is denied.

Note that Installing and Uninstalling the Main Caucasus Terrain Mods like Caucasus Redone and Caucasus CGTC work perfectly fine when Caucasus is in the DCS Root Folder not using a Symbolic Link.

My workaround for now is to just keep Caucasus on the Main DCS SSD and not move it to my Terrain Drive. : )

** Details *****

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.Management.Automation.RuntimeException: Failed to remove symbolic link: Access is denied. ---> System.Management.Automation.RuntimeException: Failed to remove symbolic link: Access is denied. --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(ScriptBlockClauseToInvoke clauseToInvoke, Boolean createLocalScope, Dictionary2 functionsToDefine, List1 variablesToDefine, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args) at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Boolean propagateAllExceptionsToTop, List1 variablesToDefine, Dictionary`2 functionsToDefine, Object[] args) at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args) at lambda_method170(Closure, Object, EventArgs) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)

** Loaded Assemblies **

System.Private.CoreLib Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Private.CoreLib.dll

pwsh Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\pwsh.dll

System.Runtime Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.dll

Microsoft.PowerShell.ConsoleHost Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\Microsoft.PowerShell.ConsoleHost.dll

System.Management.Automation Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\System.Management.Automation.dll

System.Threading.Thread Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Threading.Thread.dll

System.Runtime.InteropServices Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.InteropServices.dll

System.Threading Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Threading.dll

System.Collections Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Collections.dll

System.Linq.Expressions Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Linq.Expressions.dll

System.Diagnostics.Process Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Diagnostics.Process.dll

System.Runtime.Numerics Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.Numerics.dll

System.Xml.ReaderWriter Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Xml.ReaderWriter.dll

System.Private.Xml Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Private.Xml.dll

Microsoft.PowerShell.CoreCLR.Eventing Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\Microsoft.PowerShell.CoreCLR.Eventing.dll

Microsoft.Win32.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\Microsoft.Win32.Primitives.dll

System.DirectoryServices Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.DirectoryServices.dll

System.Text.Encoding.Extensions Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Text.Encoding.Extensions.dll

System.Collections.Specialized Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Collections.Specialized.dll

System.ComponentModel.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.ComponentModel.Primitives.dll

System.Collections.Concurrent Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Collections.Concurrent.dll

System.Management Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Management.dll

System.Private.Uri Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Private.Uri.dll

System.Text.RegularExpressions Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Text.RegularExpressions.dll

Microsoft.Win32.Registry Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\Microsoft.Win32.Registry.dll

Microsoft.Management.Infrastructure Assembly Version: 1.0.0.0 Location: C:\Program Files\PowerShell\7\microsoft.management.infrastructure.dll

Newtonsoft.Json Assembly Version: 13.0.0.0 Location: C:\Program Files\PowerShell\7\Newtonsoft.Json.dll

System.Net.Mail Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Net.Mail.dll

System.Net.NetworkInformation Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Net.NetworkInformation.dll

System.ComponentModel.TypeConverter Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.ComponentModel.TypeConverter.dll

System.Linq Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Linq.dll

System.Net.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Net.Primitives.dll

System.ObjectModel Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.ObjectModel.dll

System.Security.AccessControl Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Security.AccessControl.dll

System.Security.Cryptography Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Security.Cryptography.dll

System.Runtime.Serialization.Formatters Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.Serialization.Formatters.dll

System.Diagnostics.TraceSource Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Diagnostics.TraceSource.dll

System.Runtime.Serialization.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.Serialization.Primitives.dll

System.Data.Common Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Data.Common.dll

System.ComponentModel Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.ComponentModel.dll

System.Reflection.Emit.Lightweight Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Reflection.Emit.Lightweight.dll

System.Reflection.Emit.ILGeneration Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Reflection.Emit.ILGeneration.dll

System.Reflection.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Reflection.Primitives.dll

System.Memory Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Memory.dll

System.Console Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Console.dll

System.Security.Principal.Windows Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Security.Principal.Windows.dll

System.Security.Claims Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Security.Claims.dll

Microsoft.ApplicationInsights Assembly Version: 2.21.0.429 Location: C:\Program Files\PowerShell\7\Microsoft.ApplicationInsights.dll

netstandard Assembly Version: 2.1.0.0 Location: C:\Program Files\PowerShell\7\netstandard.dll

System.Diagnostics.DiagnosticSource Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Diagnostics.DiagnosticSource.dll

System.Runtime.Loader Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.Loader.dll

System.IO.MemoryMappedFiles Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.IO.MemoryMappedFiles.dll

System.IO.Pipes Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.IO.Pipes.dll

System.Private.Xml.Linq Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Private.Xml.Linq.dll

System.Text.Encoding.CodePages Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Text.Encoding.CodePages.dll

System.Threading.Tasks.Parallel Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Threading.Tasks.Parallel.dll

System.Diagnostics.Tracing Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Diagnostics.Tracing.dll

System.IO.FileSystem.AccessControl Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.IO.FileSystem.AccessControl.dll

System.IO.FileSystem.DriveInfo Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.IO.FileSystem.DriveInfo.dll

getfilesiginforedistwrapper Assembly Version: 10.0.0.0 Location: C:\Program Files\PowerShell\7\getfilesiginforedistwrapper.dll

System.Security.Permissions Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Security.Permissions.dll

System.Threading.Overlapped Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Threading.Overlapped.dll

Anonymously Hosted DynamicMethods Assembly Assembly Version: 0.0.0.0 Location:

System.Threading.ThreadPool Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Threading.ThreadPool.dll

Microsoft.PowerShell.PSReadLine2 Assembly Version: 2.3.5.0 Location: C:\program files\powershell\7\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine2.dll

mscorlib Assembly Version: 4.0.0.0 Location: C:\Program Files\PowerShell\7\mscorlib.dll

System.Drawing.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Drawing.Primitives.dll

System.Drawing.Common Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Drawing.Common.dll

Microsoft.PowerShell.Commands.Utility Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Utility.dll

Microsoft.PowerShell.MarkdownRender Assembly Version: 7.2.1.0 Location: C:\Program Files\PowerShell\7\Microsoft.PowerShell.MarkdownRender.dll

System.Net.Http Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Net.Http.dll

System.Windows.Forms Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Windows.Forms.dll

System.Drawing Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Drawing.dll

Microsoft.CodeAnalysis Assembly Version: 4.8.0.0 Location: C:\Program Files\PowerShell\7\Microsoft.CodeAnalysis.dll

Microsoft.CodeAnalysis.CSharp Assembly Version: 4.8.0.0 Location: C:\Program Files\PowerShell\7\Microsoft.CodeAnalysis.CSharp.dll

System.Collections.Immutable Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Collections.Immutable.dll

System.Reflection.Metadata Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Reflection.Metadata.dll

System.Globalization Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Globalization.dll

ncl55wae.40l Assembly Version: 0.0.0.0 Location:

5xzgz5ia.yxf Assembly Version: 0.0.0.0 Location:

Microsoft.PowerShell.Commands.Management Assembly Version: 7.4.5.500 Location: C:\Program Files\PowerShell\7\Microsoft.PowerShell.Commands.Management.dll

jxubplhh.aiu Assembly Version: 0.0.0.0 Location:

hlgrho4e.5l2 Assembly Version: 0.0.0.0 Location:

System.Windows.Forms.Primitives Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Windows.Forms.Primitives.dll

System.ComponentModel.EventBasedAsync Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.ComponentModel.EventBasedAsync.dll

Accessibility Assembly Version: 4.0.0.0 Location: C:\Program Files\PowerShell\7\Accessibility.dll

System.Numerics.Vectors Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Numerics.Vectors.dll

Microsoft.Win32.SystemEvents Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\Microsoft.Win32.SystemEvents.dll

System.Collections.NonGeneric Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Collections.NonGeneric.dll

System.Runtime.Intrinsics Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Runtime.Intrinsics.dll

System.Diagnostics.StackTrace Assembly Version: 8.0.0.0 Location: C:\Program Files\PowerShell\7\System.Diagnostics.StackTrace.dll

** JIT Debugging **

** End of Details **

halfmanbear commented 1 week ago

Thank you for bringing this issue to my attention.

The 'Access is denied' error occurs because the script doesn't currently support scenarios where core game directories, like the 'Caucasus' terrain folder, are already replaced with separate user created symbolic links. The script is designed under the assumption that these official game files are located in the user selected install locations and aren't already modified outside of SLAM. This is to prevent potential data loss or other unintended issues.

As a workaround, please keep the 'Caucasus' terrain folder in its original location while using SLAM. This should allow you to install and uninstall mods without encountering the error.

I appreciate your suggestion and will consider enhancing support for custom symbolic link handling in future updates if there is enough demand. However, implementing such a feature may introduce complexity and potential risks that need to be carefully evaluated.

In the meantime, I'll update the documentation and possibly implement a graceful warning within SLAM if this scenario is triggered to inform users about this limitation to help others who might face a similar situation.