Пример #1
0
        private bool ValidateGameRun(GameProfile gameProfile)
        {
            if (!File.Exists(gameProfile.GamePath))
            {
                MessageBox.Show($"Cannot find game exe at: {gameProfile.GamePath}", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            foreach (var file in RequiredFiles)
            {
                if (!File.Exists(file))
                {
                    MessageBox.Show($"Cannot find {file}", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(false);
                }
            }

            if (EmuBlacklist.CheckForBlacklist(Directory.GetFiles(Path.GetDirectoryName(gameProfile.GamePath))))
            {
                var errorMsg =
                    "Hold it right there!" + Environment.NewLine + "it seems you have other emulator already in use." + Environment.NewLine + "Please remove the following files from the game directory:" + Environment.NewLine;
                foreach (var fileName in EmuBlacklist.BlacklistedList)
                {
                    errorMsg += fileName + Environment.NewLine;
                }
                MessageBox.Show(errorMsg, "Validation error", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            if (File.Exists(Path.Combine(gameProfile.GamePath, "iDmacDrv32.dll")))
            {
                var description = FileVersionInfo.GetVersionInfo("iDmacDrv32.dll");
                if (description.FileDescription != "PCI-Express iDMAC Driver Library (DLL)")
                {
                    return(MessageBox.Show("You seem to be using an unofficial iDmacDrv32.dll file! This game may crash or be unstable. Continue?", "Warning", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes);
                }
            }

            return(true);
        }
Пример #2
0
        private bool ValidateGameRun(GameProfile gameProfile)
        {
            if (!File.Exists(gameProfile.GamePath))
            {
                MessageBox.Show($"Cannot find game exe at: {gameProfile.GamePath}", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("OpenParrot.dll"))
            {
                MessageBox.Show($"Cannot find OpenParrot.dll", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("OpenParrot64.dll"))
            {
                MessageBox.Show($"Cannot find OpenParrot64.dll", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("OpenParrotLoader.exe"))
            {
                MessageBox.Show($"Cannot find OpenParrotLoader.exe", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("OpenParrotLoader64.exe"))
            {
                MessageBox.Show($"Cannot find OpenParrotLoader64.exe", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("ParrotLoader.exe"))
            {
                MessageBox.Show($"Cannot find ParrotLoader.exe", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("ParrotLoader64.exe"))
            {
                MessageBox.Show($"Cannot find ParrotLoader64.exe", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("BudgieLoader.exe"))
            {
                MessageBox.Show($"Cannot find BudgieLoader.exe", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("TeknoParrot.dll"))
            {
                MessageBox.Show($"Cannot find TeknoParrot.dll", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists("TeknoParrot64.dll"))
            {
                MessageBox.Show($"Cannot find TeknoParrot64.dll", "Error", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return(false);
            }

            if (!File.Exists(""))
            {
                if (EmuBlacklist.CheckForBlacklist(Directory.GetFiles(Path.GetDirectoryName(gameProfile.GamePath))))
                {
                    var errorMsg =
                        "Hold it right there!" + Environment.NewLine + "it seems you have other emulator already in use." + Environment.NewLine + "Please remove the following files from the game directory:" + Environment.NewLine;
                    foreach (var fileName in EmuBlacklist.BlacklistedList)
                    {
                        errorMsg += fileName + Environment.NewLine;
                    }
                    MessageBox.Show(errorMsg, "Validation error", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(false);
                }
            }

            return(true);
        }