ProxySuite-<version>-windows-x64-setup.exe (NSIS, English and Russian): it unpacks the release into its temporary folder and runs the release's own proxy-suite-service.exe install from there, as install.cmd does from the zip (unpacked straight into Program Files, an upgrade would find its files in use). It refuses 32-bit Windows and anything before 10 1903, and offers Windows' OpenSSH Client, unchecked, for the SSH tunnel. install now writes the entry in Settings > Apps (uninstall.cmd; quietly, the service's uninstall), and uninstall removes it, with WinDivert's driver service when it is the suite's own. The release workflow publishes the setup beside the zip. The app's icon and GPUI's manifest share one resource (llvm-rc for both); the build scripts' clones retry, and are kept for the next build. Tested under Wine: tools/wine-setup-test.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
86 lines
3.9 KiB
Bash
Executable File
86 lines
3.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The setup program under Wine: a silent install into Program Files (every file, the
|
|
# components' manifests among them), the entry in Settings > Apps, the service registered and
|
|
# answering over its pipe; the same setup again over the running install (an upgrade); then the
|
|
# entry's quiet uninstall, after which the service, the files and the entry are gone.
|
|
#
|
|
# nix shell nixpkgs#wineWow64Packages.stable -c tools/wine-setup-test.sh dist/ProxySuite-<version>-windows-x64-setup.exe [RELEASE_DIR]
|
|
#
|
|
# RELEASE_DIR (the unpacked release the setup was made of): its files are compared with the
|
|
# installed ones.
|
|
set -euo pipefail
|
|
SETUP=$(realpath "${1:?the setup program}")
|
|
REL=${2:+$(realpath "$2")}
|
|
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
|
|
PF="$WINEPREFIX/drive_c/Program Files/ProxySuite"
|
|
KEY='HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\ProxySuite'
|
|
fail() { echo "FAIL: $*"; exit 1; }
|
|
|
|
state() { local st; st=$(wine sc query ProxySuite 2>/dev/null || true); st=${st//$'\r'/}; grep STATE <<<"$st" | grep -o '[A-Z_]*$' || echo NONE; }
|
|
# Wine's manager often fails the first start right after a create (wine-install-test.sh says
|
|
# more); a second start works.
|
|
running() {
|
|
local s last=""
|
|
for _ in $(seq 60); do
|
|
s=$(state)
|
|
[ "$s" = "$last" ] || echo " $s"
|
|
last=$s
|
|
[ "$s" = RUNNING ] && return 0
|
|
[ "$s" = STOPPED ] && { wine sc start ProxySuite >/dev/null 2>&1 || true; }
|
|
sleep 3
|
|
done
|
|
return 1
|
|
}
|
|
|
|
echo "== setup /S"
|
|
wine "$SETUP" /S && rc=0 || rc=$?
|
|
echo " exit code $rc"
|
|
[ "$rc" = 0 ] || fail "setup exited with $rc"
|
|
[ -f "$PF/proxy-suite-service.exe" ] || fail "nothing in Program Files"
|
|
ls "$PF" | sed 's/^/ /'
|
|
if [ -n "$REL" ]; then
|
|
# Every file of the release, dotfiles too (the components' .files.json and .version).
|
|
missing=$(cd "$REL" && find . -type f | while read -r f; do [ -f "$PF/$f" ] || echo "$f"; done)
|
|
[ -z "$missing" ] || fail "not installed: $missing"
|
|
echo " every file of the release is there ($(cd "$REL" && find . -type f | wc -l))"
|
|
fi
|
|
ls "$PF"/components/*/.files.json >/dev/null || fail "no component manifests"
|
|
|
|
echo "== Settings > Apps"
|
|
entry=$(wine reg query "$KEY" 2>/dev/null | tr -d '\r') || fail "no uninstall entry"
|
|
sed 's/^/ /' <<<"$entry"
|
|
for v in DisplayName DisplayVersion UninstallString QuietUninstallString InstallLocation EstimatedSize; do
|
|
grep -q "$v" <<<"$entry" || fail "the entry has no $v"
|
|
done
|
|
|
|
echo "== the service"
|
|
running || fail "the service is $(state)"
|
|
for _ in $(seq 30); do wine "$PF/proxy-ctl.exe" status >/dev/null 2>&1 && break; sleep 1; done
|
|
wine "$PF/proxy-ctl.exe" components | tr -d '\r' | sed 's/^/ /' || fail "no answer over the pipe"
|
|
|
|
echo "== setup /S again, over the running install"
|
|
wine "$SETUP" /S && rc=0 || rc=$?
|
|
[ "$rc" = 0 ] || fail "the upgrade exited with $rc"
|
|
running || fail "after the upgrade the service is $(state)"
|
|
for _ in $(seq 30); do wine "$PF/proxy-ctl.exe" status >/dev/null 2>&1 && break; sleep 1; done
|
|
wine "$PF/proxy-ctl.exe" status >/dev/null 2>&1 || fail "no answer after the upgrade"
|
|
echo " upgraded, running, answering"
|
|
|
|
echo "== the entry's quiet uninstall"
|
|
quiet=$(wine reg query "$KEY" /v QuietUninstallString | tr -d '\r' | sed -n 's/.*REG_SZ *//p')
|
|
echo " $quiet"
|
|
# Its command line, as Windows would run it: the quoted program, then its argument.
|
|
prog=${quiet#\"}; prog=${prog%%\"*}
|
|
wine "$prog" uninstall
|
|
sleep 6
|
|
[ "$(state)" = NONE ] || fail "the service is still there: $(state)"
|
|
wine reg query "$KEY" >/dev/null 2>&1 && fail "the entry is still there"
|
|
[ ! -e "$PF" ] || fail "Program Files\\ProxySuite is still there: $(ls "$PF")"
|
|
echo "OK: installed, upgraded and removed by the setup program and its entry"
|