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

オープン
#1,926 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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時間
マージ済み PR(30日)
28

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

veracrypt/VeraCrypt のほかの issue

veracrypt/VeraCrypt の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。