Refactor entrypoint script: reinitialize Wine prefix and streamline initialization process with timeout and testing

This commit is contained in:
2025-07-07 14:17:18 +02:00
parent 77a5105695
commit be46b28bac

View File

@@ -22,19 +22,24 @@ export WINEARCH=win64
export WINEPREFIX=/home/container/.wine export WINEPREFIX=/home/container/.wine
export WINEDLLOVERRIDES="mscoree,mshtml=" export WINEDLLOVERRIDES="mscoree,mshtml="
if [ ! -d "$WINEPREFIX" ]; then # Always reinitialize Wine prefix to ensure it works
echo "Initializing Wine prefix..." echo "Reinitializing Wine prefix..."
wine wineboot --init rm -rf "$WINEPREFIX"
sleep 10
# Install essential components
winetricks -q vcrun2019 corefonts
sleep 5
fi
# Start Wine server # Initialize Wine prefix with timeout to prevent hanging
wineserver -p &> /dev/null echo "Creating Wine prefix..."
sleep 3 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 # Print versions
printf "\033[1m\033[33mcontainer@pelican~ \033[0mdotnet --version\n" printf "\033[1m\033[33mcontainer@pelican~ \033[0mdotnet --version\n"