//this is supposed to fix the updater throwing an exception on windows 7 and earlier(?)
//see this for information: https://stackoverflow.com/questions/2859790/the-request-was-aborted-could-not-create-ssl-tls-secure-channel and https://stackoverflow.com/a/50977774
// This is supposed to fix the updater throwing an exception on windows 7 and earlier(?)
// See this for information: https://stackoverflow.com/q/2859790 and https://stackoverflow.com/a/50977774
if(currentPlatform.IsWinForms)
{
ServicePointManager.Expect100Continue=true;
@ -177,7 +177,7 @@ namespace AM2RLauncher
log.Info("Moving "+file.FullName+" to "+CrossPlatformOperations.CURRENTPATH+"/"+file.Name);
File.SetAttributes(CrossPlatformOperations.CURRENTPATH+profile.DataPath+".zip",FileAttributes.Normal);// for some reason, it was set at read only, so we undo that here
File.SetAttributes(CrossPlatformOperations.CURRENTPATH+profile.DataPath+".zip",FileAttributes.Normal);// For some reason, it was set at read only, so we undo that here
//check if either no profile was found or the setting says that the last current profile didn't exist
// Check if either no profile was found or the setting says that the last current profile didn't exist
if(profileDropDown.Items.Count==0)
profileIndex=null;
else
{
// we know that profiles exist at this point, so we're going to point it to 0 instead so the following code doesn't fail
// We know that profiles exist at this point, so we're going to point it to 0 instead so the following code doesn't fail
if(profIndexString=="null")
profIndexString="0";
// we parse from the settings, and check if profiles got deleted from the last time the launcher has been selected. if yes, we revert the last selection to 0;
// We parse from the settings, and check if profiles got deleted from the last time the launcher has been selected. if yes, we revert the last selection to 0;
intintParseResult=Int32.Parse(profIndexString);
profileIndex=intParseResult;
if(profileIndex>=profileDropDown.Items.Count)
@ -232,7 +232,7 @@ namespace AM2RLauncher
log.Info("Profiles loaded.");
// refresh the author and version label on the main tab
// Refresh the author and version label on the main tab
// for an explanation on the .replace look in CreateXdeltaPatch method
// For an explanation on the .replace look in CreateXdeltaPatch method
Arguments=args+"\""+apktoolPath.Replace(CrossPlatformOperations.CURRENTPATH+"/","../")+"\" d \""+dataPath.Replace(CrossPlatformOperations.CURRENTPATH+"/","../")+"/android/AM2RWrapper.apk\"",
WorkingDirectory=tempDir,
UseShellExecute=false,
@ -653,7 +654,7 @@ namespace AM2RLauncher
if(Platform.IsWinForms)
{
// sets the arguments to empty, or to the profiles save path/logs and create time based logs. Creates the folder if necessary.
// Sets the arguments to empty, or to the profiles save path/logs and create time based logs. Creates the folder if necessary.
stringarguments="";
// Game logging
@ -699,26 +700,26 @@ namespace AM2RLauncher
log.Info("Is the environment textbox null or whitespace = "+string.IsNullOrWhiteSpace(customEnvVarTextBox.Text));
//Visual studio does it like this for normal winforms projects, so I just used the same format.
//Visual studio does it like this for normal winforms projects, so I just used the same format.
/// <summary>The tray indicator</summary>
TrayIndicatortrayIndicator;
@ -846,7 +846,7 @@ namespace AM2RLauncher
/// <summary><see cref="List{T}"/> of <see cref="ListItem"/>s so that Eto's annoying <see cref="IListItem"/> interface is appeased. Used for profile name display in DropDowns.</summary>
//here's a short explanation of this. Basically, what we do is create an indexer. This makes it possible for this class to be indexed, like this LauncherConfigXML[i]
//the indexer here has a get and set "submethod". And both use Reflection to get the current class as something that can be used with lambda values
//so for get we just lambda the properties and search for something that can be read and has the same name as the input property. After that, we just get the value and return it as a string
//set is basiaclly the same, but instead of returning it, we set the prtoperty value, which would be followed after the `='.
//So LauncherConfigXML[property] = hellWorld would set the value of `property` to `hellWorld`
// Huge help from James for all of this!!!
// Here's a short explanation of this. Basically, what we do is create an indexer. This makes it possible for this class to be indexed, like this LauncherConfigXML[i]
// The indexer here has a get and set "submethod". And both use Reflection to get the current class as something that can be used with lambda values
// So for get we just lambda the properties and search for something that can be read and has the same name as the input property. After that, we just get the value and return it as a string
// Set is basiaclly the same, but instead of returning it, we set the prtoperty value, which would be followed after the `='.
//So LauncherConfigXML[property] = hellWorld would set the value of `property` to `hellWorld`
/// <summary>
/// An Indexer for <see cref="ProfileXML"/>. Not to be used directly, use <see cref="CrossPlatformOperations.WriteToConfig(string, object)"/>
/// or <see cref="CrossPlatformOperations.ReadFromConfig(string)"/> instead!
@ -88,7 +88,7 @@ namespace AM2RLauncher.XML
{
get
{
//this is gonna throw an exception, if the property can't be found. because of null.GetValue(this)
// This is gonna throw an exception, if the property can't be found. because of null.GetValue(this)