Skip to content

Conversation

@SorYoshino
Copy link
Contributor

@SorYoshino SorYoshino commented Jan 3, 2026

Summary

Refactors the asar7z manifest to improve installation reliability, 7-Zip discovery, and architecture handling, while aligning description and licensing fields with current Scoop conventions.

Related issues or pull requests

Changes

  • Refine description to clearly cover Electron .asar usage and encrypted archive limitation
  • Replace simple license string with structured license object including URL
  • Introduce per-architecture preprocessing to remove unused binaries and normalize DLL naming
  • Replace legacy pre_install/pre_uninstall logic with explicit installer/uninstaller scripts
  • Adopte Get-CommandPath -Command '7z.exe' for robust 7-Zip path detection instead of scoop which 7z
  • Ensure clean removal of installed plugin files during uninstall

Notes

  • Using the persistdir function is only applicable when 7-Zip is installed via Scoop and cannot accommodate scenarios where users enable use_external_7zip. Moreover, the installation location depends on the installation path of 7-Zip, meaning that the value of $global must be consistent at installation time.
  • In addition, when using scoop which 7z, if 7z cannot be found through the Path environment variable, it will unavoidably output: '7z' not found, not a scoop shim, or a broken shim.
  • Neither of these approaches is optimal. This pull request resolves the above issues by using Get-CommandPath -Command '7z.exe'.

https://github.com/ScoopInstaller/Main/blob/c368d7c1833e31404c42db2870c562ae9fefe018/bucket/modern7z.json#L17-L26

Testing

The test results are as follows:
┏[ ~]
└─> 7z i

7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03

Libs:
 0 : 25.01 : D:\Software\Scoop\Local\apps\7zip\current\7z.dll

┏[ ~]
└─> scoop install Unofficial/asar7z
Installing 'asar7z' (1.5) [64bit] from 'Unofficial' bucket
Loading Asar.zip from cache.
Checking hash of Asar.zip ... ok.
Extracting Asar.zip ... done.
Running pre_install script...done.
Running installer script...done.
Linking D:\Software\Scoop\Local\apps\asar7z\current => D:\Software\Scoop\Local\apps\asar7z\1.5
'asar7z' (1.5) was installed successfully!

┏[ ~]
└─> 7z i

7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03

Libs:
 0 : 25.01 : D:\Software\Scoop\Local\apps\7zip\current\7z.dll
 1 : 0.00 : D:\Software\Scoop\Local\apps\7zip\current\Formats\Asar.dll

┏[ ~]
└─> scoop uninstall asar7z
Uninstalling 'asar7z' (1.5).
Running uninstaller script...done.
Unlinking D:\Software\Scoop\Local\apps\asar7z\current
'asar7z' was uninstalled.

┏[ ~]
└─> 7z i

7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03

Libs:
 0 : 25.01 : D:\Software\Scoop\Local\apps\7zip\current\7z.dll
  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • Chores
    • Added architecture-specific install steps for 32‑bit and 64‑bit and introduced explicit installer and uninstaller routines
    • Improved version-detection pattern for more reliable updates
    • Expanded license metadata to include identifier and reference URL
  • Documentation
    • Expanded description to clarify archive (.asar) handling and an encryption limitation

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 3, 2026

Walkthrough

Updated manifest for asar7z: expanded description, license converted to an object, architecture-aware pre_install blocks for 64/32-bit, added explicit installer.script and uninstaller.script (PowerShell) that locate 7z.exe and manage Formats files, and relaxed checkver regex to allow whitespace.

Changes

Cohort / File(s) Summary
Manifest Structure & Installer Logic
bucket/asar7z.json
Expanded description; license changed from string to object with identifier and url; replaced flat pre_install/pre_uninstall with architecture object containing 64bit/32bit pre_install arrays; added installer.script to locate 7z.exe, ensure Formats dir, and copy package files (excluding .json and ReadMe.txt); added uninstaller.script to locate 7z.exe and remove archived formats; checkver regex relaxed to Plugin version:\s*([\d.]+)

Sequence Diagram(s)

