implement data folder for log.config, use code cleaner

pull/30/head
Miepee 5 years ago
parent 664e39f18b
commit 0446689e77

@ -1,7 +1,7 @@
using Eto.Forms; using Eto.Forms;
using log4net; using log4net;
using System;
using log4net.Config; using log4net.Config;
using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
@ -22,19 +22,18 @@ namespace AM2RLauncher.Gtk
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
string launcherDataPath = GenerateCurrentPath();
string localAM2RPath = Environment.GetEnvironmentVariable("HOME") + "/.local/share/AM2RLauncher"; // Make sure first, ~/.local/share/AM2RLauncher exists
if (!Directory.Exists(launcherDataPath))
// Make sure first, ~/.local/share exists Directory.CreateDirectory(launcherDataPath);
if (!Directory.Exists(localAM2RPath))
Directory.CreateDirectory(localAM2RPath);
// Now, see if log4netConfig exists, if not write it again. // Now, see if log4netConfig exists, if not write it again.
if (!File.Exists(localAM2RPath + "/log4net.config")) if (!File.Exists(launcherDataPath + "/log4net.config"))
File.WriteAllText(localAM2RPath + "/log4net.config", Properties.Resources.log4netContents); File.WriteAllText(launcherDataPath + "/log4net.config", Properties.Resources.log4netContents.Replace("${DATADIR}", launcherDataPath));
// Configure logger // Configure logger
XmlConfigurator.Configure(new FileInfo(localAM2RPath + "/log4net.config")); XmlConfigurator.Configure(new FileInfo(launcherDataPath + "/log4net.config"));
try try
{ {
@ -58,5 +57,45 @@ namespace AM2RLauncher.Gtk
log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString()); log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString());
MessageBox.Show(Language.Text.UnhandledException + "\n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString(), "GTK", MessageBoxType.Error); MessageBox.Show(Language.Text.UnhandledException + "\n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString(), "GTK", MessageBoxType.Error);
} }
// This is a duplicate of CrossPlatformOperations.GenerateCurrentPath, because trying to invoke that would cause a crash due to currentPlatform not being initialized.
private static string GenerateCurrentPath()
{
string NIXHOME = Environment.GetEnvironmentVariable("HOME");
// First, we check if the user has a custom AM2RLAUNCHERDATA env var
string am2rLauncherDataEnvVar = Environment.GetEnvironmentVariable("AM2RLAUNCHERDATA");
if (!String.IsNullOrWhiteSpace(am2rLauncherDataEnvVar))
{
try
{
// This will create the directories recursively if they don't exist
Directory.CreateDirectory(am2rLauncherDataEnvVar);
// Our env var is now set and directories exist
return am2rLauncherDataEnvVar;
}
catch { }
}
// First check if XDG_DATA_HOME is set, if not we'll use ~/.local/share
string xdgDataHome = Environment.GetEnvironmentVariable("XDG_DATA_HOME");
if (string.IsNullOrWhiteSpace(xdgDataHome))
xdgDataHome = NIXHOME + "/.local/share";
// Add AM2RLauncher to the end of the dataPath
xdgDataHome += "/AM2RLauncher";
try
{
// This will create the directories recursively if they don't exist
Directory.CreateDirectory(xdgDataHome);
// Our env var is now set and directories exist
return xdgDataHome;
}
catch { }
return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
}
} }
} }

