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>
This commit is contained in:
1 parent
8af7b2e628
commit
e84d42a10c
9 files changed
+280
-5
No files matched your search
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
:: Proxy Suite: install, or upgrade, as an administrator. Copies the program into
|
||||
:: %ProgramFiles%\ProxySuite, registers the service there and starts it.
|
||||
net session >nul 2>&1 || (
|
||||
powershell -NoProfile -Command "Start-Process -Verb RunAs -FilePath '%~f0'"
|
||||
exit /b
|
||||
)
|
||||
"%~dp0proxy-suite-service.exe" install
|
||||
pause
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
# The release: ProxySuite-<version>-windows-x64.zip in dist/, with the programs, every
|
||||
# component (fetched and verified), the install scripts, the README and the licenses.
|
||||
#
|
||||
# nix develop --command tools/package.sh (needs curl, git, unzip, zip, pip)
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||||
NAME=ProxySuite-$VERSION-windows-x64
|
||||
DIST=dist/$NAME
|
||||
CACHE=${CACHE:-${XDG_CACHE_HOME:-$HOME/.cache}/proxy-suite-windows}
|
||||
rm -rf "$DIST" "dist/$NAME.zip"
|
||||
mkdir -p "$DIST/components"
|
||||
|
||||
echo "== components"
|
||||
tools/build-tg-ws-proxy.sh "$DIST/components/tg-ws-proxy"
|
||||
cargo build -q --release -p ps-service
|
||||
target/release/proxy-suite-service stage-components --to "$DIST/components" --cache "$CACHE"
|
||||
rm -rf "$DIST"/components/*.old "$DIST"/components/*.staging
|
||||
|
||||
echo "== programs"
|
||||
cargo xwin build -q --release -p ps-service -p ps-ctl --target x86_64-pc-windows-msvc
|
||||
cp target/x86_64-pc-windows-msvc/release/proxy-suite-service.exe target/x86_64-pc-windows-msvc/release/proxy-ctl.exe "$DIST/"
|
||||
cp ../LICENSE README.md "$DIST/"
|
||||
cp tools/install.cmd tools/uninstall.cmd "$DIST/"
|
||||
|
||||
echo "== THIRD-PARTY.md"
|
||||
{
|
||||
echo "# Third-party components"
|
||||
echo
|
||||
echo "Proxy Suite for Windows ($VERSION) is MIT-licensed (LICENSE). It carries, unchanged, the"
|
||||
echo "programs below, each from its project's own release, pinned by version and hash in"
|
||||
echo "components.json. Their licenses are theirs; where a license asks for its source, it is at"
|
||||
echo "the address given."
|
||||
echo
|
||||
echo "| Component | Version | License | Source |"
|
||||
echo "|---|---|---|---|"
|
||||
jq -r '.components | to_entries[] | "| \(.key) | \(.value.version) | \(.value.license) | \(.value.homepage) |"' components.json
|
||||
echo
|
||||
echo "Inside them:"
|
||||
echo
|
||||
echo "- **WinDivert** (zapret, zapret2): LGPL-3.0 or GPL-2.0, https://github.com/basil00/WinDivert"
|
||||
echo "- **cygwin1.dll** (zapret, zapret2): LGPL-3.0, https://cygwin.com"
|
||||
echo "- **zapret2** (winws2.exe, its Lua) and **nfqws2-keenetic** (its strategies, lists, blobs): MIT, https://github.com/bol-van/zapret2, https://github.com/nfqws/nfqws2-keenetic"
|
||||
echo "- **wintun** (inside sing-box): WireGuard's prebuilt-binary license, https://www.wintun.net"
|
||||
echo "- **CPython $( sed 's/.*+py//' "$DIST/components/tg-ws-proxy/.version" )** (tg-ws-proxy): PSF License, https://www.python.org"
|
||||
echo "- **Python packages** (tg-ws-proxy):"
|
||||
sed -n 's/^\([A-Za-z0-9_.-]*\)==\([^ ]*\) .*/ - \1 \2, https:\/\/pypi.org\/project\/\1\/\2\//p' tools/tg-ws-proxy-requirements.txt
|
||||
echo
|
||||
echo "License files that came with them:"
|
||||
echo
|
||||
(cd "$DIST" && find components -iname 'LICENSE*' -o -iname 'COPYING*' | sort | sed 's/^/- /')
|
||||
} > "$DIST/THIRD-PARTY.md"
|
||||
|
||||
echo "== zip"
|
||||
(cd dist && zip -qr "$NAME.zip" "$NAME")
|
||||
(cd dist && sha256sum "$NAME.zip" | tee "$NAME.zip.sha256")
|
||||
du -h "dist/$NAME.zip"
|
||||
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
:: Proxy Suite: remove the service and the program. The configuration and state stay in
|
||||
:: %ProgramData%\ProxySuite.
|
||||
net session >nul 2>&1 || (
|
||||
powershell -NoProfile -Command "Start-Process -Verb RunAs -FilePath '%~f0'"
|
||||
exit /b
|
||||
)
|
||||
:: One line: cmd reads a batch file line by line, and this one is deleted meanwhile.
|
||||
"%~dp0proxy-suite-service.exe" uninstall & pause & exit /b
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/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"
|
||||
Reference in new issue
Block a user