#!/bin/sh
#
# For some reason, wordpad.exe would not launch unless launched from its
# executable path or when referenced with absolute path.
#
# This wrapper serves as a temporary workaround for this issue.
#
# wine wordpad.exe would still fail.
case $(uname -m) in
	aarch64)
		_WINE_ARCH="aarch64"
		_WINE_BITS="64"
		;;
	i*86)
		_WINE_ARCH="i386"
		_WINE_BITS="32"
		;;
	x86_64)
		_WINE_ARCH="x86_64"
		_WINE_BITS="64"
		;;
	*)
		echo "Error: wordpad.exe is not yet supported on this platform."
		exit 1
		;;
esac

wine \
	/usr/lib/wine"${_WINE_BITS}"/wine/"${_WINE_ARCH}"-windows/wordpad.exe \
	"$@"
