FROM debian:bookworm

ENV WINEPREFIX=/tools/prefix WINEDLLOVERRIDES="mscoree,mshtml=" DISPLAY=:0
COPY innosetup-5.6.1-unicode.exe runwine /tools/

RUN chmod +x /tools/runwine && \
    apt-get update -qq && \
    apt-get upgrade -y && \
    apt-get install wget xvfb procps -y && \
    dpkg --add-architecture i386 && \
    mkdir -pm755 /etc/apt/keyrings && \
    wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key && \
    wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources && \
    apt update -qq && \
    apt install --install-recommends winehq-stable -y

RUN /tools/runwine /tools/innosetup-5.6.1-unicode.exe /VERYSILENT /SUPPRESSMSGBOXES /NOICONS /DIR="c:\\innosetup\\"

WORKDIR /data

ENTRYPOINT ["/data/run.sh"]

