-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (37 loc) · 1.05 KB
/
Copy pathProgram.cs
File metadata and controls
42 lines (37 loc) · 1.05 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
using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Win32;
namespace Red_Dead_Redemption_2_Türkçe_Yama
{
internal static class Program
{
private const string REG_PATH = @"Software\RDR2CeviriAraci";
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string gamePath = LoadGamePath();
if (!string.IsNullOrEmpty(gamePath) && Directory.Exists(gamePath))
{
Application.Run(new Form2(gamePath));
}
else
{
Application.Run(new Form1());
}
}
private static string LoadGamePath()
{
var key = Registry.CurrentUser.OpenSubKey(REG_PATH);
if (key != null)
{
string value = key.GetValue("GamePath") as string;
key.Close();
return value ?? "";
}
return "";
}
}
}