manager: allow parent path annotations

- Allows unlimited amount of `..\` or `../` at the start of DestPath string.
- Each of then will go back one folder.
- Similar to how Linux works or Visual Studio project styles.
- This allows us to install/update lwjgl3ify in PrismLauncher.
This commit is contained in:
Pascal
2025-06-27 09:10:18 +02:00
parent 09c1ac8b08
commit f5596ab0ba
4 changed files with 62 additions and 33 deletions

View File

@@ -153,7 +153,7 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf
foreach (InstallAction iaction in checkResult.Actions)
{
var destFilePath = Path.Combine(modpackInfo.LocaLPath, iaction.DestPath);
var destFilePath = iaction.GetDestPath(modpackInfo.LocaLPath);
var sourceUrl = updateConfig.PreferDirectLinks && !string.IsNullOrWhiteSpace(iaction.SourceUrl)
? iaction.GetSourceUrl(checkResult.LatestVersion, overwriteVersion: OverwriteVersion)
: await factory.ResolveSourceUrl(iaction, targetVersion: checkResult.LatestVersion, overwriteVersion: OverwriteVersion);