algoRhythm99 / TiTsEd

A save editor for Trials in Tainted Space.
BSD 3-Clause "New" or "Revised" License
89 stars 20 forks source link

Program crashes when loading save, but then works afterwards #93

Closed someone181 closed 5 years ago

someone181 commented 5 years ago

The first time I try to load a file (using the Open->Local (Standard) menu), the program crashes with this message:

[TiTsEd: 0.29.5.41435, TiTs Data: 33] System.UnauthorizedAccessException: Access to the path '636882895065829365.bak' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.Delete() at TiTsEd.Model.FileManager.CreateBackup(String sourcePath) at TiTsEd.ViewModel.VM.Load(String path, SerializationFormat expectedFormat, Boolean createBackup) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg) 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)

Symptoms: The thing that's weird is that if I start the application and try loading the same file again, it works fine. Once that happens, I can save and load that specific file as much as I want without issue (as long as I don't close the program). If however, I try to load a new file, it will crash with the same error again, and the same results (the new file is now the stable file if I reopen the program).

Other info that may help:

This isn't critical to solve since I have an easy workaround, but at the same time it's annoying enough that I've created a GitHub account solely to report this issue. Let me know if you need any more info.

Thanks!

algoRhythm99 commented 5 years ago

System.UnauthorizedAccessException: Access to the path '636882895065829365.bak' is denied.

This means the program is getting access denied when trying to create the backup file for the save. Only thing I can think of is an anti-virus application interfering.

algoRhythm99 commented 5 years ago

Can you try this version? https://github.com/Chase-san/TiTsEd/releases/tag/v0.30.4

someone181 commented 5 years ago

The new version may have fixed it. I say "may have" because I couldn't actually get the normal program to extract (every file in the "TiTsEd_v0.30.4.zip" folder except for "CoCEd License.txt", "TiTsEd License.txt", and "TitsEd.Data.xml" threw an "Error 0x80004005: Unexpected error. An unexpected error is keeping you from copying the file." exception, and re-downloading the file and restarting my computer didn't help). However, I was able to extract the source code. When I compiled and ran that (using Visual Studio Community 2019), the program ran and didn't throw any errors when I tried loading different saves. Hooray!

So it seems to be fixed, but I know from experience that sometimes (especially when dealing with external folders and files) new problems crop up when running the program from its published executable vs. debugging in the VS development environment. So if you could re-upload a copy of TiTsEd_v0.30.4.zip (or re-zip it and upload that, sometimes that helps too), we can be sure that the error is fixed. (And if it isn't, we'll at least have narrowed it down to a problem that doesn't occur when being run from the debug location).

Thanks!

algoRhythm99 commented 5 years ago

Updated the zip file

someone181 commented 5 years ago

New file works with no error messages! Thank you very much for your help!