#!/bin/bash

# Is it a windows or a dos binary ?

windows_app="$1"
if [ ! -e "$windows_app" ] ; then 
	# We are in path, it's wine
	wrapper="wine.real"
elif [ "$(file "$1" | grep 'DOS executable')" = "" -a "$(file "$1" | grep 'DOS batch')" = "" ]; then
	wrapper="wine.real"
else
	wrapper="dosbox-wrapper"
fi

exec "$wrapper" "$@"
exit 0
