-
Notifications
You must be signed in to change notification settings - Fork 17
/
Program.cs
91 lines (71 loc) · 2.37 KB
/
Program.cs
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DualSenseAT
{
static class Program
{
public static void RunSetup()
{
if (!Directory.Exists(Constants.TEMP_PATH))
Directory.CreateDirectory(Constants.TEMP_PATH);
using (WebClient wclient = new WebClient())
{
wclient.DownloadFile(Constants.BASE_URL + "\\Localizations.zip", Constants.TEMP_PATH + "\\Localizations.zip");
try
{
ZipFile.ExtractToDirectory(Constants.TEMP_PATH + "\\Localizations.zip", Constants.LANG_PATH);
}
catch
{
}
}
Application.Run(new SetupWindow());
}
/// <summary>
/// Ponto de entrada principal para o aplicativo.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//debug purposes
Session.SteamData.vanityUrl = "SayoriBR";
Session.SteamData.webApiKey = "1E393413595E51AAC284177A39FEE6E6";
//Resolve steamID64
Functions.apiFunctions.loadSteamData();
//MessageBox.Show(Session.SteamData.UserData.SteamID64);
//Application.Run(new MainWindowV3());
//return for tests
// return;
var Settings = new IniFile(Constants.TEMP_PATH + "\\DualSenseAT_settings.ini");
UserPreferences.LANG_CODE = Settings.Read("Lang");
#if (DEBUG)
//Set Default Lang for Debug
//UserPreferences.LANG_CODE = "en_US";
#endif
if (!Directory.Exists(Constants.BASE_TEMP_PATH))
{
Directory.CreateDirectory(Constants.BASE_TEMP_PATH);
RunSetup();
}
else
{
if (Settings.Read("is_installed") == "true")
{
Application.Run(new SplashWindow());
}
else
{
RunSetup();
}
}
}
}
}