#!/bin/bash
### BEGIN BOOT SCRIPT INFO
#Long-Name: Microsoft Device Emulator
### END BOOT SCRIPT INFO
### BEGIN BOOT SCRIPT INSTALLATION DEFAULTS
#Launch-Mode: gui-only
### END BOOT SCRIPT INSTALLATION DEFAULTS
#
#This script uses the standard Wine directory structure with a per-config prefix
#in the wine/ directory. The emulator directory is expected to be in
#wine/drive_c/devemu
#
#The emulator binaries are in hpcarm/SUPPORT/emulators/ms_dev_emu_v2 and
#hpcarm/SUPPORT/emulators/ms_dev_emu_v3
#
#If an emulator save file called default.dess is present in wine/drive_c/devemu
#this script will invoke the emulator with that, otherwise it will invoke it
#with make_save.bat (which should invoke the emulator with the options to create
#default.dess).

. bootscriptfunctions.sh

cd_to_wine_config devemu

if [ -f default.dess ]
then
	exec wine devemu /s default.dess
else
	exec wine cmd /c 'make_save.bat'
fi
