// TODO: make sure that the validation works on other platforms too
varsaveRegex=newRegex(@"C:\\Users\\.*\\AppData\\Local\\");//this is to ensure, that the save directory is valid. so far, this is only important for windows
varwinSaveRegex=newRegex(@"C:\\Users\\.*\\AppData\\Local\\");//this is to ensure, that the save directory is valid. so far, this is only important for windows
varlinSaveRegex=newRegex(@"$/\.config");// Linux users can set their home directory wherever they want to, for each individual application
MessageBox.Show("Could not create temp directory! Please run the application with administrator rights.","Error",MessageBoxButtons.OK,MessageBoxType.Error);
AbortPatch();
return;
}
// Extract 1.1 and modded AM2R to their own directories in temp work
MessageBox.Show("1.1 data.win does not meet MD5 checksum! Mod packaging aborted.\n1.1 MD5: "+originalMD5+"\nYour MD5: "+newMD5,"Error",MessageBoxButtons.OK,MessageBoxType.Error);
MessageBox.Show("data.win not found! Are you sure you selected AM2R 1.1? Mod packaging aborted.","Error",MessageBoxButtons.OK,MessageBoxType.Error);
AbortPatch();
return;
}
// Create AM2R.exe and data.win patches
if(profile.OperatingSystem=="Windows")
{
if(!File.Exists(tempModPath+"/AM2R.exe"))
{
varresult=MessageBox.Show("Modded game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
if(result!=DialogResult.Yes)
AbortPatch();
}
if(File.Exists(tempModPath+"profile.xml"))
{
varresult=MessageBox.Show("profile.xml found. This file is used by the AM2RLauncher to determine profile stats and its inclusion may make the profile uninstallable. Are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
varresult=MessageBox.Show("Modded Linux game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
if(result!=DialogResult.Yes)
AbortPatch();
}
if(File.Exists(tempModPath+"profile.xml"))
{
varresult=MessageBox.Show("profile.xml found. This file is used by the AM2RLauncher to determine profile stats and its inclusion may make the profile uninstallable. Are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
return(false,"1.1 data.win does not meet MD5 checksum! Mod packaging aborted.\n1.1 MD5: "+originalMD5+"\nYour MD5: "+newMD5);
}
}
catch(FileNotFoundException)
{
return(false,"data.win not found! Are you sure you selected AM2R 1.1? Mod packaging aborted.");
}
// Create AM2R.exe and data.win patches
if(profile.OperatingSystem=="Windows")
{
if(!File.Exists(tempModPath+"/AM2R.exe"))
{//TODO: put this onto the outer method
/*
varresult=MessageBox.Show("Modded game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
if(result!=DialogResult.Yes)
{
AbortPatch();
return(false,"");
}*/
}
if(File.Exists(tempModPath+"profile.xml"))
{
//TODO: put this onto the outer method
/*varresult=MessageBox.Show("profile.xml found. This file is used by the AM2RLauncher to determine profile stats and its inclusion may make the profile uninstallable. Are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
varresult=MessageBox.Show("Modded Linux game not found, make sure it's not placed in any subfolders.\nCreated profile will likely not be installable, are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);
if(result!=DialogResult.Yes)
{
AbortPatch();
return(false,"");
}*/
}
if(File.Exists(tempModPath+"profile.xml"))
{
//TODO: put this onto the outer method
/*varresult=MessageBox.Show("profile.xml found. This file is used by the AM2RLauncher to determine profile stats and its inclusion may make the profile uninstallable. Are you sure you want to continue?","WARNING",MessageBoxButtons.YesNo,MessageBoxType.Warning);