Implement first version of wotking auto-update

I still can't believe this hackish thing works
This commit is contained in:
JustArchi
2017-07-01 06:10:15 +02:00
parent fc1493d0a3
commit 2140fcedc2
4 changed files with 64 additions and 45 deletions

View File

@@ -124,8 +124,13 @@ namespace ArchiSteamFarm {
return;
}
string executable = Process.GetCurrentProcess().MainModule.FileName;
string executableName = Path.GetFileNameWithoutExtension(executable);
IEnumerable<string> arguments = Environment.GetCommandLineArgs().Skip(executableName.Equals(SharedInfo.AssemblyName) ? 1 : 0);
try {
Process.Start(Assembly.GetEntryAssembly().Location, string.Join(" ", Environment.GetCommandLineArgs().Skip(1)));
Process.Start(executable, string.Join(" ", arguments));
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}