private void CheckForCommonIssues()
{
// Confirm that we do not have NWNX4 files in the root directory.
string[] xpFiles = Directory.GetFiles(NWN2InstallPath, "xp_*.dll");
if (xpFiles.Length > 0)
{
// Report the warning.
Program.LogEvent("WARNING: NWNX plugin files were found in the NWN2 install directory. These files are being moved to the a backup folder.");
// Ensure that the backup directory exists.
string BackupDirectory = NWN2InstallPath + "\\backup\\";
if (!Directory.Exists(BackupDirectory)) Directory.CreateDirectory(BackupDirectory);
// Move files.
foreach (string filename in xpFiles)
{
string destination = BackupDirectory + filename.Remove(0, NWN2InstallPath.Length + 1);
Program.LogEvent(string.Format("Moving '{0}' to '{1}'", filename, destination));
File.Move(filename, destination);
}
}
}