public InstallForm()
{
InitializeComponent();
// Check for BF2 Client Installation (32 bit)
try
{
ClientInstallPath = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA Games\Battlefield 2",
"InstallDir",
String.Empty).ToString();
ClientPath.Text = ClientInstallPath;
}
catch(IOException) // Entry Doesnt Exist, Try 64 Bit Installation
{
try
{
ClientInstallPath = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Electronic Arts\EA Games\Battlefield 2",
"InstallDir",
String.Empty).ToString();
ClientPath.Text = ClientInstallPath;
}
catch { }
}
catch { }
// Check for BF2 Server Installation (32 bit)
try
{
ServerInstallPath = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\SOFTWARE\EA Games\Battlefield 2 Server",
"GAMEDIR",
String.Empty).ToString();
ServerPath.Text = ServerInstallPath;
}
catch (IOException) // Entry Doesnt Exist, Try 64 Bit Installation
{
try
{
ServerInstallPath = Registry.GetValue(
@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\EA Games\Battlefield 2 Server",
"GAMEDIR",
String.Empty).ToString();
ServerPath.Text = ServerInstallPath;
}
catch { }
}
catch { }
// Update Checker
UpdateCheckBox.Checked = Program.Config.UpdateCheck;
}