private bool SetMPCHCLocation()
{
string pFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
dlg.Filter = "MPC-HC main executable|mpc-hc.exe;mpc-hc64.exe";
dlg.InitialDirectory = (System.IO.Directory.Exists(pFilesPath + @"\Media Player Classic - Home Cinema") ?
pFilesPath + @"\Media Player Classic - Home Cinema" : pFilesPath);
Nullable <bool> result = dlg.ShowDialog();
if (result == true)
{
if (System.IO.Path.GetFileNameWithoutExtension(dlg.FileName) == "mpc-hc64" && IntPtr.Size == 4)
{
MessageBox.Show("Media Player Classic - Home Cinema 64bit will not work\nwith the 32bit version of " + MainWindow.m_AppName + ".\n\n" +
"Please use the 64bit version of " + MainWindow.m_AppName + ".\nOr use the 32bit version of Media Player Classic - Home Cinema.",
"Alert!", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
else
{
ConfigFile.Write("mpcPath", dlg.FileName);
return(true);
}
}
return(false);
}