-
Notifications
You must be signed in to change notification settings - Fork 3
/
Files.cs
47 lines (39 loc) · 1.61 KB
/
Files.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
using System;
using System.Collections.Generic;
using System.Text;
using Nyerguds.Ini;
using System.IO;
using System.Windows.Forms;
namespace RedAlertConfig
{
class Files
{
public static IniFile RedAlertINI;
public static IniFile DDrawINI;
public static string Path_;
public static void Init()
{
char seperator = System.IO.Path.DirectorySeparatorChar;
Path_ = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
DDrawINI = new IniFile(Path_ + seperator + "ddraw.ini", false, BooleanMode.TRUE_FALSE, Encoding.Default);
RedAlertINI = new IniFile(Path_ + seperator + "redalert.ini", false, BooleanMode.YES_NO, Encoding.Default);
// Check_Required_File("ddraw.dll");
// Check_Required_File("ForceAMrules.ini");
// Check_Required_File("wsock32.dll");
// Check_Required_File("ForceAMRulesFastBuildSpeed.ini");
// Check_Required_File("ForceAMrules.ini");
}
public static void Check_Required_File(string file)
{
String path = Path_ + Path.DirectorySeparatorChar + "ConfigToolFiles"
+ Path.DirectorySeparatorChar + file;
if (!File.Exists(path))
{
MessageBox.Show(String.Format("File '{0}' can't be found in the ConfigToolFiles folder, " +
"this is a file neccessary for this application to run so please restore it.", file),
"Required data file not found");
Environment.Exit(0);
}
}
}
}