// This is a duplicate of CrossPlatformOperations.GenerateCurrentPath, because trying to invoke that would cause a crash due to currentPlatform not being initialized.
// This is a duplicate of CrossPlatformOperations.GenerateCurrentPath, because trying to invoke that would cause a crash due to currentPlatform not being initialized.
privatestaticstringGenerateCurrentPath()
{
// First, we check if the user has a custom AM2RLAUNCHERDATA env var
/// When a Launcher update occurs that introduces new config properties, this method ensures that the old user config is copied over as much as possible.
/// When a Launcher update occurs that introduces new config properties, this method ensures that the old user config is copied over as much as possible.
log.Info("Downloading https://github.com/AM2R-Community-Developers/AM2RLauncher/releases/latest/download/AM2RLauncher_"+onlineVersion+platformSuffix+".zip to "+zipPath+".");
log.Info("Downloading https://github.com/AM2R-Community-Developers/AM2RLauncher/releases/latest/download/AM2RLauncher_"+onlineVersion+platformSuffix+".zip to "+zipPath+".");
log.Info("Cancelling archival! User-defined archive in Mods already exists.");
log.Info("Cancelling archival! User-defined archive in Mods already exists.");
}
}
}
}
else// If our desired rename already exists, it's probably a user archive... so we just delete the folder and move on with installation of the new version.
else// If our desired rename already exists, it's probably a user archive... so we just delete the folder and move on with installation of the new version.
{
{
@ -152,7 +144,7 @@ namespace AM2RLauncher
LoadProfiles();
LoadProfiles();
}
}
}
}
@ -225,7 +217,7 @@ namespace AM2RLauncher
}
}
successful=false;
successful=false;
}
}
catch(Exceptionex)// This is if somehow any other exception might get thrown as well.
catch(Exceptionex)// This is if somehow any other exception might get thrown as well.
/// <summary>Gets called when user selects a different item from <see cref="profileDropDown"/> and changes <see cref="profileAuthorLabel"/> accordingly.</summary>
/// <summary>Gets called when user selects a different item from <see cref="profileDropDown"/> and changes <see cref="profileAuthorLabel"/> accordingly.</summary>
// Message box show needs to be done on main thread
// Message box show needs to be done on main thread
Application.Instance.Invoke(newAction(()=>
Application.Instance.Invoke(newAction(()=>
{
{
@ -500,7 +495,7 @@ namespace AM2RLauncher
{
{
FileName=proc,
FileName=proc,
// 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\"",
Arguments=args+"\""+apktoolPath.Replace(CrossPlatformOperations.CURRENTPATH+"/","../")+"\" d \""+dataPath.Replace(CrossPlatformOperations.CURRENTPATH+"/","../")+"/android/AM2RWrapper.apk\"",
WorkingDirectory=tempDir,
WorkingDirectory=tempDir,
UseShellExecute=false,
UseShellExecute=false,
CreateNoWindow=true
CreateNoWindow=true
@ -646,7 +641,7 @@ namespace AM2RLauncher
// These are used on both windows and linux for game logging
// These are used on both windows and linux for game logging