Main icon indicating copy to clipboard operation
Main copied to clipboard

Standardise `.reg` instructions in manifest notes

Open Lutra-Fs opened this issue 5 months ago • 4 comments

Hi @HUMORCE,

Currently, manifest notes for .reg files are inconsistent:

  • Some show only the bare path, e.g. "$dir\install-context.reg" or "$dir\install-pep-514.reg".
  • Some suggest regedt32 "$dir\something.reg".
  • PR #6260 and #6259 change notes to reg import "$dir\something.reg".

Since Scoop does not import these .reg files automatically, the question is:
Should notes give only the file path (letting the user double-click/merge), or provide an explicit CLI command such as reg import for copy-paste convenience? It also needs to consider HKLM and HKCU's difference.

Considerations:

  • Bare path: Short and simple, works for GUI users, but not directly executable in a terminal.
  • reg import: Fully scriptable, handles spaces safely, no reliance on file associations, but longer. and HKLM requires admin privilege.
  • regedt32: Mostly legacy, not ideal for automation. used by nmap

Possible approaches:

  1. Keep bare path only.
  2. Use reg import exclusively.
  3. Show both:
    Import: "$dir\file.reg" (CLI: reg import "$dir\file.reg")

If we standardise, we could also:

  • Use "Import" rather than "Run" in notes.
  • Always quote the path.
  • Optionally note “per-user; no admin required” for HKCU changes.

Would appreciate your thoughts on:

  • Which pattern we should adopt going forward.
  • Whether to align existing manifests (7zip, python, nmap, etc.) to the chosen format.
  • Whether to update #6260/#6259 to match the agreed style before merge.

Thanks.

Reference: https://grep.app/search?f.repo=ScoopInstaller%2FMain&f.repo.pattern=Scoop&q=.reg

Lutra-Fs avatar Aug 14 '25 02:08 Lutra-Fs

Maybe worth having a wiki page to record those practises.

Lutra-Fs avatar Aug 14 '25 02:08 Lutra-Fs

Which pattern we should adopt going forward

I prefer reg import "<PATH>", because Scoop claims to be a command-line installer for Windows. And MS doc suggest it.

Whether to align existing manifests (7zip, python, nmap, etc.) to the chosen format.

Maybe worth having a wiki page to record those practises.

It should be standard of official buckets instead a thing about Scoop Core, so we go CONTRIBUTING.md. Align when we documented the standard.

It also needs to consider HKLM and HKCU's difference.

In most of cases, they will be replaced correctly by install script. Users should decide for themselves whether to perform importing with sudo.

Out of subject: some manifest do not work correctly when installed globally, or their (un)install scripts not considering for global installation.


Related:

  • Some manifests provides .ps1 script for registry importing, e.g. extras/powertoys
  • Some programs provides built-in context menu management, but manifest provide registry file, e.g. main/7zip

HUMORCE avatar Aug 14 '25 03:08 HUMORCE

Many practises are not documented in CONTRIBUTING.md, BTW.

In most of cases, they will be replaced correctly by install script. Users should decide for themselves whether to perform importing with sudo.

I agree with that.

Lutra-Fs avatar Aug 14 '25 03:08 Lutra-Fs

Many practises are not documented in CONTRIBUTING.md, BTW.

What? fill them at same time as possible.

In my memory:

  • Limitations of process kill
  • Limitations on file operations out the scope of Scoop managed
  • Prefer Scoop Core functions and PowerShell commands on scripts
  • PowerShell Desktop 5.1 compatibility

HUMORCE avatar Aug 14 '25 06:08 HUMORCE