Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check prefix folder is correct before deleting it #3989

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented Sep 1, 2024

This PR adds a few checks before deleting the prefix of a game to check that we don't delete the wrong thing:

  • if the path is the same as the game installation path, we don't delete it (would delete all games)
  • if the path is the same as the default/shared prefix path, we don't delete it (would delete all prefixes)
  • if the path does NOT contain a drive_c folder, we don't delete it (it's either not a prefix or there's something off in it)

I also used the opportunity to move some code into a new utils/uninstaller.ts file to make main.ts a bit smaller.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@arielj arielj added the pr:ready-for-review Feature-complete, ready for the grind! :P label Sep 1, 2024
@arielj arielj requested review from a team, flavioislima, CommandMC, Etaash-mathamsetty, Nocccer and imLinguin and removed request for a team September 1, 2024 18:02
if (dirContent.length > 0) {
const driveCPath = join(winePrefix, 'drive_c')

if (!existsSync(driveCPath)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that Proton prefixes (not using umu) will never have this folder. Maybe we also want to check for a pfx folder?

@arielj arielj force-pushed the sanity-checks-deleting-prefix branch from e1ec78e to 4e32010 Compare January 3, 2025 02:03
@arielj arielj requested a review from CommandMC January 3, 2025 02:03
@arielj arielj force-pushed the sanity-checks-deleting-prefix branch from 4e32010 to 301d142 Compare January 3, 2025 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:ready-for-review Feature-complete, ready for the grind! :P
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants