Enhance entrypoint script: increase wait time for Xvfb, streamline Wine initialization, and improve Wine test handling

This commit is contained in:
2025-07-07 13:59:50 +02:00
parent 0e7416a9c6
commit 63e4af21c6

View File

@@ -17,7 +17,7 @@ Xvfb :99 -screen 0 1024x768x16 -ac &
export DISPLAY=:99.0
# Wait for Xvfb to start
sleep 3
sleep 5
# Force reinitialize Wine prefix to ensure it's properly set up
echo "Reinitializing Wine prefix to ensure proper setup..."
@@ -26,27 +26,27 @@ rm -rf "$WINEPREFIX"
# Set Wine architecture to 64-bit
export WINEARCH=win64
# Set Wine to run in headless mode
export WINE_VNC_NOVNC=1
export WINE_VNC_DEPTH=16
# Initialize Wine prefix with minimal configuration
# Initialize Wine prefix synchronously
echo "Creating new Wine prefix..."
wineboot --init 2>/dev/null &
wineboot --init
# Wait for wineboot process to complete
sleep 15
# Wait for initialization to complete
sleep 10
# Kill any remaining Wine processes
pkill -f wine
# Install basic Windows components
echo "Installing basic Windows components..."
winetricks -q corefonts vcrun2019
# Try a simple Wine command to verify it works
# Test Wine installation
echo "Testing Wine installation..."
timeout 30 wine cmd /c "echo Wine test successful" 2>/dev/null
wine cmd /c "echo Wine test successful"
if [ $? -eq 0 ]; then
echo "Wine initialization complete and verified."
else
echo "Wine test failed, but continuing anyway..."
echo "Wine test failed, trying alternative approach..."
# Try to create a minimal working Wine environment
wine regedit /s /dev/null 2>/dev/null
wine cmd /c "echo Fallback Wine test"
fi
# print the dotnet version on startup