Extract wine logic from app file