Fix things so that the global version of Wine isn't trampled over.

The specific version of wine can be set in the registry for each
app. Also, add fakejapanese to the Shadow Line installation, though it
is still shitting the bed.
This commit is contained in:
2025-12-08 23:32:51 -05:00
parent d97f9aa4c5
commit 825d74460b
4 changed files with 92 additions and 11 deletions

View File

@@ -133,34 +133,94 @@ install_wine_bottle() {
echo "Using pre-configured wine${architecture} bottle at $WINEPREFIX"
# Store winVer for per-app setting in add_launcher (don't set globally)
if [[ -n "$winVer" ]]; then
export gameWinVer="$winVer"
fi
# Install any additional game-specific dependencies if specified
if [[ $# -gt 0 ]]; then
# Filter out dependencies that are already installed in bottle creation
local depsToInstall=()
local alreadyInstalled="speechsdk sapi corefonts isolate_home"
for dep in "$@"; do
# Skip dependencies already installed during bottle creation
# Also skip winVer patterns - handled separately above
if [[ ! " $alreadyInstalled " =~ " $dep " ]] && [[ ! "$dep" =~ ^win(7|8|10)$ ]]; then
depsToInstall+=("$dep")
fi
done
if [[ ${#depsToInstall[@]} -gt 0 ]]; then
echo "Installing additional dependencies: ${depsToInstall[*]}"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q isolate_home "${depsToInstall[@]}" "${winVer:-win7}" ${winetricksSettings}
} | agm_progressbox "Wine Setup" "Installing additional dependencies..."
# Separate speechsdk (needs FORCE) from other deps
local regularDeps=()
local needsSpeechsdk=false
for dep in "${depsToInstall[@]}"; do
if [[ "$dep" == "speechsdk" ]]; then
needsSpeechsdk=true
else
regularDeps+=("$dep")
fi
done
# Install regular deps without FORCE
if [[ ${#regularDeps[@]} -gt 0 ]]; then
echo "Installing additional dependencies: ${regularDeps[*]}"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" winetricks -q isolate_home "${regularDeps[@]}" ${winetricksSettings}
} | agm_progressbox "Wine Setup" "Installing additional dependencies..."
fi
# Install speechsdk with FORCE if needed
if [[ "$needsSpeechsdk" == "true" ]]; then
echo "Installing speechsdk with WINETRICKS_FORCE=1"
{
env WINE="$WINE" WINESERVER="$WINESERVER" DISPLAY="${DISPLAY:-:0}" WINETRICKS_FORCE=1 winetricks -q speechsdk
} | agm_progressbox "Wine Setup" "Installing Speech SDK..."
fi
fi
fi
}
# Set Windows version for a specific executable (per-app, not global)
# This allows different games to use different Windows versions in the same bottle
set_app_winver() {
local exePath="$1"
local winVersion="$2"
if [[ -z "$exePath" ]] || [[ -z "$winVersion" ]]; then
return
fi
# Extract just the exe filename from path (handles both / and \ separators)
local exeName="${exePath##*\\}"
exeName="${exeName##*/}"
echo "Setting Windows version $winVersion for $exeName"
cat > /tmp/app_winver.reg << EOF
REGEDIT4
[HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\${exeName}]
"Version"="${winVersion}"
EOF
wine regedit /tmp/app_winver.reg
rm /tmp/app_winver.reg
}
add_launcher() {
# Determine architecture from WINEPREFIX path instead of WINEARCH variable
local architecture="win64" # default
if [[ "$WINEPREFIX" =~ wine32 ]]; then
architecture="win32"
fi
# Set per-app Windows version if specified
if [[ -n "$gameWinVer" ]]; then
set_app_winver "$1" "$gameWinVer"
unset gameWinVer
fi
local launchSettings="${architecture}|${1}|${game}"
shift
while [[ $# -gt 0 ]]; do