Play your Steam library's Windows games on a jailbroken PS5.
C++
Install Steam games whose options name other branches
Leonardo Lobatoe576c5d8f7b2
diff --git a/src/homebrew/controller.cpp b/src/homebrew/controller.cppindex 25357d2..cbb7210 100644--- a/src/homebrew/controller.cpp+++ b/src/homebrew/controller.cpp@@ -1,8 +1,11 @@#include "homebrew/controller.hpp"#include "diagnostics/redaction.h"+#include "steam/backend/app_info.h"+#include "stores/local/scanner.h"#include "steam/install_volumes.h"#include "steam/secret.h"#include <algorithm>+#include <cctype>#include <chrono>#include <utility>@@ -1751,7 +1754,22 @@ void Controller::TickAppDetails() {for (const auto& details : app_details_->Pump(8)) {if (details.account_generation != generation) continue;if (details.available) {- model_.UpdateAppDetails(details.id, details.download_bytes, details.install_bytes, details.windows_installable);+ // Options from every branch don't say which program starts the game: Install asks.+ std::vector<LaunchProgram> programs;+ if (details.launches_any_branch)+ for (const auto& option : details.launches) {+ const auto path = steam::RelativeGamePath(option.executable);+ if (!path) continue;+ const auto same = [&](const LaunchProgram& other) {+ return std::equal(path->begin(), path->end(), other.path.begin(), other.path.end(), [](char a, char b) {+ return std::tolower(static_cast<unsigned char>(a)) == std::tolower(static_cast<unsigned char>(b));+ });+ };+ if (std::none_of(programs.begin(), programs.end(), same))+ programs.push_back({*path, playden::stores::local::IsLikelyHelper(*path)});+ }+ model_.UpdateAppDetails(details.id, details.download_bytes, details.install_bytes, details.windows_installable,+ std::move(programs));launch_options_[details.id] = details.launches;launch_options_reason_.erase(details.id);} else if (!launch_options_.count(details.id)) {diff --git a/src/homebrew/simulation.cpp b/src/homebrew/simulation.cppindex 986698f..c4497d8 100644--- a/src/homebrew/simulation.cpp+++ b/src/homebrew/simulation.cpp@@ -1179,13 +1179,43 @@ void Simulation::NotifyImportFailed(const ImportRequest& request, const std::strrebuild_view();}-bool Simulation::SeedGameProgram(GameId id, const std::string& program) {+std::vector<LaunchProgram> Simulation::steam_programs(const Game& game) {+ auto programs = game.launch_programs;+ // Installers and tools last, each group in Steam's order (its default option first).+ std::stable_partition(programs.begin(), programs.end(), [](const LaunchProgram& program) { return !program.helper; });+ return programs;+}++bool Simulation::ask_steam_program(GameId id) {+ const auto* game = find_game(state_, id);+ if (!game || game->launch_programs.empty()) return false;+ const auto programs = steam_programs(*game);+ // A program the player already chose in Game settings is kept.+ if (const auto found = state_.game_settings.find(id);+ found != state_.game_settings.end() && found->second.overrides.count("program"))+ return false;+ if (const auto clear = playden::stores::local::ClearGameProgram(programs)) {+ // Steam's first option is tried first; an installer or tool listed before the game isn't.+ if (programs[*clear].path != game->launch_programs.front().path) SeedGameProgram(id, programs[*clear].path);+ return false;+ }+ steam_programs_shown_ = programs;+ steam_programs_game_ = id;+ std::vector<std::string> actions;+ for (std::size_t index = 0; index < programs.size(); ++index)+ actions.push_back("steam-program-" + std::to_string(index));+ actions.push_back("cancel");+ open_modal({"steam-programs", game->title, "details-install", std::move(actions), 0, false});+ return true;+}++bool Simulation::SeedGameProgram(GameId id, const std::string& program, bool chosen) {if (!live() || !id.valid() || settings_load_failed_ || game_settings_file_.empty()) return false;if (!rt::ValidateSettingValue(rt::GameRecipe{}, "program", program, nullptr)) return false;// Only a record never saved: once the player changed anything (a Program reset included), the// choice is theirs.- if (const auto found = state_.game_settings.find(id);- found != state_.game_settings.end() && (found->second.revision != 0 || !found->second.overrides.empty()))+ if (const auto found = state_.game_settings.find(id); !chosen && found != state_.game_settings.end() &&+ (found->second.revision != 0 || !found->second.overrides.empty()))return false;auto& record = state_.game_settings[id];record.overrides["program"] = program;@@ -1975,6 +2005,17 @@ bool live_install_allowed(InstallReadiness readiness, bool free_space_supported)} // namespace+void Simulation::start_live_install(GameId id) {+ // Install at once when the game fits the default drive (or its size is checked later);+ // otherwise the sheet says why and offers another drive for this install.+ install_volume_id_.clear();+ if (id.valid() && live_install_allowed(assess_install(state_, id, selected_volume_id_, steam::kInstallSpaceMargin).readiness,+ free_space_supported_))+ pending_install_requests_.push_back({InstallRequestKind::Install, id});+ else if (id.valid())+ open_modal({"install", "Install game", "details-install", {"install-confirm", "storage-picker", "cancel"}, 0, false});+}+// Used space is what the drive reports, which already includes what downloads have written or// preallocated; reserved space is the rest of each download's install estimate, as the install// service reserves it when admitting a download.@@ -2192,7 +2233,8 @@ void Simulation::UpdateAccount(AccountUpdate update) {bool Simulation::UpdateAppDetails(GameId id, std::optional<std::uint64_t> download_bytes,std::optional<std::uint64_t> install_bytes,- std::optional<bool> windows_installable) {+ std::optional<bool> windows_installable,+ std::vector<LaunchProgram> launch_programs) {if (!live()) return false;const auto game = std::find_if(state_.games.begin(), state_.games.end(),[id](const Game& candidate) { return candidate.id == id; });@@ -2200,6 +2242,7 @@ bool Simulation::UpdateAppDetails(GameId id, std::optional<std::uint64_t> downlogame->download_bytes = download_bytes;game->install_bytes = install_bytes;game->windows_installable = windows_installable;+ game->launch_programs = std::move(launch_programs);apply_live_volume_usage();rebuild_view();return true;@@ -3682,6 +3725,8 @@ void Simulation::rebuild_view() {const auto* import_programs = modal.id == "import-programs" ? import_candidate(import_programs_key_) : nullptr;if (import_programs)view_.subtitle = import_programs->ascii_ok ? "Choose the program that starts the game." : kImportCopyOnlyText;+ if (modal.id == "steam-programs")+ view_.subtitle = "Steam doesn't say which program starts the game. Choose one; you can change it in Game settings.";// The import wizard: what it imports, where from, and how big it is.const bool import_wizard = modal.id == "import-choice" || modal.id == "import-storage";const auto import_wizard_subject = import_wizard ? import_subject() : ImportSubject{};@@ -4083,6 +4128,13 @@ void Simulation::rebuild_view() {}}}+ else if (modal.id == "steam-programs" && action_key.rfind("steam-program-", 0) == 0) {+ const auto index = static_cast<std::size_t>(std::stoul(action_key.substr(14)));+ if (index < steam_programs_shown_.size()) {+ item.title = steam_programs_shown_[index].path;+ if (steam_programs_shown_[index].helper) item.subtitle = "Installer or tool";+ }+ }else if (import_programs && action_key.rfind("import-program-", 0) == 0) {const auto index = static_cast<std::size_t>(std::stoul(action_key.substr(15)));if (index < import_programs->programs.size()) {@@ -4258,6 +4310,7 @@ void Simulation::rebuild_view() {else if (modal.id == "game-maintenance") view_.legends = {"Cross Select", "L1/R1 Jump", "Circle Cancel"};else if (modal.id == "import-games") view_.legends = {"Cross Select", "Circle Close"};else if (modal.id == "import-programs" || modal.id == "import-choice") view_.legends = {"Cross Select", "Circle Back"};+ else if (modal.id == "steam-programs") view_.legends = {"Cross Install", "Circle Cancel"};else if (modal.id == "import-storage") view_.legends = {"Cross Import here", "Circle Back"};else if (modal.id == "installed-games")// The batch's rows only report; Cross does something only on its buttons.@@ -6385,14 +6438,14 @@ void Simulation::activate() {}} else if (live() && action_name == "live-install") {const auto id = state_.navigation.detail_id.value_or(state_.navigation.selected_game_id);- // Install at once when the game fits the default drive (or its size is checked later);- // otherwise the sheet says why and offers another drive for this install.- install_volume_id_.clear();- if (id.valid() && live_install_allowed(assess_install(state_, id, selected_volume_id_, steam::kInstallSpaceMargin).readiness,- free_space_supported_))- pending_install_requests_.push_back({InstallRequestKind::Install, id});- else if (id.valid())- open_modal({"install", "Install game", "details-install", {"install-confirm", "storage-picker", "cancel"}, 0, false});+ if (!ask_steam_program(id)) start_live_install(id);+ } else if (live() && action_name.rfind("steam-program-", 0) == 0) {+ const auto index = static_cast<std::size_t>(std::stoul(action_name.substr(14)));+ if (index >= steam_programs_shown_.size()) return;+ const auto id = steam_programs_game_;+ SeedGameProgram(id, steam_programs_shown_[index].path, true);+ close_modal();+ start_live_install(id);} else if (live() && action_name == "open-downloads") {state_.navigation.route = Route::Downloads;state_.navigation.focus_key = "job-" + ToKey(state_.navigation.detail_id.value_or(GameId{}));diff --git a/src/homebrew/simulation.hpp b/src/homebrew/simulation.hppindex 519b643..7fd7997 100644--- a/src/homebrew/simulation.hpp+++ b/src/homebrew/simulation.hpp@@ -356,6 +356,12 @@ inline bool operator==(PersistenceLoadToken left, PersistenceLoadToken right) {return left.id == right.id && left.baseline_revision == right.baseline_revision;}+// A program a Steam launch option names, as a path in the game folder.+struct LaunchProgram {+ std::string path;+ bool helper = false; // an installer or tool (the import rules)+};+struct Game {GameId id;std::string title;@@ -374,6 +380,9 @@ struct Game {std::optional<std::int64_t> last_played;std::optional<std::uint64_t> playtime_minutes;std::optional<bool> windows_installable; // from Steam app info; absent until fetched+ // Steam lists no option for the public branch: the programs of every branch's options, which+ // Install asks the player to choose from when more than one could be the game.+ std::vector<LaunchProgram> launch_programs;bool art_pending = false;bool art_failed = false;};@@ -725,7 +734,8 @@ public:// Writes the program an imported game starts with into its Game settings when the game has no// saved settings yet (just added); never over anything the player changed, a reset Program// included. Saved at once so the next preparation reads it. True when it was written.- bool SeedGameProgram(GameId id, const std::string& program);+ // `chosen`: the player picked it just now (Install's program sheet), so it is written anyway.+ bool SeedGameProgram(GameId id, const std::string& program, bool chosen = false);[[nodiscard]] std::vector<GameId> TakeKeptDeleteRequests();// Live mode: maintenance the player confirmed (and settings to apply when the sheet// closes), and games whose title activity the sheet needs to know.@@ -770,7 +780,8 @@ public:void SetFreeSpaceSupported(bool supported) noexcept { free_space_supported_ = supported; }// Live mode: Steam app-info estimates for one game (download/install size, installability).bool UpdateAppDetails(GameId id, std::optional<std::uint64_t> download_bytes,- std::optional<std::uint64_t> install_bytes, std::optional<bool> windows_installable);+ std::optional<std::uint64_t> install_bytes, std::optional<bool> windows_installable,+ std::vector<LaunchProgram> launch_programs = {});// Live mode: the Steam store's description, genres and controller support for one game;// kept across library refreshes.void UpdateStoreDetails(GameId id, std::string description, std::vector<std::string> genres,@@ -1072,6 +1083,13 @@ private:// Imported games playing in place from their folder (State::external_games), and a copy running.[[nodiscard]] const LiveExternalGame* external_game(GameId id) const;[[nodiscard]] const Job* import_copy_job(GameId id) const;+ // Install for a Steam game whose launch options name no clear program asks for one first+ // (the import rules: installers and tools last, one clear program isn't asked for).+ [[nodiscard]] static std::vector<LaunchProgram> steam_programs(const Game& game);+ bool ask_steam_program(GameId id);+ void start_live_install(GameId id);+ std::vector<LaunchProgram> steam_programs_shown_;+ GameId steam_programs_game_;std::size_t import_program_index_ = 0;bool import_program_chosen_ = false; // the program was clear (ClearGameProgram): its list was skippedGameId import_choice_game_;diff --git a/src/homebrew/view.cpp b/src/homebrew/view.cppindex de34919..1af7439 100644--- a/src/homebrew/view.cpp+++ b/src/homebrew/view.cpp@@ -3430,7 +3430,7 @@ class Render::Implstatic const std::map<std::string, std::string> names = {{"choice-picker", "Game settings"}, {"preset-picker", "Game settings"}, {"button-mapping", "Game settings"},{"game-settings", "Playden"}, {"game-maintenance", "Playden"}, {"kept-data", "Settings"}, {"installed-games", "Settings"},- {"import-games", "Library"}, {"import-programs", "Import games"}, {"import-choice", "Import games"},+ {"import-games", "Library"}, {"import-programs", "Import games"}, {"steam-programs", "Install"}, {"import-choice", "Import games"},{"import-storage", "Import games"},{"job-actions", "Downloads"}, {"prep-actions", "Preparation"}, {"storage-details", "Storage"}, {"context", "Game"}, {"compatibility", "Game"}, {"collections", "Game"}, {"collections-manage", "Library"},{"filters", "Library"}, {"logs-controls", "Logs"}, {"setting-value", "Settings"}, {"diagnostics", "Settings"},@@ -3478,7 +3478,7 @@ class Render::Implview.surface == "controller" || view.surface == "logs" ||view.surface == "storage" || view.surface == "install" || view.surface == "kept-data" ||view.surface == "installed-games" || view.surface == "import-games" ||- view.surface == "import-programs";+ view.surface == "import-programs" || view.surface == "steam-programs";const float width = overlay_transition_.panel_width(wide ? 960.0F : 640.0F);const gfx::Rect panel{kWidth - width + (1.0F - ease) * width, 0.0F, width, kHeight};overlay_.shadow({panel.x - 18.0F, 0.0F, panel.w + 18.0F, panel.h}, 0.0F, 36.0F,@@ -3836,7 +3836,8 @@ class Render::Implif (row.title.empty())std::replace(label.begin(), label.end(), '-', ' ');// A program path ("redist/setup.exe") is shown as it is on the drive.- if (!label.empty() && label.front() >= 'a' && label.front() <= 'z' && row.action.rfind("import-program-", 0) != 0)+ if (!label.empty() && label.front() >= 'a' && label.front() <= 'z' && row.action.rfind("import-program-", 0) != 0 &&+ row.action.rfind("steam-program-", 0) != 0)label.front() = static_cast<char>(label.front() - 'a' + 'A');return label;}@@ -3949,7 +3950,7 @@ class Render::Implview.surface == "game-maintenance";// The Import sheets: each folder's path (or why it can't be added) under its name.const bool import_sheet = view.surface == "import-games" || view.surface == "import-programs" ||- view.surface == "import-choice";+ view.surface == "import-choice" || view.surface == "steam-programs";// The import wizard's hints wrap onto a second line rather than being cut.const float hint_width = bounds.w - 48.0F;const auto hint_extra = [&](const ViewRow &row) {diff --git a/src/steam/app_details_service.h b/src/steam/app_details_service.hindex aa4ff2b..50c1c1a 100644--- a/src/steam/app_details_service.h+++ b/src/steam/app_details_service.h@@ -36,6 +36,9 @@ struct AppDetails {bool windows_installable = false; // depots and a launch entry exist for Windows/Englishstd::string reason; // short, user-facing, no identifiersstd::vector<LaunchOption> launches; // Windows launch options, default first+ // No option was for the public branch, so `launches` are every branch's: Steam doesn't say+ // which program starts the game.+ bool launches_any_branch = false;};// Runs on the service worker; may block on the network.diff --git a/src/steam/backend/app_info.cpp b/src/steam/backend/app_info.cppindex 2b11e13..59a96e9 100644--- a/src/steam/backend/app_info.cpp+++ b/src/steam/backend/app_info.cpp@@ -458,24 +458,43 @@ std::vector<std::uint32_t> MissingBaseDepots(const AppInfo& app,return missing;}+bool BetaKeyMatchesPublic(std::string_view beta_key) {+ if (Trim(beta_key).empty()) return true;+ // A comma list of branches (Minecraft Dungeons II lists "public, build_debug, ..."). "default"+ // tags the public branch's option when other branches have their own (Half-Life 2, issue #10).+ while (!beta_key.empty()) {+ const std::size_t comma = beta_key.find(',');+ const auto branch = LowerString(Trim(beta_key.substr(0, comma)));+ if (branch == "public" || branch == "default") return true;+ if (comma == std::string_view::npos) break;+ beta_key.remove_prefix(comma + 1);+ }+ return false;+}+bool EligibleLaunches(const AppInfo& app, const std::set<std::uint32_t>& owned_apps,- std::vector<AppLaunch>* launches, std::string* reason) {- std::vector<AppLaunch> eligible;- std::set<std::string> ids;- for (const AppLaunch& launch : app.launches) {- // "default" tags the public branch's option when other branches have their own (Half-Life 2, issue #10).- const bool beta_ok = !launch.beta_key || launch.beta_key->empty() || *launch.beta_key == "public" ||- *launch.beta_key == "default";- const bool dlc_ok = !launch.required_dlc || *launch.required_dlc == 0 ||- owned_apps.count(*launch.required_dlc) != 0;- // A level editor or a dedicated server is not the game (Selaco lists its .NET editor).- const auto type = LowerString(launch.type);- const bool game = type != "editor" && type != "server";- if (OsListMatchesWindows(launch.os_list) && beta_ok && dlc_ok && game) {- eligible.push_back(launch);- ids.insert(launch.id);+ std::vector<AppLaunch>* launches, std::string* reason, bool* any_branch) {+ const auto eligible_for = [&](bool ignore_branch) {+ std::vector<AppLaunch> eligible;+ for (const AppLaunch& launch : app.launches) {+ const bool beta_ok = ignore_branch || !launch.beta_key || BetaKeyMatchesPublic(*launch.beta_key);+ const bool dlc_ok = !launch.required_dlc || *launch.required_dlc == 0 ||+ owned_apps.count(*launch.required_dlc) != 0;+ // A level editor or a dedicated server is not the game (Selaco lists its .NET editor).+ const auto type = LowerString(launch.type);+ const bool game = type != "editor" && type != "server";+ if (OsListMatchesWindows(launch.os_list) && beta_ok && dlc_ok && game) eligible.push_back(launch);}- }+ return eligible;+ };+ auto eligible = eligible_for(false);+ // Steam still starts a game whose only options name other branches (GUILTY GEAR -STRIVE- lists+ // one for "debug"): every branch's options are then candidates.+ const bool fallback = eligible.empty();+ if (fallback) eligible = eligible_for(true);+ if (any_branch != nullptr) *any_branch = fallback && !eligible.empty();+ std::set<std::string> ids;+ for (const AppLaunch& launch : eligible) ids.insert(launch.id);if (eligible.empty() || ids.size() != eligible.size()) {return Fail(reason, "The game has no valid Windows launch configuration.");}diff --git a/src/steam/backend/app_info.h b/src/steam/backend/app_info.hindex 4f86ef9..b320879 100644--- a/src/steam/backend/app_info.h+++ b/src/steam/backend/app_info.h@@ -103,9 +103,13 @@ std::vector<std::uint32_t> MissingBaseDepots(const AppInfo& app,const std::optional<std::set<std::uint32_t>>& owned_depots,const std::vector<DepotInfo>& selected);-// Windows launch entries usable on the public branch, default type first, then by id.+// Steam `betakey`: empty, or a comma list that names "public" or "default".+bool BetaKeyMatchesPublic(std::string_view beta_key);++// Windows launch entries usable on the public branch, default type first, then by id. When no entry+// is for the public branch, every branch's entries; `any_branch` then says so.bool EligibleLaunches(const AppInfo& app, const std::set<std::uint32_t>& owned_apps,- std::vector<AppLaunch>* launches, std::string* reason);+ std::vector<AppLaunch>* launches, std::string* reason, bool* any_branch = nullptr);// Normalizes a game-relative Windows path to forward slashes. Rejects absolute paths, drive// colons, control characters, "..", and the download scratch folder.diff --git a/src/steam/backend/cm_app_details.cpp b/src/steam/backend/cm_app_details.cppindex 34a8048..0b2c155 100644--- a/src/steam/backend/cm_app_details.cpp+++ b/src/steam/backend/cm_app_details.cpp@@ -38,7 +38,7 @@ AppDetails DetailsFromAppInfo(std::uint32_t id, const std::string& buffer,if (install) details.install_bytes = install;if (download) details.download_bytes = download;std::vector<AppLaunch> launches;- details.windows_installable = EligibleLaunches(*app, owned, &launches, &reason);+ details.windows_installable = EligibleLaunches(*app, owned, &launches, &reason, &details.launches_any_branch);if (!details.windows_installable) details.reason = "No Windows launch configuration.";for (const auto& launch : launches)details.launches.push_back({launch.executable, launch.arguments, launch.working_directory,diff --git a/tests/homebrew_library_graphical_test.cpp b/tests/homebrew_library_graphical_test.cppindex d7b5ff2..dfba9b1 100644--- a/tests/homebrew_library_graphical_test.cpp+++ b/tests/homebrew_library_graphical_test.cpp@@ -159,6 +159,19 @@ int main(int argc,char** argv) {assert(updating.action("focus:settings-release-notes") && updating.action("cross"));capture_update("release-notes-short.png");}+ {+ // Steam's options name no clear program: Install asks which one starts the game.+ Simulation live({}, {}, ModelMode::Live);+ live.UpdateAccount({AuthState::SignedIn,"123","Synthetic account",{},{},true});+ assert(live.UpdateLibrary({backend.games,false,{},false,false,{}}));+ live.UpdateVolumes({{"internal","Console storage",true,200'000'000'000,1'000'000'000}},"internal");+ live.UpdateAppDetails(SteamId(42), 300'000'000, 600'000'000, true,+ {{"RSDragonwilds.exe",false},{"Aqua-Coyote.exe",false},{"Redist/Setup.exe",true}});+ assert(live.action("details:42") && live.action("focus:details-install") && live.action("cross"));+ assert(live.view().surface=="steam-programs");+ for(int i=0;i<16;++i) renderer.draw(live,1920,1080);+ assert(renderer.capture_png(output/"steam-programs.png",1920,1080));+ }{// An installed, prepared game: Play is the same height as the other actions,// in either state, and the uninstall dialog's choice fits its button.diff --git a/tests/homebrew_live_model_test.cpp b/tests/homebrew_live_model_test.cppindex 754c9b0..9001c19 100644--- a/tests/homebrew_live_model_test.cpp+++ b/tests/homebrew_live_model_test.cpp@@ -805,6 +805,55 @@ void live_imported_program_seeds_once(const std::filesystem::path& base) {"seed: saved at once");}+// Steam options only for other branches don't say which program starts the game: Install asks+// when two or more could be it, and asks nothing for one clear program (the import rules).+void live_install_asks_for_a_steam_program(const std::filesystem::path& base) {+ using playden::homebrew::InstallRequestKind;+ using playden::homebrew::LaunchProgram;+ std::filesystem::create_directories(base);+ auto model = make_live(base);+ model.SetGameSettingsFile(base / "steam-program-settings.json");+ model.UpdateAccount({AuthState::SignedIn, "account", "Owner", {}, {}, false});+ playden::GameSummary dragonwilds;+ dragonwilds.id = SteamId(1374490);+ dragonwilds.title = "RuneScape: Dragonwilds";+ playden::GameSummary strive;+ strive.id = SteamId(1384160);+ strive.title = "GUILTY GEAR -STRIVE-";+ check(model.UpdateLibrary({{dragonwilds, strive}, false, {}, false, true, 100}), "steam program: library delivered");+ model.UpdateVolumes({{"internal", "Console storage", true, 200'000'000'000, 1'000'000'000}}, "internal");++ check(model.action("details:1374490") &&+ model.UpdateAppDetails(SteamId(1374490), 100, 200, true,+ {{"RSDragonwilds.exe", false}, {"Aqua-Coyote.exe", false}, {"Setup.exe", true}}),+ "steam program: details with two programs");+ activate(model, "details-install");+ check(model.view().surface == "steam-programs" && model.TakeInstallRequests().empty(),+ "steam program: Install asks first");+ check(model.state().navigation.modals.back().action_keys.size() == 4, "steam program: every program and Cancel");+ activate(model, "cancel");+ check(model.view().surface != "steam-programs" && model.TakeInstallRequests().empty() &&+ !model.state().game_settings.count(SteamId(1374490)),+ "steam program: Cancel installs nothing");+ activate(model, "details-install");+ activate(model, "steam-program-1");+ auto requests = model.TakeInstallRequests();+ check(requests.size() == 1 && requests[0].kind == InstallRequestKind::Install && requests[0].game_id == SteamId(1374490),+ "steam program: choosing one installs");+ check(model.state().game_settings.at(SteamId(1374490)).overrides.at("program") == "Aqua-Coyote.exe",+ "steam program: the choice goes into Game settings");++ // One program besides installers and tools: no question.+ check(model.action("details:1384160") &&+ model.UpdateAppDetails(SteamId(1384160), 100, 200, true, {{"GGST.exe", false}, {"Redist/vcredist.exe", true}}),+ "steam program: details with one clear program");+ activate(model, "details-install");+ requests = model.TakeInstallRequests();+ check(model.view().surface != "steam-programs" && requests.size() == 1 && requests[0].game_id == SteamId(1384160),+ "steam program: one clear program installs at once");+ check(!model.state().game_settings.count(SteamId(1384160)), "steam program: Steam's first option needs no setting");+}+} // namespaceint main() {@@ -820,6 +869,7 @@ int main() {live_program_change_applies_like_other_settings(base);live_imported_game_steam_app_id(base);live_imported_program_seeds_once(base);+ live_install_asks_for_a_steam_program(base);live_starts_clean_and_never_reads_or_writes_fixtures(base);live_dispatches_bounded_service_effects_and_replaces_challenges(base);failed_signout_preserves_account_until_external_clear(base);diff --git a/tests/steam_app_info_test.cpp b/tests/steam_app_info_test.cppindex 8c9a42c..37a45ea 100644--- a/tests/steam_app_info_test.cpp+++ b/tests/steam_app_info_test.cpp@@ -376,6 +376,26 @@ void TestEligibleLaunches() {with_editor.launches[0].type = "Server";CHECK(EligibleLaunches(with_editor, {kApp, 999}, &launches, &reason));CHECK((LaunchIds(launches) == Strings{"10"}));++ // Steam's betakey is a comma list of branches.+ AppInfo listed = *app;+ listed.launches[2].beta_key = "build_debug, Public ,latest\t";+ bool any_branch = true;+ CHECK(EligibleLaunches(listed, {kApp}, &launches, &reason, &any_branch));+ CHECK((LaunchIds(launches) == Strings{"0", "2", "10"}) && !any_branch);+ listed.launches[2].beta_key = "default, valve_review";+ CHECK(EligibleLaunches(listed, {kApp}, &launches, &reason));+ CHECK((LaunchIds(launches) == Strings{"0", "2", "10"}));+ CHECK(!BetaKeyMatchesPublic("publicbeta") && !BetaKeyMatchesPublic("debug") && BetaKeyMatchesPublic(" "));++ // Options only for other branches (GUILTY GEAR -STRIVE-: "debug"; RuneScape: Dragonwilds):+ // every branch's options, still without DLC the account lacks.+ AppInfo branches = *app;+ for (auto& launch : branches.launches) launch.beta_key = "debug";+ CHECK(EligibleLaunches(branches, {kApp}, &launches, &reason, &any_branch));+ CHECK((LaunchIds(launches) == Strings{"0", "2", "10"}) && any_branch);+ CHECK(EligibleLaunches(branches, {kApp, 999}, &launches, &reason, &any_branch));+ CHECK((LaunchIds(launches) == Strings{"0", "2", "3", "10"}) && any_branch);}void TestWindowsArguments() {