#! /bin/sh

# Add Windows registry entries to invoke MinEd from Explorer context menu

root=`cygpath -w /`

name="MinEd (cygwin)"
command="$root\\bin\\mintty -oLocale=C -oCharset=UTF-8 -oUseSystemColours=1 -oBoldAsBright=0 -oScrollbar=0 -oWindowShortcuts=0 -oZoomShortcuts=0 -e /bin/mined %%1"

rootkey='HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\'"$name"'\command'
userkey='HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\text\shell\'"$name"'\command'

PATH="$PATH:`cygpath $SYSTEMROOT`/system32"

reg add "$rootkey" /f /ve /d "$command" ||
reg add "$userkey" /f /ve /d "$command"

