/// <summary> /// Determines whether the game is installed. /// </summary> /// <returns><c>true</c> if the game is installed; otherwise, <c>false</c>.</returns> public bool IsGameInstalled() { //Criteria for considering the game 'installed' //Does the game directory exist? bool bHasDirectory = Directory.Exists(Config.GetGamePath()); //Is there an .install file in the directory? bool bHasInstallationCookie = File.Exists(ConfigHandler.GetInstallCookiePath()); //is there a version file? bool bHasGameVersion = File.Exists(Config.GetGameVersionPath()); //If any of these criteria are false, the game is not considered fully installed. return(bHasDirectory && bHasInstallationCookie && IsInstallCookieEmpty() && bHasGameVersion); }
/// <summary> /// Determines whether the game is installed. /// </summary> /// <returns><c>true</c> if the game is installed; otherwise, <c>false</c>.</returns> public bool IsGameInstalled() { // Criteria for considering the game 'installed' // Does the game directory exist? bool bHasGameDirectory = Directory.Exists(Configuration.GetGamePath()); // Is there an .install file in the directory? bool bHasInstallationCookie = File.Exists(ConfigHandler.GetGameCookiePath()); // Is there a version file? bool bHasGameVersion = File.Exists(Configuration.GetGameVersionPath()); if (!bHasGameVersion && bHasGameDirectory) { Log.Warn("No GameVersion.txt file was found in the installation directory.\n" + "This may be due to a download error, or the develop may not have included one.\n" + "Without it, the game cannot be considered fully installed.\n" + "If you are the developer of this game, add one to your game files with your desired version in it."); } // If any of these criteria are false, the game is not considered fully installed. return(bHasGameDirectory && bHasInstallationCookie && IsInstallCookieEmpty() && bHasGameVersion); }