sequenceDiagram
    participant Manifest
    participant InstallerScript as "Installer\n(PowerShell)"
    participant UninstallerScript as "Uninstaller\n(PowerShell)"
    participant SevenZip as "7z.exe"
    participant FS as "Filesystem (Formats dir)"

    rect rgb(235,245,255)
    Manifest->>InstallerScript: invoke installer.script
    InstallerScript->>SevenZip: Get-Command 7z.exe
    alt 7z.exe found
        InstallerScript->>FS: ensure Formats directory exists
        InstallerScript->>FS: copy package files (exclude .json, ReadMe.txt)
        FS-->>InstallerScript: confirm copied
    else not found
        SevenZip-->>InstallerScript: error / abort
    end
    end

    rect rgb(255,245,235)
    Manifest->>UninstallerScript: invoke uninstaller.script
    UninstallerScript->>SevenZip: Get-Command 7z.exe
    alt 7z.exe found
        UninstallerScript->>FS: remove archived formats for package
        FS-->>UninstallerScript: confirm removed
    else not found
        SevenZip-->>UninstallerScript: error / abort
    end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • z-Fng

Poem

🐰 I hopped through JSON, tidy and spry,
License now boxed, scripts set to fly,
7z found its cue, Formats groomed with care,
Install then unhook — a rabbit's neat fare! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description comprehensively covers all key aspects: summary, related issues, detailed changes, technical notes explaining the rationale, testing results, and confirmation of PR checklist compliance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title directly summarizes the main changes: updating the description and license field, and improving installer/uninstaller script logic, which are the primary objectives of this manifest refactor.

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

✨ Finishing touches
  • 📝 Generate docstrings

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
Contributor

github-actions bot commented Jan 3, 2026

All changes look good.

Wait for review from human collaborators.

asar7z

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

Check the full log for details.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1464ce and d2f9ada.

📒 Files selected for processing (1)
  • bucket/asar7z.json
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: haussmann
Repo: ScoopInstaller/Extras PR: 16863
File: bucket/browseros.json:15-17
Timestamp: 2025-12-21T13:49:44.001Z
Learning: In Scoop manifests, when a URL uses a fragment like `#/dl.7z`, Scoop automatically extracts the archive after download. For nested archives (like BrowserOS), the downloaded installer may contain another archive (e.g., `chrome.7z`) that requires explicit extraction via the installer script using `Expand-7zipArchive`. The installer script should reference the inner archive name, not the outer `dl.7z`.
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16378
File: bucket/compactgui.json:20-22
Timestamp: 2025-10-19T13:58:23.389Z
Learning: In the ScoopInstaller/Extras repository, the CompactGUI manifest removed hash verification from the autoupdate block because the hash verification mechanism (scraping SHA-256 from release page HTML) is no longer available in newer CompactGUI releases. GitHub asset digests exist in beta releases but not in v3.8.0, and Scoop doesn't have built-in support for extracting from GitHub API asset digests.
📚 Learning: 2025-10-19T13:58:23.389Z
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16378
File: bucket/compactgui.json:20-22
Timestamp: 2025-10-19T13:58:23.389Z
Learning: In the ScoopInstaller/Extras repository, the CompactGUI manifest removed hash verification from the autoupdate block because the hash verification mechanism (scraping SHA-256 from release page HTML) is no longer available in newer CompactGUI releases. GitHub asset digests exist in beta releases but not in v3.8.0, and Scoop doesn't have built-in support for extracting from GitHub API asset digests.

Applied to files:

  • bucket/asar7z.json
📚 Learning: 2025-12-21T13:49:44.001Z
Learnt from: haussmann
Repo: ScoopInstaller/Extras PR: 16863
File: bucket/browseros.json:15-17
Timestamp: 2025-12-21T13:49:44.001Z
Learning: In Scoop manifests, when a URL uses a fragment like `#/dl.7z`, Scoop automatically extracts the archive after download. For nested archives (like BrowserOS), the downloaded installer may contain another archive (e.g., `chrome.7z`) that requires explicit extraction via the installer script using `Expand-7zipArchive`. The installer script should reference the inner archive name, not the outer `dl.7z`.

Applied to files:

  • bucket/asar7z.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: WindowsPowerShell
🔇 Additional comments (5)
bucket/asar7z.json (5)

3-3: LGTM!

The expanded description clearly conveys the plugin's purpose and the encrypted archive limitation.


5-8: LGTM!

The structured license object with an explicit URL aligns with Scoop conventions and improves license traceability.


11-24: LGTM!

The architecture-specific pre_install logic correctly removes unused binaries and normalizes DLL naming for the target platform.


25-33: LGTM!

The installer script uses robust 7-Zip discovery via Get-CommandPath, includes proper null-check error handling, and correctly copies only the plugin files to the Formats directory.


43-43: LGTM!

The updated regex with \s* is more resilient to whitespace variations in the version string on the source page.

@SorYoshino
Copy link
Contributor Author

