Files
proxy-suite-flake/windows/tools/wine-install-test.sh
T
faumarayandClaude Opus 5.5 e84d42a10c windows: 0.1.0-pre.1: README, install.cmd, release packaging
- README for the Windows port: what this release does, what has been
  verified and how, install, first run, who may change what, caveats.
- install.cmd / uninstall.cmd ask for administrator rights and run the
  service's own install/uninstall.
- tools/package.sh builds the release zip with every component staged
  and pinned; tools/wine-install-test.sh exercises install, the pipe and
  uninstall under Wine's Service Control Manager.
- Release profile: thin LTO, stripped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:41:53 +03:00

39 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# The release's install and uninstall, under Wine's Service Control Manager: copied into
# Program Files, registered, started, reachable over its pipe, removed.
#
# nix shell nixpkgs#wineWow64Packages.stable -c tools/wine-install-test.sh dist/ProxySuite-<version>-windows-x64
set -euo pipefail
REL=$(realpath "${1:?the unpacked release directory}")
WORK=$(mktemp -d)
export WINEPREFIX=${WINEPREFIX:-$WORK/prefix} WINEDEBUG=-all
trap 'wineserver -k 2>/dev/null || true; rm -rf "$WORK"' EXIT
wineboot -i >/dev/null 2>&1 || true
for key in Tcpip Tcpip6; do
wine reg add "HKLM\\SYSTEM\\CurrentControlSet\\Services\\$key\\Parameters\\Interfaces" /f >/dev/null 2>&1
done
cd "$REL"
echo "== install"
wine ./proxy-suite-service.exe install
PF="$WINEPREFIX/drive_c/Program Files/ProxySuite"
ls "$PF" | sed 's/^/ /'
# Wine's manager often fails the first start right after a create (real Windows does not),
# holding the service in a start that times out after ~50 s: install says so; once that is
# over, a second start works.
for _ in $(seq 40); do
st=$(wine sc query ProxySuite 2>/dev/null || true)
st=${st//$'\r'/}
echo " $(grep STATE <<<"$st" | grep -o '[A-Z_]*$' || true)"
grep -q RUNNING <<<"$st" && break
grep -q STOPPED <<<"$st" && { wine sc start ProxySuite >/dev/null 2>&1 || true; }
sleep 3
done
echo "== status over the pipe"
for _ in $(seq 30); do wine "$PF/proxy-ctl.exe" status 2>/dev/null && break; sleep 1; done
wine "$PF/proxy-ctl.exe" components || {
echo "== service log"; tail -30 "$WINEPREFIX/drive_c/ProgramData/ProxySuite/logs/service.log"; exit 1; }
echo "== uninstall"
wine "$PF/proxy-suite-service.exe" uninstall
sleep 5
[ ! -e "$PF/proxy-suite-service.exe" ] && echo "program files removed" || echo "program files still there"