Map Wine Program Files into local games

This commit is contained in:
Storm Dragon
2026-04-22 12:38:40 -04:00
parent 7c9f485962
commit 4c5e69649e

View File

@@ -147,6 +147,41 @@ install_with_progress() {
esac
}
prepare_wine_game_dirs() {
local driveC="${WINEPREFIX}/drive_c"
local gamesWineRoot="${HOME}/.local/games/Wine"
local programName
local sourceDir
local targetDir
local item
[[ -d "$driveC" ]] || return 0
for programName in "Program Files" "Program Files (x86)"; do
sourceDir="${driveC}/${programName}"
targetDir="${gamesWineRoot}/${programName}"
mkdir -p "$targetDir"
if [[ -L "$sourceDir" ]]; then
continue
fi
if [[ -d "$sourceDir" ]]; then
shopt -s dotglob nullglob
for item in "$sourceDir"/*; do
mv -n "$item" "$targetDir/"
done
shopt -u dotglob nullglob
rmdir "$sourceDir" 2> /dev/null || true
fi
if [[ ! -e "$sourceDir" ]]; then
ln -s "$targetDir" "$sourceDir"
fi
done
}
install_wine_bottle() {
local dep
local depsToInstall=()
@@ -170,6 +205,7 @@ install_wine_bottle() {
ui_progressbox "Wine Setup" "Initializing Wine bottle" < /dev/null
DISPLAY="${DISPLAY:-}" wine wineboot -u
fi
prepare_wine_game_dirs
for dep in "$@"; do
case "$dep" in