Skip to content

Commit 1096d7a

Browse files
Migration: remove hardcoded STEAM_COMPAT_DATA_PATH in preset launch profiles
1 parent e5d37ba commit 1096d7a

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

src-tauri/src/state.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,13 +760,13 @@ impl LaunchProfiles {
760760
if cfg!(target_os = "linux") {
761761
// Strip `STEAM_COMPAT_CLIENT_INSTALL_PATH` env var from all presets;
762762
// it's set at runtime now as part of compat setup.
763-
static STEAM_COMPAT_REMOVAL_REGEX: LazyLock<Regex> = LazyLock::new(|| {
763+
static STEAM_COMPAT_CLIENT_REMOVAL_REGEX: LazyLock<Regex> = LazyLock::new(|| {
764764
Regex::new(r#"\s*STEAM_COMPAT_CLIENT_INSTALL_PATH="[^"]*"\s*"#).unwrap()
765765
});
766766

767767
for profile in &mut loaded.profiles {
768768
if profile.is_preset() {
769-
let new_command = STEAM_COMPAT_REMOVAL_REGEX
769+
let new_command = STEAM_COMPAT_CLIENT_REMOVAL_REGEX
770770
.replace_all(&profile.command, " ")
771771
.trim()
772772
.to_string();
@@ -780,6 +780,27 @@ impl LaunchProfiles {
780780
}
781781
}
782782

783+
// Strip `STEAM_COMPAT_DATA_PATH` env var from all presets;
784+
// it's set at runtime now as part of compat setup.
785+
static STEAM_COMPAT_DATA_REMOVAL_REGEX: LazyLock<Regex> =
786+
LazyLock::new(|| Regex::new(r#"\s*STEAM_COMPAT_DATA_PATH="[^"]*"\s*"#).unwrap());
787+
788+
for profile in &mut loaded.profiles {
789+
if profile.is_preset() {
790+
let new_command = STEAM_COMPAT_DATA_REMOVAL_REGEX
791+
.replace_all(&profile.command, " ")
792+
.trim()
793+
.to_string();
794+
if new_command != profile.command {
795+
debug!(
796+
"Migrating launch profile {}: stripping STEAM_COMPAT_DATA_PATH",
797+
profile.get_id()
798+
);
799+
profile.command = new_command;
800+
}
801+
}
802+
}
803+
783804
// If there's no launch profile for the embedded GE Proton, add one.
784805
let ge_proton_embedded = get_app_statics().resource_dir.join("ge-proton").exists();
785806
if ge_proton_embedded

0 commit comments

Comments
 (0)