#!/bin/sh -ex Xvfb :99 -screen 0 1280x1024x24 -nolisten tcp & set DISPLAY=:99 sleep 5 DISPLAY=:99 WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i # For some reason we have to set this here, having set .. ^ is not enough DISPLAY=:99 msiexec /i lua4win.msi & WIN="Lua4Win Installer 1.0 Setup" DISPLAY=:99 xdotool sleep 3 win=$(DISPLAY=:99 xdotool search --sync --name "Installer") # Click Next DISPLAY=:99 xwd -name "$WIN" | magick xwd:- png:/root/1.png DISPLAY=:99 xdotool mousemove --window "$win" --sync 346 334 DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xdotool click 1 DISPLAY=:99 xwd -name "$WIN" | magick xwd:- png:/root/2.png DISPLAY=:99 xdotool sleep 1 # Click agree to liscense DISPLAY=:99 xdotool mousemove --window "$win" --sync 34 286 DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xdotool click 1 DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xwd -name "$WIN" | magick xwd:- png:/root/3.png # Click next DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xdotool mousemove --window "$win" --sync 350 337 DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xdotool click 1 DISPLAY=:99 xdotool sleep 1 DISPLAY=:99 xwd -name "$WIN" | magick xwd:- png:/root/4.png DISPLAY=:99 xdotool sleep 5 DISPLAY=:99 xwd -name "$WIN" | magick xwd:- png:/root/5.png tar -czf images.tar.gz *.png