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: Support for the new packages folder #191

Merged
merged 27 commits into from
Jul 24, 2023
Merged

feat: Support for the new packages folder #191

merged 27 commits into from
Jul 24, 2023

Conversation

0neGal
Copy link
Owner

@0neGal 0neGal commented Jul 16, 2023

When finished this'll both add support for the new packages/ folder discussed at NorthstarLauncher #505 and simultaneously it'll also add support for installing plugins properly, discussed at FlightCore #288.

This PR is far from complete, and it's only currently here for the sake of tracking progress.

TODO

  • Basic management of packages
    • Enabling/Disabling packages
    • Detect and install dependencies
    • Remove older versions if they exist, i.e updating
    • Move packages in mods/ to packages/ when updating
    • Downloading, extracting, verifying and installing a package from a URL
    • Present warning/confirmation dialog when installing a package with plugins
  • Implement everything in the frontend
    • Toggling packages
    • Removing packages
    • Showing packages in the mod list
    • Installing of packages through mod browser
    • Updating of packages through mod list and mod browser
  • Localizations

Strings that need to be localized:

"gui.mods.confirm_plugins_title": "The following package has native plugins:",
"gui.mods.confirm_plugins_description": "Native plugins have far more system access than a regular mod, and because of this they're inherently less secure to have installed, as a malicious plugin could do far more harm this way. If this plugin is one from a trusted developer or similar or you know what you're doing, then you can disregard this message completely.",

This is missing a lot of things, notably support for detecting and
installing dependencies, it also is actually being used by the frontend,
that still uses `mods.js`, this'll change soon™️

It should also when done, be capable of removing mods installed in the
old `mods/` folder when updating those mods, and then installing in the
new `packages/` folder, making the upgrade a smooth ride.
@0neGal 0neGal added the enhancement New feature or request label Jul 16, 2023
@0neGal 0neGal self-assigned this Jul 16, 2023
0neGal and others added 11 commits July 16, 2023 18:40
This caused errors where the folder would already be moved even though
it's not entirely done unzipping.
If you're now installing a mod that's currently in the `mods/` folder
it'll remove that, then install the new one to `packages/` with the new
naming scheme and everything.
I may or may not have missed some properties or something somewhere,
perhaps we'll see if something ends up broken in the future...
I also love how I spent a very long time trying to figure out why
Electron's serializer was failing, turns out, it just throws errors when
it encounters functions, instead of stripping them out, like
`JSON.stringify()` does

Oh well...
This means instead of showing the invididual mods inside a package, we
simply show 1 mod/package, we then use the name, description, version
and so forth from the `manifest.json` inside the package folder. Further
we now also support a local `icon.png` file, instead of relying on
remotely stored icons and trying to match names against each other.
Install toasts, installing overall, dependencies and so forth, all seem  to be fully functional, however more bug testing is probably required to concluce whether that is actually the case or not...

This also doesn't break `src/modules/mods.js`, i.e dragging mods in to
manually install them still functions the same as always.
@DxsSucuk DxsSucuk mentioned this pull request Jul 23, 2023
0neGal added 10 commits July 24, 2023 17:47
Convert is a strong word, in reality, when a user installs (and thereby
also updates) a package, we attempt to search for a mod that we can with
pretty high confidence, we could theoretically make this even better,
but at some point you'll accidentally delete mods that are manually
installed and weren't actually the right ones.
If the gamepath isn't found or unmounted or similar, then the profile
doesn't exist either, but we previously just assumed that it did, now we
refuse to create the `packages` folder, fixing an error.
@0neGal 0neGal marked this pull request as ready for review July 24, 2023 18:38
@0neGal 0neGal merged commit b180388 into main Jul 24, 2023
2 checks passed
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.

4 participants