#!/bin/bash

# Exit immediately if a command exits with a non-zero status
set -e

# Test
arch=$(dpkg --print-architecture)
if [ "$arch" == 'amd64' ] || [ "$arch" == 'arm64' ] && [ $(dpkg -s wine32 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
    echo "Installing wine32 package..."
    dpkg --add-architecture i386 && apt-get update && apt-get -y install wine32
fi

xvfb-run wine /usr/share/windows-binaries/hyperion/hyperion.exe /usr/share/doc/hyperion/Examples/helloworld.exe crypted.exe
