[Windows 11] Feature request: run local commands after mount / before dismount (per favorite volume)

未关闭
#1,926 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
c
领域
desktop, security

调研方向

Start by tracing the mount and dismount paths named in the request: GUI, tray, hotkeys, auto-dismount, and command-line /d; the issue does not identify source files or tests. Determine where per-favorite settings are stored and how commands could run with a timeout and affect dismount. Done means commands run at the requested lifecycle points across those paths, with the specified cancellation behavior.

由索引模型根据 Issue 内容生成。

描述

Desired behavior

Follow-up to #131, which was closed automatically by the stale bot in 2021 without being implemented. I need this specifically on Windows 11, where there is currently no reliable way to do it.

Please add the ability to run local commands after mount and before/after dismount, configured per favorite volume.

Use case: we keep a PostgreSQL data directory on a VeraCrypt volume (Windows service). The service must be started after the volume is mounted and, more importantly, stopped before dismount: PostgreSQL's background processes keep files open, so a normal dismount fails with "files in use", and a forced dismount (including auto-dismount on user logoff with "Force auto-dismount" enabled) makes PostgreSQL crash and run crash recovery on the next start.

Why existing Windows 11 mechanisms don't solve it:

  • Wrapper .bat/.ps1 scripts around VeraCrypt.exe /v and /d only work when the user uses them; they don't cover mounting/dismounting from the GUI, tray icon, hotkeys or auto-dismount.
  • Group Policy shutdown scripts run only after user logoff, i.e. after VeraCrypt's logoff auto-dismount has already happened, and they are skipped entirely when Fast Startup is enabled (Windows 11 default).
  • Polling for the drive letter in a scheduled task covers mount only, not dismount.

Screenshots/Mockup/Designs

In Favorites > Organize Favorite Volumes, three new fields per volume:

  • Run after mount: [ command ]
  • Run before dismount: [ command ] timeout: [ 60 ] s
  • Run after dismount: [ command ]

Additional information

  • Run "before dismount" synchronously (with the configurable timeout) before VeraCrypt checks for open files, for every dismount path: GUI, tray, hotkey, auto-dismount (logoff, power saving, inactivity), command line /d.
  • Allow the command to run elevated if needed (stopping a Windows service requires administrator rights).
  • Pass drive letter and volume path as arguments or environment variables.
  • If the pre-dismount command returns non-zero, cancel the dismount (unless forced).
  • Commands are stored locally (not inside the container), which avoids the security concern of a volume executing code on mount.

This would cover any Windows service whose data lives on an encrypted volume (databases, sync clients, backup agents).

Your Environment

VeraCrypt version: 1.26.29

Operating system and version: Windows 11 Pro, 26H2

System type: 64-bit

主要语言
C
星标
11.7k
派生
1.4k
平均合并
1 天 1 小时
30 天内合并 PR
28

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

veracrypt/VeraCrypt 的其他 Issue

查看 veracrypt/VeraCrypt 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。