@ -19,7 +19,7 @@ namespace AM2RLauncher.Gtk.Properties {
// -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
// Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
// mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -67,14 +67,14 @@ namespace AM2RLauncher.Gtk.Properties {
/// <appender-ref ref="file" /> /// <appender-ref ref="file" />
/// </root> /// </root>
/// <appender name="file" type="log4net.Appender.RollingFileAppender"> /// <appender name="file" type="log4net.Appender.RollingFileAppender">
/// <file value="${HOME}/.local/share/AM2RLauncher/Logs/AM2RLauncher.log" /> /// <file value="${DATADIR}/Logs/AM2RLauncher.log" />
/// <appendToFile value="true" /> /// <appendToFile value="true" />
/// <rollingStyle value="Once" /> /// <rollingStyle value="Once" />
/// <maxSizeRollBackups value="7" /> /// <maxSizeRollBackups value="7" />
/// <maximumFileSize value="3MB" /> /// <maximumFileSize value="3MB" />
/// <staticLogFileName value="true" /> /// <staticLogFileName value="true" />
/// <layout type="log4net.Layout.PatternLayout"> /// <layout type="log4net.Layout.PatternLayout">
/// <conversionPattern value="%date [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt. /// <conversionPattern value="%date [%thread] %level %logg [Rest der Zeichenfolge wurde abgeschnitten]"; ähnelt.
/// </summary> /// </summary>
internal static string log4netContents { internal static string log4netContents {
get { get {

@ -124,7 +124,7 @@
&lt;appender-ref ref="file" /&gt; &lt;appender-ref ref="file" /&gt;
&lt;/root&gt; &lt;/root&gt;
&lt;appender name="file" type="log4net.Appender.RollingFileAppender"&gt; &lt;appender name="file" type="log4net.Appender.RollingFileAppender"&gt;
&lt;file value="${HOME}/.local/share/AM2RLauncher/Logs/AM2RLauncher.log" /&gt; &lt;file value="${DATADIR}/Logs/AM2RLauncher.log" /&gt;
&lt;appendToFile value="true" /&gt; &lt;appendToFile value="true" /&gt;
&lt;rollingStyle value="Once" /&gt; &lt;rollingStyle value="Once" /&gt;
&lt;maxSizeRollBackups value="7" /&gt; &lt;maxSizeRollBackups value="7" /&gt;

@ -1,14 +1,14 @@
using Eto.Forms; using Eto.Forms;
using System;
using log4net; using log4net;
using log4net.Config; using log4net.Config;
using System;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
namespace AM2RLauncher.Wpf namespace AM2RLauncher.Wpf
{ {
/// <summary> /// <summary>
/// The main class for the GTK project. /// The main class for the WinForms project.
/// </summary> /// </summary>
class MainClass class MainClass
{ {
@ -17,13 +17,13 @@ namespace AM2RLauncher.Wpf
/// </summary> /// </summary>
private static readonly ILog log = LogManager.GetLogger(typeof(MainForm)); private static readonly ILog log = LogManager.GetLogger(typeof(MainForm));
/// <summary> /// <summary>
/// The main method for the GTK project. /// The main method for the WinForms project.
/// </summary> /// </summary>
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
// Configure logger // Configure logger
XmlConfigurator.Configure(new FileInfo(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "/log4net.config")); XmlConfigurator.Configure(new FileInfo(GenerateCurrentPath() + "/log4net.config"));
// Try catch in case it ever crashes before actually getting to the Eto application // Try catch in case it ever crashes before actually getting to the Eto application
try try
@ -49,5 +49,26 @@ namespace AM2RLauncher.Wpf
log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString()); log.Error("An unhandled exception has occurred: \n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString());
MessageBox.Show(Language.Text.UnhandledException + "\n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString(), "Microsoft .NET Framework", MessageBoxType.Error); MessageBox.Show(Language.Text.UnhandledException + "\n*****Stack Trace*****\n\n" + e.ExceptionObject.ToString(), "Microsoft .NET Framework", MessageBoxType.Error);
} }
// This is a duplicate of CrossPlatformOperations.GenerateCurrentPath, because trying to invoke that would cause a crash due to currentPlatform not being initialized.
private static string GenerateCurrentPath()
{
// First, we check if the user has a custom AM2RLAUNCHERDATA env var
string am2rLauncherDataEnvVar = Environment.GetEnvironmentVariable("AM2RLAUNCHERDATA");
if (!String.IsNullOrWhiteSpace(am2rLauncherDataEnvVar))
{
try
{
// This will create the directories recursively if they don't exist
Directory.CreateDirectory(am2rLauncherDataEnvVar);
// Our env var is now set and directories exist
return am2rLauncherDataEnvVar;
}
catch { }
}
// Windows has the path where the exe is located as default
return Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
}
} }
} }

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16 # Visual Studio Version 17
VisualStudioVersion = 16.0.31005.135 VisualStudioVersion = 17.0.31912.275
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AM2RLauncher", "AM2RLauncher\AM2RLauncher.csproj", "{9B67055C-5AEF-4F83-AFE0-38E600183C9F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AM2RLauncher", "AM2RLauncher\AM2RLauncher.csproj", "{9B67055C-5AEF-4F83-AFE0-38E600183C9F}"
EndProject EndProject

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<ApplicationIcon>icon64.ico</ApplicationIcon> <ApplicationIcon>Resources\LauncherIcon.ico</ApplicationIcon>
<Authors>Lojemiru, Miepee</Authors> <Authors>Lojemiru, Miepee</Authors>
<Company>AM2R-Community-Developers</Company> <Company>AM2R-Community-Developers</Company>
<Description>This is a Launcher for AM2R and its Community Updates.</Description> <Description>This is a Launcher for AM2R and its Community Updates.</Description>
@ -19,6 +19,10 @@
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Include="Resources\LauncherIcon.ico" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Eto.Forms" Version="2.5.11" /> <PackageReference Include="Eto.Forms" Version="2.5.11" />
<PackageReference Include="LibGit2Sharp" Version="0.26.2" /> <PackageReference Include="LibGit2Sharp" Version="0.26.2" />
@ -75,4 +79,10 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="../../LICENSE">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

@ -1,21 +1,19 @@
using Eto; using Eto;
using Eto.Forms; using log4net;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Configuration; using System.Configuration;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using log4net;
namespace AM2RLauncher namespace AM2RLauncher
{ {
/// <summary> /// <summary>
/// Class that does Operations that work cross-platform. /// Class that does Operations that work cross-platform.
/// </summary> /// </summary>
class CrossPlatformOperations public class CrossPlatformOperations
{ {
/// <summary> /// <summary>
/// The logger for <see cref="MainForm"/>, used to write any caught exceptions. /// The logger for <see cref="MainForm"/>, used to write any caught exceptions.
@ -25,17 +23,27 @@ namespace AM2RLauncher
/// <summary> /// <summary>
/// Gets the current platform. /// Gets the current platform.
/// </summary> /// </summary>
readonly private static Platform currentPlatform = Platform.Instance; private static readonly Platform currentPlatform = Platform.Instance;
/// <summary> /// <summary>
/// Current Path where the Launcher is located. For more info, check <see cref="GenerateCurrentPath"/>. /// Current Path where the Launcher is located. For more info, check <see cref="GenerateCurrentPath"/>.
/// </summary> /// </summary>
static readonly public string CURRENTPATH = GenerateCurrentPath(); public static readonly string CURRENTPATH = GenerateCurrentPath();
/// <summary> /// <summary>
/// Name of the Launcher executable. /// Name of the Launcher executable.
/// </summary> /// </summary>
static readonly public string LAUNCHERNAME = AppDomain.CurrentDomain.FriendlyName; public static readonly string LAUNCHERNAME = AppDomain.CurrentDomain.FriendlyName;
/// <summary>
/// Path to the Home Folder on *Nix-based systems.
/// </summary>
public static readonly string NIXHOME = Environment.GetEnvironmentVariable("HOME");
/// <summary>
/// Path to the Config folder on *Nix-based systems.
/// </summary>
public static readonly string NIXXDGCONFIG = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME");
/// <summary> /// <summary>
/// Generates the mirror list, depending on the current Platform. /// Generates the mirror list, depending on the current Platform.
@ -82,9 +90,8 @@ namespace AM2RLauncher
if (currentPlatform.IsGtk) if (currentPlatform.IsGtk)
{ {
// Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config) // Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config)
string homePath = Environment.GetEnvironmentVariable("HOME"); string homePath = NIXHOME;
string xdgConfigHome = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME"); string launcherConfigPath = (String.IsNullOrWhiteSpace(NIXXDGCONFIG) ? (homePath + "/.config") : NIXXDGCONFIG) + "/AM2RLauncher";
string launcherConfigPath = (String.IsNullOrWhiteSpace(xdgConfigHome) ? (homePath + "/.config") : xdgConfigHome) + "/AM2RLauncher";
string launcherConfigFilePath = launcherConfigPath + "/config.xml"; string launcherConfigFilePath = launcherConfigPath + "/config.xml";
XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML(); XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML();
@ -130,9 +137,8 @@ namespace AM2RLauncher
else if (currentPlatform.IsGtk) else if (currentPlatform.IsGtk)
{ {
// Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config) // Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config)
string homePath = Environment.GetEnvironmentVariable("HOME"); string homePath = NIXHOME;
string xdgConfigHome = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME"); string launcherConfigPath = (String.IsNullOrWhiteSpace(NIXXDGCONFIG) ? (homePath + "/.config") : NIXXDGCONFIG) + "/AM2RLauncher";
string launcherConfigPath = (String.IsNullOrWhiteSpace(xdgConfigHome) ? (homePath + "/.config") : xdgConfigHome) + "/AM2RLauncher";
string launcherConfigFilePath = launcherConfigPath + "/config.xml"; string launcherConfigFilePath = launcherConfigPath + "/config.xml";
XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML(); XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML();
@ -179,9 +185,8 @@ namespace AM2RLauncher
else if (currentPlatform.IsGtk) else if (currentPlatform.IsGtk)
{ {
// Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config) // Config for nix systems will be saved in XDG_CONFIG_HOME/AM2RLauncher (or if empty, ~/.config)
string homePath = Environment.GetEnvironmentVariable("HOME"); string homePath = NIXHOME;
string xdgConfigHome = Environment.GetEnvironmentVariable("XDG_CONFIG_HOME"); string launcherConfigPath = (String.IsNullOrWhiteSpace(NIXXDGCONFIG) ? (homePath + "/.config") : NIXXDGCONFIG) + "/AM2RLauncher";
string launcherConfigPath = (String.IsNullOrWhiteSpace(xdgConfigHome) ? (homePath + "/.config") : xdgConfigHome) + "/AM2RLauncher";
string launcherConfigFilePath = launcherConfigPath + "/config.xml"; string launcherConfigFilePath = launcherConfigPath + "/config.xml";
XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML(); XML.LauncherConfigXML launcherConfig = new XML.LauncherConfigXML();
@ -212,7 +217,7 @@ namespace AM2RLauncher
// We have to replace forward slashes with backslashes here on windows because explorer.exe is picky... // We have to replace forward slashes with backslashes here on windows because explorer.exe is picky...
// And on Nix systems, we want to replace ~ with its corresponding env var // And on Nix systems, we want to replace ~ with its corresponding env var
string realPath = currentPlatform.IsWinForms ? Environment.ExpandEnvironmentVariables(path).Replace("/", "\\") string realPath = currentPlatform.IsWinForms ? Environment.ExpandEnvironmentVariables(path).Replace("/", "\\")
: path.Replace("~", Environment.GetEnvironmentVariable("HOME")); : path.Replace("~", NIXHOME);
if (!Directory.Exists(realPath)) if (!Directory.Exists(realPath))
{ {
log.Info(realPath + " did not exist and was created"); log.Info(realPath + " did not exist and was created");
@ -238,7 +243,7 @@ namespace AM2RLauncher
// We have to replace forward slashes with backslashes here on windows because explorer.exe is picky... // We have to replace forward slashes with backslashes here on windows because explorer.exe is picky...
// And on nix systems, we want to replace ~ with its corresponding env var // And on nix systems, we want to replace ~ with its corresponding env var
string realPath = currentPlatform.IsWinForms ? Environment.ExpandEnvironmentVariables(path).Replace("/", "\\") string realPath = currentPlatform.IsWinForms ? Environment.ExpandEnvironmentVariables(path).Replace("/", "\\")
: path.Replace("~", Environment.GetEnvironmentVariable("HOME")); : path.Replace("~", NIXHOME);
if (!File.Exists(realPath)) if (!File.Exists(realPath))
{ {
log.Error(realPath + "did not exist, operation to open its folder was cancelled!"); log.Error(realPath + "did not exist, operation to open its folder was cancelled!");
@ -273,16 +278,16 @@ namespace AM2RLauncher
arguments = "-version"; arguments = "-version";
} }
ProcessStartInfo javaStart = new ProcessStartInfo(); ProcessStartInfo javaStart = new ProcessStartInfo
javaStart.FileName = process; {
javaStart.Arguments = arguments; FileName = process,
javaStart.UseShellExecute = false; Arguments = arguments,
javaStart.CreateNoWindow = true; UseShellExecute = false,
CreateNoWindow = true
};
Process java = new Process();
java.StartInfo = javaStart; Process java = new Process { StartInfo = javaStart };
// This is primarily for linux, but could be happening on windows as well // This is primarily for linux, but could be happening on windows as well
try try
@ -297,7 +302,6 @@ namespace AM2RLauncher
} }
return java.ExitCode == 0; return java.ExitCode == 0;
} }
/// <summary> /// <summary>
@ -309,16 +313,16 @@ namespace AM2RLauncher
string process = "xdelta3"; string process = "xdelta3";
string arguments = "-V"; string arguments = "-V";
ProcessStartInfo xdeltaStart = new ProcessStartInfo(); ProcessStartInfo xdeltaStart = new ProcessStartInfo
xdeltaStart.FileName = process; {
xdeltaStart.Arguments = arguments; FileName = process,
xdeltaStart.UseShellExecute = false; Arguments = arguments,
xdeltaStart.CreateNoWindow = true; UseShellExecute = false,
CreateNoWindow = true
};
Process xdelta = new Process();
xdelta.StartInfo = xdeltaStart; Process xdelta = new Process { StartInfo = xdeltaStart };
try try
{ {
@ -438,7 +442,7 @@ namespace AM2RLauncher
if (string.IsNullOrWhiteSpace(xdgDataHome)) if (string.IsNullOrWhiteSpace(xdgDataHome))
{ {
log.Info("Using default Linux CurrentPath."); log.Info("Using default Linux CurrentPath.");
xdgDataHome = Environment.GetEnvironmentVariable("HOME") + "/.local/share"; xdgDataHome = NIXHOME + "/.local/share";
} }
// Add AM2RLauncher to the end of the dataPath // Add AM2RLauncher to the end of the dataPath

@ -1,16 +1,11 @@
using Eto; using AM2RLauncher.Helpers;
using Eto;
using Eto.Forms; using Eto.Forms;
using log4net;
using System; using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Linq;
using System.Net; using System.Net;
using System.Reflection;
using System.Text;
using log4net;
using AM2RLauncher.Helpers;
namespace AM2RLauncher namespace AM2RLauncher
{ {
@ -45,8 +40,6 @@ namespace AM2RLauncher
{ {
log.Info("Running update check..."); log.Info("Running update check...");
string version = VERSION.Replace(".", "");
// Update section // Update section
// Clean old files that have been left // Clean old files that have been left

@ -1,5 +1,5 @@
using Eto.Forms; using Eto.Drawing;
using Eto.Drawing; using Eto.Forms;
using Pablo.Controls; using Pablo.Controls;
namespace AM2RLauncher namespace AM2RLauncher

@ -1,6 +1,6 @@
using System; using Eto.Drawing;
using Eto.Forms; using Eto.Forms;
using Eto.Drawing; using System;
namespace Pablo.Controls namespace Pablo.Controls
{ {

@ -1,10 +1,8 @@
using log4net; using log4net;
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text;
namespace AM2RLauncher.Helpers namespace AM2RLauncher.Helpers
{ {

@ -1,7 +1,5 @@
using System; using Eto.Drawing;
using System.Collections.Generic; using System;
using System.Text;
using Eto.Drawing;
namespace Pablo.Controls namespace Pablo.Controls
{ {

@ -1,26 +1,18 @@
using Eto; using AM2RLauncher.Helpers;
using Eto.Drawing; using AM2RLauncher.XML;
using Eto;
using Eto.Forms; using Eto.Forms;
using System;
using System.Collections.Generic;
using System.Text;
using Pablo.Controls;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using LibGit2Sharp; using LibGit2Sharp;
using LibGit2Sharp.Handlers;
using System;
using System.ComponentModel;
using System.IO; using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibGit2Sharp.Handlers;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.ComponentModel; using System.Threading.Tasks;
using System.Net;
using System.IO.Compression;
using AM2RLauncher.XML;
using AM2RLauncher.Helpers;
namespace AM2RLauncher namespace AM2RLauncher
{ {

@ -1,21 +1,16 @@
using System; using AM2RLauncher.Helpers;
using System.Collections.Generic; using AM2RLauncher.XML;
using System.Text; using Eto;
using Eto.Drawing;
using Eto.Forms; using Eto.Forms;
using System.Threading;
using LibGit2Sharp; using LibGit2Sharp;
using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using Eto;
using System.Diagnostics;
using System.Linq; using System.Linq;
using Eto.Drawing;
using System.Xml.Serialization;
using AM2RLauncher.XML;
using System.Net.NetworkInformation;
using System.Net;
using AM2RLauncher.Helpers;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
namespace AM2RLauncher namespace AM2RLauncher
{ {
@ -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
string savePath = Platform.IsWinForms ? profile.SaveLocation.Replace("%localappdata%", Environment.GetEnvironmentVariable("LOCALAPPDATA")) string savePath = Platform.IsWinForms ? profile.SaveLocation.Replace("%localappdata%", Environment.GetEnvironmentVariable("LOCALAPPDATA"))
: profile.SaveLocation.Replace("~", Environment.GetEnvironmentVariable("HOME")); : profile.SaveLocation.Replace("~", CrossPlatformOperations.NIXHOME);
DirectoryInfo logDir = new DirectoryInfo(savePath + "/logs"); DirectoryInfo logDir = new DirectoryInfo(savePath + "/logs");
string date = string.Join("-", DateTime.Now.ToString().Split(Path.GetInvalidFileNameChars(), StringSplitOptions.RemoveEmptyEntries)); string date = string.Join("-", DateTime.Now.ToString().Split(Path.GetInvalidFileNameChars(), StringSplitOptions.RemoveEmptyEntries));

@ -1,17 +1,16 @@
using Eto.Drawing; using AM2RLauncher.XML;
using Eto.Drawing;
using Eto.Forms; using Eto.Forms;
using log4net;
using Pablo.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using Pablo.Controls; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading;
using System.Globalization;
using AM2RLauncher.XML;
using log4net;
using log4net.Config;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading;
namespace AM2RLauncher namespace AM2RLauncher
{ {

@ -1,6 +1,5 @@
using Eto; using Eto;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace AM2RLauncher namespace AM2RLauncher

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

@ -1,10 +1,6 @@
using System; using System;
using System.Reflection;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using System.Linq; using System.Linq;
using System.ComponentModel; using System.Xml.Serialization;
namespace AM2RLauncher.XML namespace AM2RLauncher.XML
{ {

@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace AM2RLauncher.XML namespace AM2RLauncher.XML

@ -1,9 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using System.Text; using System.Text;
namespace AM2RLauncher.XML namespace AM2RLauncher.XML

Loading…
Cancel
Save