Skip to content

qview: Add file associations#16811

Merged
z-Fng merged 6 commits into
ScoopInstaller:masterfrom
edwardducy:qview-file-associations
Dec 20, 2025
Merged

qview: Add file associations#16811
z-Fng merged 6 commits into
ScoopInstaller:masterfrom
edwardducy:qview-file-associations

Conversation

@edwardducy

@edwardducy edwardducy commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Closes #16288
or
Relates to #XXXX

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

Adds file associations for qView.
A post-install script registers the required file associations, and the uninstaller removes them cleanly.

Summary by CodeRabbit

  • New Features

    • qView can be registered as the default app for many common and advanced image formats
    • Expanded "Open With" support for a wide range of image file types
  • Chores

    • Post-install setup configures system file associations
    • Uninstaller removes qView association entries to restore prior state
    • Manifest updated with installation notes for association setup

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 18, 2025

Copy link
Copy Markdown

Walkthrough

Adds per-user Windows registry install and uninstall scripts and manifest fields to register and later remove qView file associations (RegisteredApplications, ProgID qView.Image, DefaultIcon, shell open command, OpenWithProgids, FileAssociations) for a broad set of image extensions via post-install/uninstaller hooks.

Changes

Cohort / File(s) Summary
qView manifest
bucket/qview.json
Added notes field, a post_install block to run the association installer, and an uninstaller block to run the uninstall-associations script.
Association install script
scripts/qview/install-associations.reg
New HKCU registry script that creates qView capabilities (ApplicationName, ApplicationDescription, InstallLocation), registers qView.Image ProgID, sets DefaultIcon and shell open command, updates RegisteredApplications, and adds many image extensions to OpenWithProgids and FileAssociations.
Association uninstall script
scripts/qview/uninstall-associations.reg
New HKCU registry script that removes qView entries from HKCU (RegisteredApplications, qView.Image class, per-extension OpenWithProgids/FileExts) to undo associations for the listed image formats.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify HKCU vs HKLM intent and that registry paths/value names follow Windows expectations.
  • Check the extension list for correctness and duplicates.
  • Confirm symmetry between install and uninstall scripts and safe handling when keys/values are absent.
  • Validate executable path/command quoting and DefaultIcon entries.

Possibly related PRs

Suggested reviewers

  • z-Fng

Poem

🐰 I hopped through keys with nimble paws,
I taught qView rules and tiny laws,
Extensions queued in tidy rows,
Icons set where sunlight glows,
Hop—now images open with applause! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description is mostly complete with linked issue reference and implementation summary, though it could be more detailed about registry changes.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #16288: adds file associations via post-install script with registry changes (HKCU) and clean uninstallation [#16288].
Out of Scope Changes check ✅ Passed All changes are within scope: qview.json manifest updated, post-install/uninstall scripts added, and registry files created for file association management.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'qview: Add file associations' directly and clearly describes the main change: adding file associations for qView.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

qview

  • 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: 0

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

31-36: Consider using Set-Item for default registry values.

The current pattern with New-ItemProperty -Name '(default)' works correctly but is less idiomatic. Setting the default (unnamed) value of a registry key is more commonly done with Set-Item.

Example refactor for line 32:

-New-ItemProperty -Path "HKCU:\Software\Classes\$progId" -Name '(default)' -Value 'qView' -PropertyType String -Force | Out-Null
+Set-Item -Path "HKCU:\Software\Classes\$progId" -Value 'qView' -Force | Out-Null

Apply similar changes to lines 34 and 36. This is a style preference; the current code functions correctly.


44-54: LGTM! Proper cleanup with appropriate error handling.

The uninstaller correctly removes the ProgID registry structure and cleans up all OpenWithProgids entries. The use of -ErrorAction SilentlyContinue is appropriate for cleanup scenarios where some entries may already be removed.

Minor: Consider extracting the extension list to avoid duplication.

The extension list appears in both post_install (line 37) and uninstaller (line 48). While this duplication aids clarity, extracting it to a variable at the manifest level (if Scoop supports it) or noting it in comments could reduce maintenance burden.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e7295f and 2557410.

📒 Files selected for processing (1)
  • bucket/qview.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T13:42:43.224Z
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16349
File: bucket/debugviewpp.json:14-21
Timestamp: 2025-10-16T13:42:43.224Z
Learning: In the DebugViewPP project (CobaltFusion/DebugViewPP), the executable name changed from "DebugView++.exe" (in v1.8.0.103 and earlier) to "Debugviewpp.exe" (in v1.9.0.28 and later). The manifest bucket/debugviewpp.json correctly uses "Debugviewpp.exe" for current versions.

Applied to files:

  • bucket/qview.json
🔇 Additional comments (4)
bucket/qview.json (4)

