Fix windows crash trying to assign custom save location

pull/9/head
Miepee 4 years ago
parent 530fb751f7
commit bd6c1c2011

@ -30,7 +30,7 @@ public partial class ModPacker : Form
private void CustomSaveDataButton_Click(object sender, EventArgs e) private void CustomSaveDataButton_Click(object sender, EventArgs e)
{ {
string home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile).Replace("\\", "\\\\"); // This is \ -> \\
bool wasSuccessful = false; bool wasSuccessful = false;
var winSaveRegex = new Regex(@"C:\\Users\\.*\\AppData\\Local\\"); //this is to ensure, that the save directory is valid. so far, this is only important for windows var winSaveRegex = new Regex(@"C:\\Users\\.*\\AppData\\Local\\"); //this is to ensure, that the save directory is valid. so far, this is only important for windows
var linSaveRegex = new Regex($@"{home}/\.config/"); // GMS hardcodes save into ~/.config on linux var linSaveRegex = new Regex($@"{home}/\.config/"); // GMS hardcodes save into ~/.config on linux

Loading…
Cancel
Save