Skip to content

astrogrep@4.4.9: add Explorer context menu integration script#17899

Open
arvdk wants to merge 5 commits into
ScoopInstaller:masterfrom
arvdk:astrogrep-context-menu
Open

astrogrep@4.4.9: add Explorer context menu integration script#17899
arvdk wants to merge 5 commits into
ScoopInstaller:masterfrom
arvdk:astrogrep-context-menu

Conversation

@arvdk

@arvdk arvdk commented May 26, 2026

Copy link
Copy Markdown
Contributor

Changes:

  • Two .reg files are added in a new directory 'astrogrep', within the scripts folder of the extras bucket.
  • The astrogrep manifest is expanded with a post_install and an uninstaller section. The implementation is copied from notepadplusplus.

Closes #17898

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3009a588-4ab1-43a1-b6d3-655d295cf9e5

📥 Commits

Reviewing files that changed from the base of the PR and between 132ad46 and 5bae6f8.

📒 Files selected for processing (1)
  • bucket/astrogrep.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • bucket/astrogrep.json

📝 Walkthrough

Walkthrough

This PR adds Windows Registry context menu integration for AstroGrep. It introduces two registry templates (install-context.reg and uninstall-context.reg) and updates the manifest with a post_install hook that substitutes the installed AstroGrep.exe path into those templates (escaping backslashes), optionally rewrites HKEY_CURRENT_USER to HKEY_LOCAL_MACHINE when $global is set, writes the generated .reg files to $dir, and provides an uninstaller script that imports or prints the uninstall .reg. Manifest notes were updated to document using reg import "$dir\install-context.reg".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Explorer context menu integration to AstroGrep, with version specification for clarity.
Description check ✅ Passed The description covers the main changes, references the closed issue, and confirms checklist items; however, it lacks detail about implementation specifics.
Linked Issues check ✅ Passed The PR successfully addresses issue #17898 by adding registry integration files and manifest support for Explorer context menu, matching the expected behavior of similar packages.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing Explorer context menu integration for AstroGrep as requested in issue #17898; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@arvdk

arvdk commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

/verify
My first PR ever :)

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

astrogrep

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
bucket/astrogrep.json (2)

6-6: ⚡ Quick win

Consider automating registry import in post_install or clarifying manual step.

The note instructs users to manually run reg import "$dir\\install-context.reg", but the uninstaller automatically imports uninstall-context.reg (line 30). This creates an asymmetry: installation requires manual intervention, but uninstallation is automatic.

Consider either:

  1. Adding automatic registry import to post_install (similar to how uninstaller works), or
  2. If keeping manual installation, ensure the note is clear that this is an optional feature

The lockhunter.json manifest (context snippet) uses the same manual approach with clearer conditional logic in the uninstaller to detect whether the registry was actually imported.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bucket/astrogrep.json` at line 6, The manifest currently instructs manual
registry import via the "notes" entry for install-context.reg while the
"uninstaller" automatically imports uninstall-context.reg; update the manifest
to remove asymmetry by either (A) adding an automated registry import step in
post_install that runs reg import for install-context.reg (and set a
flag/registry marker that the uninstaller can detect, mirroring the logic used
in lockhunter.json), or (B) keep manual install but edit the "notes" text to
explicitly state the registry import is optional and document why it’s manual;
reference the "post_install" hook, the "uninstaller" behavior, and the
install-context.reg/uninstall-context.reg files when making the change.

28-28: 💤 Low value

Remove redundant condition check.

The check if ($cmd -eq 'uninstall') is redundant because the uninstaller.script only executes during uninstallation. This condition will always be true in this context.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bucket/astrogrep.json` at line 28, Remove the redundant conditional check "if
($cmd -eq 'uninstall')" from the uninstaller script entry (the
uninstaller.script that currently contains that if-statement), because the
script only runs during uninstallation; simply execute the uninstall commands
directly inside that script block and delete the surrounding if statement and
its matching endif to avoid dead/always-true branching.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@bucket/astrogrep.json`:
- Around line 26-33: The uninstaller script currently always runs `reg import
"$dir\\uninstall-context.reg"` and doesn't handle global installs; update the
`uninstaller` logic to detect the `$global` flag (same flag used in
`post_install`) and, if set, attempt to remove HKLM entries instead of HKCU:
check existence of the uninstall registry key under both `HKEY_CURRENT_USER` and
`HKEY_LOCAL_MACHINE` and invoke the appropriate import/delete command, using
elevation (e.g., prefixing with `sudo` or the Windows elevation method used in
your repo) when operating on `HKEY_LOCAL_MACHINE`, so global installs are fully
cleaned up.

In `@scripts/astrogrep/install-context.reg`:
- Around line 3-13: The registry keys currently use the literal key name "Search
using &AstroGrep" which contains spaces and an ampersand; rename those keys to a
simple identifier like "AstroGrep" under both Directory\shell and
Directory\Background\shell, and keep the human-readable text in the default
value (the @="Search using &AstroGrep...") and preserve the "Icon" and command
default values (the @="\"$astro\" \"%V\"" entries) under the new AstroGrep key
and its \command subkey so behavior and displayed text remain the same.

In `@scripts/astrogrep/uninstall-context.reg`:
- Around line 3-6: Update the registry key names in uninstall-context.reg to
match the corrected install-context.reg by replacing occurrences of "Search
using &AstroGrep" with the simple key name "AstroGrep" for the Directory and
Directory\Background shell keys (i.e., change
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search using &AstroGrep]
and [-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Search using
&AstroGrep] to use "AstroGrep"); also remove the explicit deletions of the
\command subkeys (the lines deleting
[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Search using
&AstroGrep\command] and
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Search using
&AstroGrep\command]) since deleting the parent keys (Directory\shell\AstroGrep
and Directory\Background\shell\AstroGrep) already removes child keys.

---

Nitpick comments:
In `@bucket/astrogrep.json`:
- Line 6: The manifest currently instructs manual registry import via the
"notes" entry for install-context.reg while the "uninstaller" automatically
imports uninstall-context.reg; update the manifest to remove asymmetry by either
(A) adding an automated registry import step in post_install that runs reg
import for install-context.reg (and set a flag/registry marker that the
uninstaller can detect, mirroring the logic used in lockhunter.json), or (B)
keep manual install but edit the "notes" text to explicitly state the registry
import is optional and document why it’s manual; reference the "post_install"
hook, the "uninstaller" behavior, and the
install-context.reg/uninstall-context.reg files when making the change.
- Line 28: Remove the redundant conditional check "if ($cmd -eq 'uninstall')"
from the uninstaller script entry (the uninstaller.script that currently
contains that if-statement), because the script only runs during uninstallation;
simply execute the uninstall commands directly inside that script block and
delete the surrounding if statement and its matching endif to avoid
dead/always-true branching.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 59797521-85a1-4736-a110-eb140d04db34

📥 Commits

Reviewing files that changed from the base of the PR and between b9139d7 and 996dcdc.

📒 Files selected for processing (3)
  • bucket/astrogrep.json
  • scripts/astrogrep/install-context.reg
  • scripts/astrogrep/uninstall-context.reg

Comment thread bucket/astrogrep.json
Comment thread scripts/astrogrep/install-context.reg Outdated
Comment thread scripts/astrogrep/uninstall-context.reg Outdated
arvdk and others added 4 commits May 26, 2026 23:44
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@arvdk

arvdk commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

astrogrep

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

arvdk added a commit to arvdk/Extras that referenced this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

astrogrep: add Explorer context menu integration script

1 participant