X-Hax / SA-Mod-Manager

A new mod manager for the Sonic Adventure games.
MIT License
79 stars 17 forks source link

Try-catch mod folder creation, request elevation if the game is located in Program Files etc. #174

Closed aquosblue closed 3 months ago

aquosblue commented 4 months ago

Trying to use the 2004 PC release of SADX with the modloader.

Exception Report

SAMM Information:
    Manager Version: 1.2.10
    Current Game: Sonic Adventure DX
    Game Directory: C:\Program Files\Sega\SONICADVENTUREDX
    Manager Location: C:\Program Files (x86)\Steam\steamapps\common\Sonic Adventure DX\
    Running as Admin: False
    Mod Loader Version (Hash): c6f3082909276cc4a13bda7b7b8b4b38c83a1e23
Exception Information:
    Type: UnauthorizedAccessException
    Exception: Access to the path 'C:\Program Files\Sega\SONICADVENTUREDX\mods' is denied.
    Source: System.Private.CoreLib
    In Function: Void CreateDirectory(System.String, Byte[])
    StackTrace:    at System.IO.FileSystem.CreateDirectory(String fullPath, Byte[] securityDescriptor)
       at System.IO.Directory.CreateDirectory(String path)
       at SAModManager.Profile.ProfileManager.MigrateProfiles(Boolean deletesource)
       at SAModManager.Profile.ProfileManager.CreateProfiles()
       at SAModManager.MainWindow.Load(Boolean newSetup)
       at SAModManager.MainWindow.DoGameSwap(String newPath)
       at SAModManager.MainWindow.ResultPickGame(String path)
       at SAModManager.MainWindow.btnBrowseGameDir_Click(Object sender, RoutedEventArgs e)
       at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location ---
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at SAModManager.App.Main()
Sora-yx commented 3 months ago

Autorization error should now show a warning when attempting to create a directory with the last manager update, if it doesn't happen feel free to re open.