Skip to content

Installer: user-mode install via /CURRENTUSER (PR-B)#2022

Draft
tyrielv wants to merge 6 commits into
microsoft:masterfrom
tyrielv:tyrielv/user-mode-installer
Draft

Installer: user-mode install via /CURRENTUSER (PR-B)#2022
tyrielv wants to merge 6 commits into
microsoft:masterfrom
tyrielv:tyrielv/user-mode-installer

Conversation

@tyrielv

@tyrielv tyrielv commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

PR-B: Extend the existing installer with user-mode install path

Stacked on PR #2020 (PR-A: co-shippable infrastructure).

Adds a /CURRENTUSER\ flag to the existing \SetupGVFS.exe\ installer (Inno Setup 6 \PrivilegesRequiredOverridesAllowed=commandline). Default behavior (admin, system-mode) is unchanged.

User-mode flow (\SetupGVFS.exe /VERYSILENT /CURRENTUSER)

  1. Drift-detect: checks ProjFS enabled + EnableProjFSOnAllDrives task registered
  2. Self-elevate if needed: re-launches with /ADMINSTAGE=true\ for ProjFS enable + task registration (single UAC prompt)
  3. Deploy payload: %LocalAppData%\GVFS\Versions\\\
  4. Junction swap: \Current\ junction with \gvfs.exe version\ verification + rollback on failure
  5. User PATH + env vars: HKCU PATH, \GVFS_SECURE_DATA_ROOT, \GVFS_COMMON_APPDATA_ROOT\
  6. Logon task: \\GVFS\AutoMount\ via \conhost.exe --headless\ (no window flash)
  7. Version GC: keeps most recent 2 version directories

Build changes

\GVFS.Installers.csproj: new \BuildProjFSTaskXml\ MSBuild target runs \�uild-task-xml.ps1\ (from PR-A commit A5) and passes the output to ISCC.

Testing

  • Setup.iss compiles clean with Inno Setup 6.4.3
  • System-mode install path unchanged (all new code gated behind Check functions)
  • Code-review findings fixed: /ADMINSTAGE=true param syntax, junction rollback restoration, logon task XML encoding

tyrielv added 6 commits June 15, 2026 11:45
Adds LocalRepoRegistration (POCO + source-gen JSON context) and
LocalRepoRegistry (instance class) to GVFS.Common. Wire-compatible
with the service's on-disk repo-registry format.

18 new unit tests. 836/836 pass (818 prior + 18 new).

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…navailable

MountVerb.RegisterMount, UnmountVerb.UnregisterRepo, and
ServiceVerb.TryGetRepoList fall back to LocalRepoRegistry when the
service pipe fails to open. Behavior unchanged when service is running.

UnmountVerb distinguishes not-found (benign no-op) from I/O errors
(propagated to caller) in the fallback path.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
…navailable

Returns true when the service pipe fails to open. In user-level
install model the boot-time EnableProjFSOnAllDrives task handles
PrjFlt. Removes now-orphaned StartServiceInstructions constant.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Adds IScheduledTaskInvoker, SchTasksScheduledTaskInvoker, and
LogonTaskRegistration. Manages a per-user logon task that runs
gvfs.exe service --mount-all via conhost.exe --headless to prevent
console window flash. Drift detection via full SHA-256 hash marker.

21 new unit tests. 857/857 pass.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
… task

Three files under scripts/projfs-attach/: the PS1 script body,
the task XML template with placeholders, and build-task-xml.ps1
that base64-encodes the script into the template. None deployed
to disk; the installer embeds via -EncodedCommand.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Extends the existing Inno Setup installer with a /CURRENTUSER flag
that routes to a complete user-mode install path. Default behavior
(admin, system-mode) is unchanged.

User-mode (/CURRENTUSER) flow:
  1. Drift-detect: checks ProjFS enabled + EnableProjFSOnAllDrives
     task registered with current hash marker
  2. If drift detected: self-elevates via /ADMINSTAGE=true to enable
     ProjFS and register the task from pre-built embedded XML
  3. Deploys payload to %LocalAppData%\GVFS\Versions\<version>\
  4. Creates/swaps Current junction with verification + rollback
  5. Updates user PATH (HKCU) and GVFS env vars
  6. Registers per-user \GVFS\AutoMount logon task (conhost --headless)
  7. GCs old versions (keeps most recent 2)

Build changes:
  - GVFS.Installers.csproj: BuildProjFSTaskXml target runs
    build-task-xml.ps1 and passes output to ISCC
  - Setup.iss: PrivilegesRequiredOverridesAllowed=commandline

Review fixes incorporated:
  - /ADMINSTAGE=true (not bare /ADMINSTAGE) for Inno Setup param parsing
  - Junction rollback reads old target via fsutil reparsepoint query
    and actually restores it via mklink /J
  - Logon task XML declares UTF-8 encoding (matches SaveStringToFile)

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
@tyrielv tyrielv force-pushed the tyrielv/user-mode-installer branch from 7f03e85 to 06067b8 Compare June 15, 2026 18:54
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