From be46b28bacdac2e372ec187c3b0fe37cb1faf14c Mon Sep 17 00:00:00 2001 From: B3ni Date: Mon, 7 Jul 2025 14:17:18 +0200 Subject: [PATCH] Refactor entrypoint script: reinitialize Wine prefix and streamline initialization process with timeout and testing --- entrypoint.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 0ddd2e4..574b4e6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -22,19 +22,24 @@ export WINEARCH=win64 export WINEPREFIX=/home/container/.wine export WINEDLLOVERRIDES="mscoree,mshtml=" -if [ ! -d "$WINEPREFIX" ]; then - echo "Initializing Wine prefix..." - wine wineboot --init - sleep 10 - - # Install essential components - winetricks -q vcrun2019 corefonts - sleep 5 -fi +# Always reinitialize Wine prefix to ensure it works +echo "Reinitializing Wine prefix..." +rm -rf "$WINEPREFIX" -# Start Wine server -wineserver -p &> /dev/null -sleep 3 +# Initialize Wine prefix with timeout to prevent hanging +echo "Creating Wine prefix..." +timeout 60 wine wineboot --init || echo "Wine initialization timed out, continuing..." + +# Wait for Wine to settle +sleep 5 + +# Test if Wine works +echo "Testing Wine..." +if timeout 10 wine cmd /c "echo Wine works"; then + echo "Wine test successful" +else + echo "Wine test failed, but continuing..." +fi # Print versions printf "\033[1m\033[33mcontainer@pelican~ \033[0mdotnet --version\n"