This repository was archived by the owner on Sep 28, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
72 lines (63 loc) · 2.09 KB
/
Copy pathProgram.cs
File metadata and controls
72 lines (63 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.ApplicationLifetimes;
using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;
namespace DiscordMultiTool;
internal class Program
{
[STAThread]
public static void Main(string[] args)
{
try
{
Task.Run(InitializeAsync);
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
catch (Exception ex)
{
Console.WriteLine("CRITICAL ERROR: " + ex.ToString());
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
public static AppBuilder BuildAvaloniaApp() =>
AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
private static async Task InitializeAsync()
{
try
{
string folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".dmt");
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
string guiPath = Path.Combine(folder, "GUI.png");
string overlayPath = Path.Combine(folder, "Overlay.py");
string guiUrl = "https://github.com/CodeSharp3210/DiscordMultiTool/releases/download/DMT-2.5.6/GUI.png";
string overlayUrl = "https://github.com/CodeSharp3210/DiscordMultiTool/releases/download/DMT-2.5.6/Overlay.py";
using var client = new HttpClient();
if (!File.Exists(guiPath))
{
try
{
var data = await client.GetByteArrayAsync(guiUrl);
await File.WriteAllBytesAsync(guiPath, data);
}
catch { }
}
if (!File.Exists(overlayPath))
{
try
{
var data = await client.GetByteArrayAsync(overlayUrl);
await File.WriteAllBytesAsync(overlayPath, data);
}
catch { }
}
}
catch { }
}
}