/verify

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

All changes look good.

Wait for review from human collaborators.

asar7z

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

Check the full log for details.

Copy link

@coderabbitai coderabbitai bot left a comment

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)
bucket/asar7z.json (1)

3-3: Consider shortening the description to align with Scoop conventions.

The description is quite verbose (200+ characters). Scoop manifests typically use concise descriptions that focus on the core functionality. The detail about encrypted archives, while informative, could be moved to notes or the homepage.

🔎 Suggested shorter description
-    "description": "A plugin for 7-Zip that enables opening, modifying, and creating .asar archives used by Electron-based applications, while noting that encrypted .asar archives cannot be accessed without the specific encryption method defined by the developer.",
+    "description": "7-Zip plugin for opening and creating .asar archives used by Electron applications",
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2f9ada and ee8cdc0.

📒 Files selected for processing (1)
  • bucket/asar7z.json
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: haussmann
Repo: ScoopInstaller/Extras PR: 16863
File: bucket/browseros.json:15-17
Timestamp: 2025-12-21T13:49:44.001Z
Learning: In Scoop manifests, when a URL uses a fragment like `#/dl.7z`, Scoop automatically extracts the archive after download. For nested archives (like BrowserOS), the downloaded installer may contain another archive (e.g., `chrome.7z`) that requires explicit extraction via the installer script using `Expand-7zipArchive`. The installer script should reference the inner archive name, not the outer `dl.7z`.
📚 Learning: 2025-10-19T13:58:23.389Z
Learnt from: o-l-a-v
Repo: ScoopInstaller/Extras PR: 16378
File: bucket/compactgui.json:20-22
Timestamp: 2025-10-19T13:58:23.389Z
Learning: In the ScoopInstaller/Extras repository, the CompactGUI manifest removed hash verification from the autoupdate block because the hash verification mechanism (scraping SHA-256 from release page HTML) is no longer available in newer CompactGUI releases. GitHub asset digests exist in beta releases but not in v3.8.0, and Scoop doesn't have built-in support for extracting from GitHub API asset digests.

Applied to files:

  • bucket/asar7z.json
📚 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:

  • bucket/asar7z.json
📚 Learning: 2025-12-21T13:49:44.001Z
Learnt from: haussmann
Repo: ScoopInstaller/Extras PR: 16863
File: bucket/browseros.json:15-17
Timestamp: 2025-12-21T13:49:44.001Z
Learning: In Scoop manifests, when a URL uses a fragment like `#/dl.7z`, Scoop automatically extracts the archive after download. For nested archives (like BrowserOS), the downloaded installer may contain another archive (e.g., `chrome.7z`) that requires explicit extraction via the installer script using `Expand-7zipArchive`. The installer script should reference the inner archive name, not the outer `dl.7z`.

Applied to files:

  • bucket/asar7z.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: WindowsPowerShell
🔇 Additional comments (4)
bucket/asar7z.json (4)

5-8: LGTM! License structure follows Scoop conventions.

Converting the license to a structured object with identifier and URL is the correct format and improves metadata quality.


25-33: LGTM! Installer script follows best practices.

The installer script properly:

  • Locates 7z.exe using Get-CommandPath
  • Validates 7z.exe existence with an abort guard
  • Ensures the Formats directory exists
  • Copies plugin files while excluding manifest and documentation

34-44: LGTM! Uninstaller now includes proper null check.

The uninstaller script correctly guards against a null $7z_path on line 37, addressing the concern from the previous review. The script will now gracefully skip plugin removal if 7z.exe is not found, preventing potential errors when 7-Zip is uninstalled before this plugin.


45-45: LGTM! Checkver pattern improvement.

Adding \s* to allow optional whitespace makes the version extraction more robust and handles potential formatting variations in the upstream source.

@SorYoshino SorYoshino marked this pull request as draft January 7, 2026 11:31
@SorYoshino SorYoshino marked this pull request as ready for review January 7, 2026 11:38
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

All changes look good.

Wait for review from human collaborators.

asar7z

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

Check the full log for details.

@z-Fng z-Fng changed the title asar7z: Enhance manifest description, licensing metadata, and installation logic asar7z: Update description & license, improve install/uninstall script logic Jan 7, 2026
Copy link
Member

@z-Fng z-Fng left a comment

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 d8188eb into ScoopInstaller:master Jan 7, 2026
3 checks passed
@SorYoshino SorYoshino deleted the asar7z branch January 7, 2026 14:43
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.

2 participants