Skip to content

Commit 4a444a6

Browse files
committed
#572: Check with and without /pfx for Heroic Wine prefixes
1 parent 0885010 commit 4a444a6

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/scan.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,17 @@ pub fn scan_game_for_backup(
529529
}
530530
for root in roots {
531531
for wp in launchers.get_game(root, name).filter_map(|x| x.prefix.as_ref()) {
532-
let with_pfx = wp.joined("pfx");
533-
scan_game_for_backup_add_prefix(
534-
&mut roots_to_check,
535-
&mut paths_to_check,
536-
if with_pfx.exists() { &with_pfx } else { wp },
537-
!game.registry.is_empty(),
538-
);
532+
scan_game_for_backup_add_prefix(&mut roots_to_check, &mut paths_to_check, wp, !game.registry.is_empty());
533+
534+
let pfx = wp.joined("pfx");
535+
if pfx.exists() {
536+
scan_game_for_backup_add_prefix(
537+
&mut roots_to_check,
538+
&mut paths_to_check,
539+
&pfx,
540+
!game.registry.is_empty(),
541+
);
542+
}
539543
}
540544
}
541545

src/scan/launchers/heroic.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ fn find_prefix(
130130
}
131131

132132
"proton" => {
133-
let prefix = format!("{wine_prefix}/pfx");
133+
// This would usually be `{wine_prefix}/pfx`,
134+
// but in at least one case in a Flatpak install,
135+
// that was a broken link and the real prefix was just `wine_prefix`.
134136
log::trace!(
135137
"Found Heroic Proton prefix for {} ({}), adding {}",
136138
game_name,
137139
app_name,
138-
&prefix
140+
wine_prefix
139141
);
140-
Some(StrictPath::new(prefix))
142+
Some(StrictPath::new(wine_prefix.clone()))
141143
}
142144

143145
_ => {

0 commit comments

Comments
 (0)