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

feat: Delete old version when updating mod #401

Closed
wants to merge 3 commits into from

Conversation

GeckoEidechse
Copy link
Member

@GeckoEidechse GeckoEidechse commented Jun 29, 2023

Deletes all Northstar mods based on Thunderstore mod string before installing new version. This way we can clean up old files from mods before installing new version.

Note that the deletion is purposefully only done right before mod is extracted from install. This means it has already been downloaded. This is done to avoid the case where due to a slow internet connection an install fails but the old version of the mod is already removed due to the new logic.

Closes #408

Deletes all Northstar mods based on Thunderstore mod string before
installing new version.

This way we can clean up old files from mods before installing new
version
@GeckoEidechse GeckoEidechse added the enhancement New feature or request label Jun 29, 2023
@GeckoEidechse
Copy link
Member Author

Right now there's no way to tell in this part of the code whether we are dealing with an update or an install. Maybe we should refactor code to pass an argument that tells whether we are installing or updating?

@GeckoEidechse
Copy link
Member Author

(Haven't actually tested yet)

@GeckoEidechse
Copy link
Member Author

Tested with https://northstar.thunderstore.io/package/Creamy_jpg/Customisable_Reticles_Framework/ which seems to work.

Although I need to check what happens if the update to install is incorrectly formatted. Pretty sure it just nukes the mod then but fails to install the new one...

@GeckoEidechse
Copy link
Member Author

Although I need to check what happens if the update to install is incorrectly formatted. Pretty sure it just nukes the mod then but fails to install the new one...

Yup just tested with https://northstar.thunderstore.io/package/ScureX/ModCreator/ by manually putting it into mod folders, setting it up to look like older version and then trying to "update" it.

The result is that the old version gets remove but the new one fails to install which shouldn't happen IMO.

If the update fails, it should just keep the old version installed. Not sure what the best approach is here to achieve that... Any help would be appreciated <3

@GeckoEidechse
Copy link
Member Author

With R2Northstar/NorthstarLauncher#503 this PR in its current state won't be necessary anymore

@GeckoEidechse GeckoEidechse marked this pull request as draft July 15, 2023 13:29
@GeckoEidechse
Copy link
Member Author

Closed by #415

@GeckoEidechse GeckoEidechse deleted the feat/delete-old-mode-before-update branch November 15, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete old version of mod when updating
1 participant