Skip to content

feat(updater): make update hook timeout configurable - #1

Draft
folex wants to merge 2 commits into
developfrom
feat/configurable-update-hook-timeout
Draft

feat(updater): make update hook timeout configurable#1
folex wants to merge 2 commits into
developfrom
feat/configurable-update-hook-timeout

Conversation

@folex

@folex folex commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

This starts the Velopack fork needed to simplify Studio installation. Windows before-update and after-update hooks now have a 60-second default instead of 15 seconds, with a bounded runtime override from 1 to 300 seconds.

The timeout can be set with VELOPACK_UPDATE_HOOK_TIMEOUT_SECONDS or the updater's --hookTimeoutSeconds option. The CLI value wins. Invalid environment values log a warning and fall back to 60 seconds.

Elevated updates pass the resolved value explicitly to the child process. The parent wait now reserves 10 minutes for update work plus two hook timeout windows, so the maximum valid hook configuration cannot exhaust the parent wait by itself.

Install and uninstall hook limits are unchanged. Removing Studio's scheduled tasks remains follow-up work after this fork is published and consumed.

Validation

  • cargo test -p velopack_bins - 25 passed, 1 ignored across library, updater, and integration tests.
  • cargo clippy -p velopack_bins --lib --bin update - passed.
  • cargo build -p velopack_libc - passed and regenerated the C header.
  • git diff --check - passed.
  • A Windows-target check was attempted from macOS but stopped in native dependencies because the Windows SDK C headers are unavailable. Windows CI and a real UAC update remain required.

Post-Deploy Monitoring & Validation

  • Run one packaged Windows update with a hook that lasts more than 15 seconds but less than 60 seconds.
  • Run the same update through the UAC elevation path and verify the configured timeout reaches the elevated child.
  • Check updater logs for Update Hook Timeout, Hook executed successfully, and Process timed out after.
  • Healthy: the hook completes, no process is killed at 15 seconds, and the elevated parent waits for the child.
  • Failure: the hook is killed at 15 seconds, the override is lost after elevation, or the parent times out while the child still applies the package.
  • Rollback: return Studio to the upstream Velopack package or revert these two commits before removing scheduled-task workarounds.

Known Residuals

  • Native Windows/MSVC compilation and UAC runtime behavior were not executable in the macOS environment.
  • Existing hook-mode propagation across elevation is unchanged; this PR only propagates and budgets the timeout.

Compound Engineering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant