Skip to content

Commit

Permalink
Merge pull request #32 from ccloli/feature/link-first
Browse files Browse the repository at this point in the history
Swap the order of restart Steam and link directories
  • Loading branch information
ErisApps authored Jul 1, 2023
2 parents 0793639 + 982890d commit 67deb24
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions LegacyInstaller/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,6 @@ private async Task InstallVersion(Version version)
watcher.Changed += FileSystemChanged;
await Utilities.CopyDirectory(_steamProcess.Downloader.ContentAppDepotDir, SelectedVersionInstallDir);

// Install to steam
this.Dispatcher.Invoke((Action)delegate { installStateLabel.Content = "Installing..."; });
await CopyLaunchFileTo(SelectedVersionInstallDir);
_steamProcess.Shortcuts.AddSteamShortcut(new SteamShortcut($"Beat Saber {SelectedVersion.BSVersion}", SelectedVersionInstallDir, "LaunchBS.bat"));

// Restart steam
var steamAppId = Utilities.GetSteamAppId($"Beat Saber {SelectedVersion.BSVersion}", $"{BSInstallDir} {SelectedVersion.BSVersion}", "LaunchBS.bat");
await RestartSteam($"steam://nav/games/details/{steamAppId}");

// Enable UI
this.Dispatcher.Invoke((Action)delegate { RefreshUI(true); });

// Create Junction Links for custom levels
if (customLevelsLinkCheckbox.IsChecked.GetValueOrDefault())
{
Expand All @@ -309,6 +297,18 @@ private async Task InstallVersion(Version version)

Utilities.CreateJunctionLink(targetDir, sourceDir);
}

// Install to steam
this.Dispatcher.Invoke((Action)delegate { installStateLabel.Content = "Installing..."; });
await CopyLaunchFileTo(SelectedVersionInstallDir);
_steamProcess.Shortcuts.AddSteamShortcut(new SteamShortcut($"Beat Saber {SelectedVersion.BSVersion}", SelectedVersionInstallDir, "LaunchBS.bat"));

// Restart steam
var steamAppId = Utilities.GetSteamAppId($"Beat Saber {SelectedVersion.BSVersion}", $"{BSInstallDir} {SelectedVersion.BSVersion}", "LaunchBS.bat");
await RestartSteam($"steam://nav/games/details/{steamAppId}");

// Enable UI
this.Dispatcher.Invoke((Action)delegate { RefreshUI(true); });
}

private void FileSystemChanged(object sender, FileSystemEventArgs e)
Expand Down

0 comments on commit 67deb24

Please sign in to comment.