This commit is contained in:
2022-10-01 17:14:19 +03:00
parent 6d73ec7f24
commit a39f7bb0c9
2 changed files with 5 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
<StartupObject /> <StartupObject />
<SignAssembly>False</SignAssembly> <SignAssembly>False</SignAssembly>
<IsPublishable>True</IsPublishable> <IsPublishable>True</IsPublishable>
<AssemblyVersion>1.0.0.14</AssemblyVersion> <AssemblyVersion>1.0.0.13</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -401,16 +401,13 @@ public class Program
else else
{ {
string url = $"https://github.com/Wizzy69/SethDiscordBot/releases/download/v{newVersion}/net6.0_linux.zip"; string url = $"https://github.com/Wizzy69/SethDiscordBot/releases/download/v{newVersion}/net6.0_linux.zip";
Console_Utilities.ProgressBar bar = new Console_Utilities.ProgressBar(ProgressBarType.NO_END); Console.WriteLine("Downloading update ...");
bar.Start();
await ServerCom.DownloadFileNoProgressAsync(url, "./update.zip"); await ServerCom.DownloadFileNoProgressAsync(url, "./update.zip");
await Functions.ExtractArchive("./update.zip", "./", null, UnzipProgressType.PercentageFromNumberOfFiles); await File.WriteAllTextAsync("Install.sh", "#!/bin/bash\nunzip -qq update.zip -d ./\nrm update.zip\nchmod +x SethDiscordBot\n./DiscordBot");
bar.Stop("Console is now Updated"); Process.Start("Install.sh").WaitForExit();
Environment.Exit(0);
Process.Start("./DiscordBot /procKill " + Process.GetCurrentProcess().Id);
} }
//Environment.Exit(0);
} }
break; break;