/// <summary> /// Attempts to automatically find a KSP install on this system. /// Returns the path to the install on success. /// Throws a DirectoryNotFoundException on failure. /// </summary> public static string FindGameDir() { // See if we can find KSP as part of a Steam install. string kspSteamPath = KSPPathUtils.KSPSteamPath(); if (kspSteamPath != null) { if (IsKspDir(kspSteamPath)) { return(kspSteamPath); } log.DebugFormat("Have Steam, but KSP is not at \"{0}\".", kspSteamPath); } // See if we can find a non-Steam Mac KSP install string kspMacPath = KSPPathUtils.KSPMacPath(); if (kspMacPath != null) { if (IsKspDir(kspMacPath)) { log.InfoFormat("Found a KSP install at {0}", kspMacPath); return(kspMacPath); } log.DebugFormat("Default Mac KSP folder exists at \"{0}\", but KSP is not installed there.", kspMacPath); } // Oh noes! We can't find KSP! throw new DirectoryNotFoundException(); }
/// <summary> /// Attempts to automatically find a KSP install on this system. /// Returns the path to the install on success. /// Throws a DirectoryNotFoundException on failure. /// </summary> public static string FindGameDir() { // See if we can find KSP as part of a Steam install. string ksp_steam_path = KSPPathUtils.KSPSteamPath(); if (ksp_steam_path != null) { if (IsFactorioDirectory(ksp_steam_path)) { return(ksp_steam_path); } log.DebugFormat("Have Steam, but Factorio is not at \"{0}\".", ksp_steam_path); } string autodetected = KSPPathUtils.DefaultPath(); if (autodetected != null) { if (IsFactorioDirectory(autodetected)) { return(autodetected); } log.DebugFormat("Directory exists, but Factorio is not at \"{0}\".", ksp_steam_path); } // Oh noes! We can't find KSP! throw new DirectoryNotFoundException(); }
/// <summary> /// Attempts to automatically find a KSP install on this system. /// Returns the path to the install on success. /// Throws a DirectoryNotFoundException on failure. /// </summary> public static string FindGameDir() { // See if we can find KSP as part of a Steam install. string kspSteamPath = KSPPathUtils.KSPSteamPath(); if (kspSteamPath != null) { if (IsKspDir(kspSteamPath)) { return(kspSteamPath); } log.DebugFormat("Have Steam, but KSP is not at \"{0}\".", kspSteamPath); } // Oh noes! We can't find KSP! throw new DirectoryNotFoundException(); }