Skip to content

Conversation

@undead2146
Copy link
Member

This PR fixes the GameInstalation not being detected for CDISO whereby users do not have a Instal Dir registry entry.

  • Fixed game recognition for CD/ISO installations.
  • Added manual directory selection fallback.
  • Added missing Zero Hour retail paths.
  • Updated .gitignore for releases.

@undead2146 undead2146 force-pushed the fix/cdiso-detection branch 3 times, most recently from 200d051 to 0bd3bb0 Compare December 28, 2025 21:57
@undead2146 undead2146 changed the base branch from main to development December 28, 2025 21:57
- Fixed game recognition for CD/ISO installations.
- Added manual directory selection fallback.
- Added missing Zero Hour retail paths.
- Updated .gitignore for releases.
/// <param name="directory">The directory to check.</param>
/// <param name="executableNames">The list of executable names to look for.</param>
/// <returns>True if any of the executables exist.</returns>
private static bool HasAnyExecutable(string directory, string[] executableNames)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole method is basically just this, but much more verbose:

private static bool HasAnyExecutable(string directory, string[] executableNames) =>
    executableNames.Any(exe => File.Exists(Path.Combine(directory, exe)));

Do you still need a separate method for it? I'd only do so if you use it in multiple places.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the method since it wasn't needed and just bloated more

return installation;
}
}
else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This else block is entirely redundant as you are already doing a return from the if on line 1570. I think this could would make more sense / be more readable if the else block was removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it up now so it gets reached.

Copy link
Member Author

@undead2146 undead2146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed the code review comments

/// <param name="directory">The directory to check.</param>
/// <param name="executableNames">The list of executable names to look for.</param>
/// <returns>True if any of the executables exist.</returns>
private static bool HasAnyExecutable(string directory, string[] executableNames)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the method since it wasn't needed and just bloated more

return installation;
}
}
else
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it up now so it gets reached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants