Skip to content

WinBaas: Registry node, View menu, and Visual Studio branch #6

Description

@KlausLoeffelmann

Summary

Extend WinBaas.App (src/WinForms/NET10/WinBaas) along three axes:

  1. Registry node — a new top-level Registry tree branch seeded with
    the most frequently manually changed registry settings. Different
    right-pane schema (Value · Registry path · Brief description),
    abbreviated description in the grid, full description in the
    StatusStrip. If selected for backup, emit a Registry Backup folder
    containing a PowerShell restore script (plus a single .reg file).
  2. View menu — new top-level View MenuStrip item with
    Expand all nodes, Collapse all nodes, Expand selected.
  3. Visual Studio branch — completely different shape:
    • Top-level Visual Studio node.
      • Selecting it shows a flat overview (one row per installed SKU):
        SKU display name, install date, version, settings-file path under
        %LOCALAPPDATA%\Microsoft\VisualStudio\<hive>.
      • Children: one node per installed SKU
        (year / SKU edition / ring), e.g. VS 2026 — Enterprise — Int.Preview.
        Each SKU node has two children: Hives and Extensions.
        • Hives shows the experimental hives for that SKU
          (e.g. 18.0, 18.0_b83bbaee) as rows of
          Label (hive name) · LinkLabel (path) · Button (Copy).
        • Extensions lists the installed extensions for that SKU.
      • Checking an SKU ⇒ back up that SKU's hives + extensions folders.

The existing Visual Studio 2022 entry under Developer Tools is removed
— Visual Studio is now exclusively reachable through the new top-level
branch.

High-level approach

  • Right pane becomes pluggable. Replace the single _grid in
    _splitInner.Panel1 with a container (_detailHost) that hosts one of
    several detail UserControls, chosen by the type of the selected tree
    node. New controls: FilesGridControl (current behaviour, extracted),
    RegistryGridControl, VsOverviewControl, VsHivesControl,
    VsExtensionsControl. Each control exposes the events FrmMain
    needs (checked-state changes, selection changes, status-text changes).
  • Node-tag taxonomy. Beyond the existing CatalogEntry /
    CategoryTag, introduce RegistryGroupTag, VsRootTag, VsSku,
    VsHivesTag, VsExtensionsTag so the tree carries the data each
    detail control needs without leaking the catalog model.
  • Discovery extensions. Two new discovery paths in DiscoveryService
    (or dedicated services): Registry (probe each curated registry value,
    return observed value + IsPresent) and VisualStudio (vswhere
    primary, hive-folder fallback).
  • Backup extensions. BackupService learns two new shapes:
    • Registry Backup\restore.ps1 + per-value .reg dump.
    • Per-SKU folder copies for VS hives and extensions, with cache
      folders excluded.
  • Catalog edit. Remove the existing Visual Studio 2022 entry from
    BuildDeveloperSeed; add the Registry + Visual Studio top-level
    entries.

Files touched (planned)

New

  • Models/RegistryDescriptor.cs — curated value: hive (HKCU/HKLM/…),
    path, value name, value kind, short description, full description,
    default value (optional).
  • Models/RegistryDiscoveredItem.cs — observed value + IsPresent
    flag + descriptor reference.
  • Models/VsSku.cs — year, edition (Community/Professional/Enterprise),
    ring (Release/Preview/IntPreview/Main), version, install date,
    settings-file path, hive root.
  • Models/VsHive.cs — hive folder name, absolute path.
  • Models/VsExtension.cs — name, publisher, version, install path.
  • Services/IRegistryCatalog.cs + RegistryCatalog.cs — seeds the
    ~25 curated registry entries.
  • Services/IVisualStudioDiscovery.cs + VisualStudioDiscovery.cs
    finds installed SKUs (vswhere preferred, hive-folder fallback),
    hives, extensions.
  • Controls/FilesGridControl.cs (+ .Designer.cs) — current
    files/folders/env-var/SQL grid behaviour extracted from FrmMain.
  • Controls/RegistryGridControl.cs (+ .Designer.cs) — three columns:
    [✓] · Value · Registry path · Description (abbreviated). Raises
    StatusTextChanged with the full description on row enter/select.
  • Controls/VsOverviewControl.cs (+ .Designer.cs) — flat grid of SKUs.
  • Controls/VsHivesControl.cs (+ .Designer.cs) — TableLayoutPanel
    rows of Label (hive name) + LinkLabel (path) + Button (Copy).
  • Controls/VsExtensionsControl.cs (+ .Designer.cs) — list/grid of
    installed extensions.

Modified

  • Models/CatalogEntryKind.cs — add Registry, VisualStudio.
  • Services/DiscoveryService.cs — route Registry and VisualStudio
    kinds to the new helpers / dedicated services.
  • Services/BackupService.cs — recognise registry items and VsSku
    selections; emit Registry Backup\restore.ps1 + .reg; copy per-SKU
    hive + extension folders.
  • Services/CatalogService.cs — remove the Visual Studio 2022
    developer entry; add Registry and Visual Studio entries that
    act as the roots populated by the new specialised discoveries.
  • FrmMain.Designer.cs — add View menu (Expand all, Collapse all, Expand selected); replace direct _grid placement in
    _splitInner.Panel1 with a _detailHost panel; promote _grid
    ownership into FilesGridControl.
  • FrmMain.cs / FrmMain.TreeSync.cs / FrmMain.Commands.cs
    • Populate Registry + VS branches alongside catalog branches.
    • On AfterSelect, swap the detail control hosted in _detailHost.
    • Wire View menu commands.
    • Route status-text updates from detail controls into _statusInfo.

Registry seed (~25 entries)

Curated across these themes (final list trimmed during implementation):

  • Explorer: ShowSuperHidden, Hidden, HideFileExt, LaunchTo,
    AutoCheckSelect.
  • Taskbar: TaskbarAl (alignment), TaskbarDa (widgets),
    TaskbarMn (chat), ShowTaskViewButton, SearchboxTaskbarMode.
  • Search: BingSearchEnabled, CortanaConsent.
  • Privacy / Telemetry: AllowTelemetry,
    TailoredExperiencesWithDiagnosticDataEnabled, Start_TrackProgs.
  • Windows Update: PauseUpdatesExpiryTime, BranchReadinessLevel.
  • Dev Mode: AllowDevelopmentWithoutDevLicense,
    AllowAllTrustedApps, LongPathsEnabled.
  • Context Menu (Win11):
    {86ca1aa0-34aa-4e8b-a509-50c905bae2a2} shell-extension override
    (restore classic context menu).
  • Power / UX: HibernateEnabled (HKLM), VerboseStatus.
  • Defender: DisableAntiSpyware (HKLM, informational only — flagged
    as policy-only).

If a value is not present on the machine it is still listed (greyed,
checkbox disabled) so the user knows it exists in the catalog.

Registry backup output

<destination>\Registry Backup\
    restore.ps1
    WinBaas-Registry-<timestamp>.reg
  • restore.ps1 — for each selected entry, write the recorded value
    back (New-Item -Force + Set-ItemProperty -Force) using the
    descriptor's RegistryValueKind.
  • WinBaas-Registry-<timestamp>.reg — single .reg file with the
    captured values, importable via regedit /s.
  • Skipped (not-present) entries are emitted as commented-out lines in
    both files so the user can opt-in later.

Visual Studio discovery

  1. Primary: invoke vswhere.exe if discoverable
    (%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe)
    with -prerelease -all -format json to obtain
    installationVersion, installDate, displayName, channelId,
    productId, productLineVersion (year), installationPath.
  2. Fallback: enumerate %LOCALAPPDATA%\Microsoft\VisualStudio\ for
    17.*, 18.* hives and parse:
    • 17.0_xxxxxxxx → VS 2022 Release main hive.
    • 17.0_xxxxxxxxExp → experimental hive.
    • 18.0_xxxxxxxx → VS 2026 Main / Int.Preview (channel decoded via
      Settings\ApplicationPrivateSettings.xml ChannelId where
      available).
  3. SKU node label: "VS {year} — {edition} — {ring}". When channel
    data is not available we still surface a (unknown ring) placeholder.
  4. Settings file:
    %LOCALAPPDATA%\Microsoft\VisualStudio\<hive>\CurrentSettings.vssettings
    if present, else the hive root.

Visual Studio backup output

<destination>\Visual Studio\<SkuLabel>\
    Hives\<hive>\…
    Extensions\<extension>\…
    summary.md
  • Hives\<hive>\ — copy of the hive folder, excluding caches:
    ComponentModelCache, Backup Files, ImageLibrary, MEFCache,
    ShellPackages.pkgdef.
  • Extensions\<extension>\ — copy of the SKU's Extensions sub-folder.
  • summary.md — per-SKU enumerates hives, extensions, and the
    settings-file path captured at backup time.

View menu

  • Expand all nodes_treeSources.ExpandAll().
  • Collapse all nodes_treeSources.CollapseAll().
  • Expand selected — recursively expand _treeSources.SelectedNode
    (no-op when null).

Persist nothing extra — tree state already round-trips via
PersistTreeState / RestoreTreeState. The change just needs to keep
working for the new top-level branches.

Open items (resolve during implementation)

  • Microsoft.Win32 registry APIs are net10-windows-only; the project
    already targets net10.0-windows10.0.22000.0, so no csproj change.
  • HKLM values surface read-only / require elevation — flag in
    description text and skip silently on access denial.
  • vswhere is optional; the fallback path covers VS 2026 Insiders
    cleanly.
  • RegistryGridControl description abbreviation: truncate at the first
    sentence boundary or ~80 chars (whichever shorter), with suffix.

Verification

dotnet build src\WinForms\NET10\WinBaas\WinBaas.slnx

Implementation checklist

  • extract-files-grid — pull current _grid plumbing into
    FilesGridControl; introduce _detailHost in FrmMain.Designer.cs.
  • registry-models — add RegistryDescriptor,
    RegistryDiscoveredItem, registry-related enum additions.
  • registry-catalogIRegistryCatalog + RegistryCatalog
    seeded with ~25 curated entries.
  • registry-discovery — registry probing; returns observed
    values plus exists flag.
  • registry-grid-controlRegistryGridControl UserControl +
    Designer.
  • registry-backup — emit Registry Backup\restore.ps1 + .reg
    from BackupService when registry items are selected.
  • vs-modelsVsSku, VsHive, VsExtension.
  • vs-discoveryIVisualStudioDiscovery +
    VisualStudioDiscovery (vswhere primary, hive-folder fallback).
  • vs-overview-control — flat SKU grid.
  • vs-hives-control — LinkLabel + Copy button rows.
  • vs-extensions-control — extensions grid.
  • vs-tree-population — build VS branch (root → SKU →
    Hives/Extensions) during PopulateSourceTree.
  • vs-backup — per-SKU hive + extension folder copy with caches
    excluded.
  • catalog-edits — remove Visual Studio 2022 Developer-Tools
    entry; add Registry + VS root entries.
  • view-menu — add View menu items + handlers.
  • detail-host-wiring — pick the right UserControl in
    AfterSelect; route StatusTextChanged into _statusInfo.
  • tree-state-compat — ensure new top-level branches restore
    expansion state.
  • build-verify
    dotnet build src\WinForms\NET10\WinBaas\WinBaas.slnx clean.

Activity

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

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions