#!/bin/sh

set -e

echo ">>> test hyperion on a 32 bits executable"
wine /usr/share/windows-resources/hyperion/hyperion.exe /usr/share/doc/hyperion/Examples/helloworld.exe crypted32.exe
echo ">>> test hyperion on 64 bits executable"
wine /usr/share/windows-resources/hyperion/hyperion.exe /usr/share/doc/hyperion/Examples/helloworld64.EXE crypted64.exe

echo ">>> check the result for 32 bits"
wine crypted32.exe &
WINE_PID=$!
sleep 5s
echo ">>> take the screenshot for .exe 32 bits"
scrot screenshot-crypted32.png
echo ">>> kill wine process"
kill $WINE_PID

echo ">>> check the result for 64 bits"
wine crypted64.exe &
WINE_PID=$!
sleep 5s
echo ">>> take the screenshot for .exe 64 bits"
scrot screenshot-crypted64.png
echo ">>> kill wine process"
kill $WINE_PID
