Closed RyanWalpole closed 2 years ago
Have uploaded commit, adding a new "Splash" screen that programmatically checks for the folders that are required and creates them if they haven't already been created.
private void CheckDirectory_Tick(object sender, EventArgs e)
{
CheckDirectory.Stop();
Status.Text = "Validating Directories...";
CreateDirectories();
LaunchApplication.Start();
}
private void CreateDirectories()
{
//Check for Mods Directory
string ModsDirectory = Properties.Settings.Default.StardewDir + @"\Mods";
if (!Directory.Exists(ModsDirectory))
{
Directory.CreateDirectory(ModsDirectory);
}
//Check for Inactive Mods Directory
string InactiveModsDirectory = Properties.Settings.Default.StardewDir + @"\inactive-mods";
if (!Directory.Exists(InactiveModsDirectory))
{
Directory.CreateDirectory(InactiveModsDirectory);
}
//Check for Presets Directory
string PresetsDirectory = Properties.Settings.Default.StardewDir + @"\mod-presets";
if (!Directory.Exists(PresetsDirectory))
{
Directory.CreateDirectory(PresetsDirectory);
}
//Check for Saves Directory
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
string sdvsaves = appdata + @"\StardewValley\Saves\";
if (!Directory.Exists(sdvsaves))
{
Directory.CreateDirectory(sdvsaves);
}
//Check for Save Backups Directory
string backupsdir = Properties.Settings.Default.StardewDir + @"\savebackups\";
if (!Directory.Exists(backupsdir))
{
Directory.CreateDirectory(backupsdir);
}
}
Issue has been resolved in release build 220303
Describe the Issue Stardew Valley Mod Manager will return an Unhandled Exception after the initial application setup if Stardew Valley has never been run on the system (even if Stardew Valley and SMAPI are installed)
Steps to Replicate Steps to reproduce the behavior:
Expected behavior For the application to launch without an unhandled exception, for the exception to be handled in code.
Screenshots![image](https://user-images.githubusercontent.com/69621127/157332514-6c54a187-f3a8-4611-be7c-85a4b24732da.png)
Environment:
Suggested Resolution Handle the exception at Form.Load. Currently the application assumes that the user has run Stardew Valley before and therefore the Game Save Management tab attempts to load all directories in the
AppData\StardewValley\Saves\
folder. Simply put a catch statement to catch the Exception and present a MessageBox: