-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
59 lines (47 loc) · 1.62 KB
/
Copy pathForm1.cs
File metadata and controls
59 lines (47 loc) · 1.62 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
using Microsoft.Win32;
using System;
using System.IO;
using System.Windows.Forms;
namespace Red_Dead_Redemption_2_Türkçe_Yama
{
public partial class Form1 : Form
{
private const string REG_PATH = @"Software\RDR2CeviriAraci";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
lblInfo.Text = "Lütfen RDR2.exe dosyasını seçin.";
}
private void btnSelectExe_Click(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog())
{
ofd.Title = "RDR2.exe dosyasını seçin";
ofd.Filter = "RDR2 Çalıştırılabilir|RDR2.exe|Tüm Dosyalar|*.*";
if (ofd.ShowDialog() == DialogResult.OK)
{
if (!ofd.FileName.EndsWith("RDR2.exe", StringComparison.OrdinalIgnoreCase))
{
MessageBox.Show("Lütfen doğru dosyayı seçin (RDR2.exe)");
return;
}
string gamePath = Path.GetDirectoryName(ofd.FileName);
SaveGamePath(gamePath);
var f2 = new Form2(gamePath);
f2.StartPosition = FormStartPosition.CenterScreen;
f2.Show();
this.Close();
}
}
}
private void SaveGamePath(string path)
{
var key = Registry.CurrentUser.CreateSubKey(REG_PATH);
key.SetValue("GamePath", path);
key.Close();
}
}
}