Skip to content

wireshark: Fix reinstall and post_install failure - #19149

Open
armadavalor wants to merge 1 commit into
ScoopInstaller:masterfrom
armadavalor:wireshark-fix-reinstall
Open

armadavalor wants to merge 1 commit into
ScoopInstaller:masterfrom
armadavalor:wireshark-fix-reinstall

Conversation

@armadavalor

Copy link
Copy Markdown
Contributor

Closes #18517

Two failures from the issue:

  1. pre_install failed with Rename-Item: Cannot create a file when that file already exists when the version directory still held a renamed installer from an earlier attempt (failed install that could not be purged, or reinstall). The glob npcap-*.exe also matched the already-renamed npcap-installer.exe. Now it matches npcap-[0-9]*.exe and uses Move-Item -Force to the target path, so leftovers are overwritten.
  2. post_install aborted the install when USBPcap is not installed: enable-usbpcap.ps1 used Write-Error, and 2>$null does not stop it from terminating when the caller runs with $ErrorActionPreference = 'Stop'. The "not found" message is now Write-Warning, silenced with 3>$null in post_install, since enabling USBPcap is optional.

Verified

  • Simulated both hooks on a copy of the extracted app dir with leftover npcap-installer.exe / USBPcap-installer.exe and no USBPcap installed, under $ErrorActionPreference = 'Stop': installers replaced, post_install completes.
  • bin/formatjson.ps1 -App wireshark: no changes. Manifest parses as JSON.

Not verified

  • A full scoop install of 4.6.9 end to end, and the path where USBPcap is installed.

  • bin/test.ps1 (needs Pester 5; left to CI).

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

  • I have read the Contributing Guide

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5432a1d and 53dbaf0.

Files selected for processing: 2
  • bucket/wireshark.json
  • scripts/wireshark/enable-usbpcap.ps1

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

Walkthrough

The Wireshark manifest now moves the first matching Npcap and USBPcap installers to standardized paths. It redirects file descriptor 3 to null when invoking the USBPcap enable script. When USBPcapCMD.exe is missing, the script now emits a warning instead of an error.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 53dba

The changed installation paths have no established merge-blocking risk; normal CI validation should still run.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description explains both reported failures, identifies the implemented fixes, references issue #18517, and documents verified and unverified testing. The required checklist items are completed.
Title check Passed The title uses the required conventional format and clearly identifies the Wireshark reinstall and post_install fixes.
Linked Issues check Passed Issue #18517 requires the Wireshark install and update failures to be resolved. In bucket/wireshark.json, pre_install now selects versioned Npcap files with npcap-[0-9]*.exe and moves them with …
Out of Scope Changes check Passed All changed lines support issue #18517. The manifest changes repair installer handling and optional USBPcap post-install behavior. The script change changes only the severity of the existing missing-U…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Linked Issues check

Explanation

Issue #18517 requires the Wireshark install and update failures to be resolved. In bucket/wireshark.json, pre_install now selects versioned Npcap files with npcap-[0-9]*.exe and moves them with Move-Item -Force to npcap-installer.exe. This avoids matching the renamed file and replaces a stale destination. The USBPcap move also uses -Force. In scripts/wireshark/enable-usbpcap.ps1, the missing optional USBPcap condition now uses Write-Warning, and post_install suppresses warning stream 3. These changes address both reported failure paths. The issue has no separate automated-test acceptance criterion.

Full details: Out of Scope Changes check

Explanation

All changed lines support issue #18517. The manifest changes repair installer handling and optional USBPcap post-install behavior. The script change changes only the severity of the existing missing-USBPcap message. No unrelated files or behavior are changed.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

[Bug]: wireshark@4.6.8 cannot be installed 'USBPcapCMD.exe' not found.

1 participant