Refactor entrypoint script: enhance Wine initialization with timeout and improve error handling for Wine test

This commit is contained in:
2025-07-07 14:01:19 +02:00
parent 63e4af21c6
commit 87a1ee9295

View File

@@ -26,27 +26,26 @@ rm -rf "$WINEPREFIX"
# Set Wine architecture to 64-bit
export WINEARCH=win64
# Initialize Wine prefix synchronously
# Initialize Wine prefix synchronously with timeout
echo "Creating new Wine prefix..."
wineboot --init
timeout 30 wineboot --init || echo "Wineboot timed out, continuing..."
# Wait for initialization to complete
sleep 10
# Wait a bit more for any background processes
sleep 5
# Install basic Windows components
echo "Installing basic Windows components..."
winetricks -q corefonts vcrun2019
# Kill any hanging wine processes
pkill -f wine || true
# Test Wine installation
# Skip winetricks for now as it may cause issues
echo "Skipping winetricks installation to avoid hanging..."
# Test Wine installation with a simple command
echo "Testing Wine installation..."
wine cmd /c "echo Wine test successful"
timeout 10 wine cmd /c "echo Wine test successful" 2>/dev/null
if [ $? -eq 0 ]; then
echo "Wine initialization complete and verified."
else
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"
echo "Wine test failed, but Wine prefix was created. Continuing..."
fi
# print the dotnet version on startup