24-24: LGTM!

The note clearly informs users about the context menu integration.


26-27: LGTM! Good defensive validation.

The script validates the executable exists before proceeding with registry operations, preventing incomplete installations.


28-30: LGTM! Proper setup for Windows shell integration.

The ProgID naming, icon extraction, and command formatting follow Windows conventions correctly. The command string properly quotes the executable path and uses the %1 placeholder for file arguments.


37-42: No changes needed—qView supports all listed image formats.

qView 5.0 and later support .jxl, .psd, and many other formats through kimageformats integration. HEIF and AVIF support come from kimageformats, and WebP, HEIC, and AVIF are supported. All 15 extensions in the list are valid for recent qView versions, so the "Open With" registry entries will function correctly.

@edwardducy

edwardducy commented Dec 18, 2025

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

qview

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

Check the full log for details.

@coderabbitai

coderabbitai Bot commented Dec 18, 2025

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@z-Fng z-Fng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. Please refer to qbittorrent.json. Split the script for adding file associations into a separate file and properly handle global installations.
  2. Please follow the general order of fields in the JSON file as described in the Contributing Guide.
    e.g.
    "notes": [
    "For file associations, run:",
    "reg import \"$dir\\install-associations.reg\""
    ],

    "post_install": [
    "'install-associations', 'uninstall-associations' | ForEach-Object {",
    " if (Test-Path \"$bucketsdir\\$bucket\\scripts\\qbittorrent\\$_.reg\") {",
    " $qbitPath = \"$dir\".Replace('\\', '\\\\')",
    " $content = (Get-Content \"$bucketsdir\\$bucket\\scripts\\qbittorrent\\$_.reg\").Replace('$qbit', $qbitPath)",
    " if ($global) { $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE') }",
    " Set-Content \"$dir\\$_.reg\" $content -Encoding Ascii -Force",
    " }",
    "}"
    ],

    "uninstaller": {
    "script": "if ($cmd -eq 'uninstall') { reg import \"$dir\\uninstall-associations.reg\" }"
    },

@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: 4

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4076478 and c0d4015.

📒 Files selected for processing (3)
  • bucket/qview.json (2 hunks)
  • scripts/qview/install-associations.reg (1 hunks)
  • scripts/qview/uninstall-associations.reg (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • bucket/qview.json

Comment thread scripts/qview/install-associations.reg Outdated
Comment thread scripts/qview/install-associations.reg Outdated
Comment thread scripts/qview/uninstall-associations.reg Outdated
Comment thread scripts/qview/uninstall-associations.reg Outdated
@edwardducy edwardducy changed the title qview@7.1: Add context menu qview@7.1: Add file associations Dec 19, 2025

@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: 1

🧹 Nitpick comments (1)
scripts/qview/install-associations.reg (1)

10-44: Consider whether application-specific project formats should be included.

Several formats in the list are layered project files for specific applications:

  • .kra (Krita)
  • .ora (OpenRaster)
  • .psd (Photoshop)
  • .xcf (GIMP)

While qView may support basic viewing, users typically want to open these in their native editors to preserve layer information and editing capabilities. Since you're using OpenWithProgids (adding an option rather than forcing default), this is acceptable if qView can at least render a flattened view, but consider whether including them provides real value.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83b23ea and 8c10de8.

📒 Files selected for processing (1)
  • scripts/qview/install-associations.reg (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-13T09:37:06.093Z
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16328
File: bucket/winutil.json:0-0
Timestamp: 2025-10-13T09:37:06.093Z
Learning: When reviewing code in Scoop manifests, always verify the actual file content if the diff appears incomplete or unusual, as diff context can be truncated or displayed incorrectly. The pattern `[string[]](...).ForEach{...}` is commonly used in post_uninstall scripts across the Extras repository.

Applied to files:

  • scripts/qview/install-associations.reg
🔇 Additional comments (1)
scripts/qview/install-associations.reg (1)

1-159: LGTM! Previous concerns have been addressed.

The registry structure is now correct:

  • Paths are properly quoted with escaped quotes (lines 4, 53, 56)
  • Uses OpenWithProgids approach to add qView to "Open with" menus without forcing it as default
  • Follows Windows conventions for RegisteredApplications and Capabilities
  • All modifications under HKCU are appropriate for per-user Scoop installations

Comment thread scripts/qview/install-associations.reg
@edwardducy edwardducy changed the title qview@7.1: Add file associations qview: Add file associations Dec 19, 2025
@edwardducy

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

qview

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

Check the full log for details.

@z-Fng z-Fng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution!

@z-Fng z-Fng merged commit fd46dd8 into ScoopInstaller:master Dec 20, 2025
3 checks passed
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.

[Enhance] qview: Add file association

2 participants