diff --git a/src/LegendaryGameInstaller.xaml.cs b/src/LegendaryGameInstaller.xaml.cs index ffc7bdd..7d17ae2 100644 --- a/src/LegendaryGameInstaller.xaml.cs +++ b/src/LegendaryGameInstaller.xaml.cs @@ -74,9 +74,12 @@ public async Task StartTask(DownloadAction downloadAction) { installPath = installPath.Replace(playniteDirectoryVariable, playniteAPI.Paths.ApplicationPath); } - if (!Helpers.IsDirectoryWritable(installPath)) + if (MultiInstallData.First().downloadProperties.downloadAction == DownloadAction.Install) { - return; + if (!Helpers.IsDirectoryWritable(installPath)) + { + return; + } } InstallerWindow.Close(); LegendaryDownloadManager downloadManager = LegendaryLibrary.GetLegendaryDownloadManager(); @@ -89,6 +92,13 @@ public async Task StartTask(DownloadAction downloadAction) var wantedItem = downloadManager.downloadManagerData.downloads.FirstOrDefault(item => item.gameID == gameId); if (wantedItem == null) { + if (downloadAction == DownloadAction.Repair) + { + var installedAppList = LegendaryLauncher.GetInstalledAppList(); + var installedInfo = installedAppList[gameId]; + installPath = installedInfo.Install_path; + } + installData.fullInstallPath = installPath; var downloadProperties = GetDownloadProperties(installData, downloadAction, installPath); installData.downloadProperties = downloadProperties; downloadTasks.Add(installData); @@ -101,7 +111,14 @@ public async Task StartTask(DownloadAction downloadAction) var wantedDlc = downloadManager.downloadManagerData.downloads.FirstOrDefault(item => item.gameID == selectedDlc.Key); if (wantedDlc == null) { + if (downloadAction == DownloadAction.Repair) + { + var installedAppList = LegendaryLauncher.GetInstalledAppList(); + var installedInfo = installedAppList[gameId]; + installPath = installedInfo.Install_path; + } var dlcInstallData = selectedDlc.Value; + dlcInstallData.fullInstallPath = installPath; var downloadProperties = GetDownloadProperties(dlcInstallData, downloadAction, installPath); dlcInstallData.downloadProperties = downloadProperties; downloadTasks.Add(dlcInstallData);