PrivilegesRequired=lowest makes Inno Setup "always run in non administrative install mode" — the launching token is irrelevant. So a copy that ended up in C:\Program Files, which the destination page still lets an elevated wizard run pick, is registered under HKCU while living somewhere an ordinary process cannot write. UsePreviousAppDir then aims every later run straight back at that directory. WinSparkle launches the downloaded installer with plain ShellExecuteEx and no verb, so nothing along the in-app update path ever asks for elevation: the silent installer starts, cannot replace a single file, and the only way out was to quit Plezy, fetch the installer by hand and pick "Run as administrator". Inno's own PrivilegesRequiredOverridesAllowed plus UsePreviousPrivileges does not help here, because it reads the recorded install mode — which is exactly the non-administrative one that cannot write. Decide on write access instead. InitializeSetup probes the registered install directory and, when it is not writable, relaunches setup through ShellExec 'runas' pinned to that directory with /ALLUSERS, so the update lands in place instead of forking a second per-user copy. The relaunch carries a guard parameter and drops any conflicting mode override, and a refused UAC prompt now explains itself and points at the releases page rather than failing mutely. A machine-wide install that takes over a per-user directory also clears the stale uninstall entry and Start Menu group that would otherwise list Plezy twice in Apps & Features. Fresh installs are unchanged: still per-user, still no prompt. Only commandline is added to PrivilegesRequiredOverridesAllowed, since allowing dialog would make a silent install with no previous copy stop for the install-mode question — which is how winget installs. The script carried two near-identical copies of the whole .iss, one per architecture shape, so both would have needed this code. Collapse them into one template parameterised by architecture, add -EmitScriptOnly to generate the .iss without 7-Zip or Inno Setup, and guard the contract with check_windows_installer.py so the elevation path, the single-source AppId and the winget marker cannot rot. close #1705
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# Workflow and script regression guards.
|
|
#
|
|
# Single source of truth for the guard roster, shared by the "Verify workflow
|
|
# and script guards" step in .github/workflows/ci.yml and section 4 of
|
|
# scripts/ci_checks.sh. The checkers are named explicitly because a few of them
|
|
# belong to other jobs (check_bun_audit.py needs Bun, check_codegen.py runs via
|
|
# codegen.sh), but their regression tests are discovered by glob so a newly
|
|
# added scripts/test_*.py is picked up automatically instead of having to be
|
|
# remembered in two places.
|
|
set -euo pipefail
|
|
shopt -s nullglob
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
for checker in \
|
|
scripts/check_build_workflow.py \
|
|
scripts/check_apple_spm_locks.py \
|
|
scripts/check_tvos_test_wiring.py \
|
|
scripts/check_shrinker_rules.py \
|
|
scripts/verify_runtime_inputs.py \
|
|
scripts/check_workflow_security.py \
|
|
scripts/check_workflow_action_pins.py \
|
|
scripts/check_container_image_pins.py \
|
|
scripts/check_update_packages_workflow.py \
|
|
scripts/check_windows_installer.py; do
|
|
python3 "$checker"
|
|
done
|
|
|
|
for guard_test in scripts/test_*.py; do
|
|
python3 "$guard_test"
|
|
done
|