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 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"