Skip to content

vscode: Refactor manifest and align registry scripts with official installer#16868

Open
SorYoshino wants to merge 1 commit intoScoopInstaller:masterfrom
SorYoshino:vscode
Open

vscode: Refactor manifest and align registry scripts with official installer#16868
SorYoshino wants to merge 1 commit intoScoopInstaller:masterfrom
SorYoshino:vscode

Conversation

@SorYoshino
Copy link
Copy Markdown
Contributor

@SorYoshino SorYoshino commented Dec 22, 2025

Summary

Refactors the vscode manifest to improve portability, data migration, and maintainability.

Separately, the registry (.reg) scripts have been updated to better align with entries and behavior observed in the official Visual Studio Code installer.

Related issues or pull requests

Changes

  • Refactore the manifest to improve:
    • Data and extension migration
    • Maintainability and consistency with Scoop conventions
  • Update registry (.reg) scripts based on entries generated by the official VS Code installer, ensuring:
    • Compatibility with Windows file association and shell integration mechanisms
  • Refactore notes to better reflect available registry integration options
  • Improve post_install logic to dynamically apply registry templates and support both user-level and global installs
  • Improve uninstaller behavior to properly unregister registry entries
  • Update checkver to rely on productVersion for more reliable version detection

Notes

  • Add a pre_install script to ensure extension paths are adjusted correctly. The rationale behind this logic is as follows:
    • Based on testing, only the most recently installed extension contains the _sep, fsPath, and external fields within the location object in extensions.json.
    • This behavior is easy to verify: after installing extension A and then extension B, extension A’s location object no longer contains the above fields, and a uuid field is added to its identifier object, with the value equal to metadata.id.
    • When extension B is uninstalled, the application only removes B’s entry from extensions.json; the previously modified metadata for extension A remains unchanged.
    • The pre_install script intentionally emulates this behavior. It assumes that the application can derive the other two path representations from location.path alone (as evidenced by the current structure of extensions.json). Updating all three path variants would introduce unnecessary complexity, so the script limits itself to normalizing location.path only, which is sufficient and consistent with observed behavior.
  • The file association registrations in install-associations.reg are derived from the official installer. In addition to the existing associations, this update adds support for .json5, .jsonc, .zshrc, and other related file types.
  • The contents of install-context.reg are also based on the official installer. The only difference is that the official installer registers the relevant values as REG_EXPAND_SZ, whereas this PR uses REG_SZ. Both registry value types function correctly in this context.
  • The current naming of install-github-integration.reg is potentially misleading. It has therefore been renamed to register-installed-program.reg, and the corresponding entries in the notes field have been updated accordingly.

Testing

The test results are as follows:
┏[ ~]
└─> jq '
   map({
     identifier,
     location: (
       .location
       | with_entries(
           if (.value | type) == "string"
           then .value |= gsub("<username>"; "USERNAME")
           else .
           end
         )
       )
   })
' "$HOME\.vscode\extensions\extensions.json"
[
  {
    "identifier": {
      "id": "arthurlobo.easy-codesnap",
      "uuid": "74ee6421-4ae5-4bdc-b642-afa6fd1a2522"
    },
    "location": {
      "$mid": 1,
      "path": "/c:/Users/USERNAME/.vscode/extensions/arthurlobo.easy-codesnap-1.36.1",
      "scheme": "file"
    }
  },
  {
    "identifier": {
      "id": "usernamehw.errorlens"
    },
    "location": {
      "$mid": 1,
      "fsPath": "c:\\Users\\USERNAME\\.vscode\\extensions\\usernamehw.errorlens-3.26.0",
      "_sep": 1,
      "external": "file:///c%3A/Users/USERNAME/.vscode/extensions/usernamehw.errorlens-3.26.0",
      "path": "/c:/Users/USERNAME/.vscode/extensions/usernamehw.errorlens-3.26.0",
      "scheme": "file"
    }
  }
]

┏[ ~]
└─> scoop install Unofficial/vscode
Installing 'vscode' (1.107.1) [64bit] from 'Unofficial' bucket
Loading dl.7z from cache.
Checking hash of dl.7z ... ok.
Extracting dl.7z ... done.
Running pre_install script...done.
Linking D:\Software\Scoop\Local\apps\vscode\current => D:\Software\Scoop\Local\apps\vscode\1.107.1
Creating shortcut for Visual Studio Code (Code.exe)
Adding D:\Software\Scoop\Local\apps\vscode\current\bin to your path.
Persisting data
Running post_install script...INFO  [Portable Mode] Migrating user data to 'D:\Software\Scoop\Local\apps\vscode\current\data'...
INFO  [Portable Mode] Migrating argv.json to 'D:\Software\Scoop\Local\apps\vscode\current\data'...
INFO  [Portable Mode] Migrating extensions to 'D:\Software\Scoop\Local\apps\vscode\current\data'...
INFO  Adjusting path in extensions file...
done.
'vscode' (1.107.1) was installed successfully!
Notes
-----
To register file associations, please execute the following command:
- `reg import "D:\Software\Scoop\Local\apps\vscode\current\register-file-associations.reg"`
To register the context menu entry, please execute the following command:
- `reg import "D:\Software\Scoop\Local\apps\vscode\current\register-context-menu.reg"`
To register the installed program entry (required for integration with other applications), please execute the following command:
- `reg import "D:\Software\Scoop\Local\apps\vscode\current\register-installed-program.reg"`

┏[ ~]
└─> jq 'map({ identifier, location })' "D:\Software\Scoop\Local\apps\vscode\current\data\extensions\extensions.json"
[
  {
    "identifier": {
      "id": "arthurlobo.easy-codesnap",
      "uuid": "74ee6421-4ae5-4bdc-b642-afa6fd1a2522"
    },
    "location": {
      "$mid": 1,
      "path": "/D:/Software/Scoop/Local/apps/vscode/1.107.1/data/extensions/arthurlobo.easy-codesnap-1.36.1",
      "scheme": "file"
    }
  },
  {
    "identifier": {
      "id": "usernamehw.errorlens",
      "uuid": "9d8c32ab-354c-4daf-a9bf-20b633734435"
    },
    "location": {
      "$mid": 1,
      "path": "/D:/Software/Scoop/Local/apps/vscode/1.107.1/data/extensions/usernamehw.errorlens-3.26.0",
      "scheme": "file"
    }
  }
]
  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary by CodeRabbit

  • New Features

    • Portable mode support: manifest fields for pre/post-install hooks, persistence, shortcuts, and PATH additions.
    • Unified context-menu and file-association entries for VSCode with standardized commands and icons.
    • Metadata parsing updated to use productVersion for version checks.
  • Chores

    • Install/uninstall flows revised to migrate user data and extensions to portable locations and standardize registration/uninstaller behavior.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 22, 2025

Walkthrough

Adds portable-mode orchestration to the VS Code manifest and rewrites registry scripts to unify context/association keys under a VSCode namespace; expands manifest public surface (env_add_path, pre_install, post_install, shortcuts, persist) and changes checkver.jsonpath to use $.productVersion.

Changes

Cohort / File(s) Summary
Manifest Configuration
bucket/vscode.json
Added public fields: env_add_path, pre_install, post_install, shortcuts, persist; normalized description/homepage/license fields; added pre/post-install sequences to migrate extensions/user data and orchestrate registry/script rewrites; updated uninstall handling and changed checkver.jsonpath to $.productVersion; aligned autoupdate metadata for x64/arm64.
Context Menu Installation
scripts/vscode/install-context.reg
Replaced multiple "Open with &Code" entries with unified VSCode shell keys for File, DirectoryBackground, Directory, and Drive contexts; standardized Icon and command to use {{vscode_dir}}\\Code.exe with appropriate args.
Program Registration
scripts/vscode/register-installed-program.reg
Converted placeholders to {{vscode_dir}}; set DisplayIcon to "{{vscode_dir}}\\Code.exe",0; added HelpLink, URLInfoAbout, URLUpdateInfo; set InstallLocation to \"{{vscode_dir}}\".
File Associations Cleanup
scripts/vscode/uninstall-associations.reg
Replaced CodeOSS.* ProgIDs with VSCode.* equivalents across many extensions and consolidated per-extension uninstall cleanup entries.
Context Menu Cleanup
scripts/vscode/uninstall-context.reg
Replaced removal targets for legacy "Open with &Code" keys with removal entries for the new VSCode context keys under HKCU\Software\Classes for file, directory background, directory, and drive scopes.
Program Unregistration
scripts/vscode/unregister-installed-program.reg
Single-line representation change: uninstall key line switched to addition-style marker; content otherwise unchanged (no behavior change).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Installer
    participant Manifest as "bucket/vscode.json"
    participant PreInstall as "pre_install script"
    participant PostInstall as "post_install script"
    participant Registry
    participant FS as "Filesystem (extensions/user data)"

    Installer->>Manifest: read manifest (env_add_path, pre_install, post_install, persist, shortcuts)
    Manifest->>PreInstall: invoke pre_install sequence
    PreInstall->>FS: detect & migrate extensions/user data -> portable data dir
    PreInstall->>PostInstall: emit path mappings / transformed scripts
    Installer->>PostInstall: run post_install
    PostInstall->>Registry: generate & apply rewritten registry scripts (context, associations, uninstall entries)
    PostInstall->>FS: patch extensions.json and normalize paths to portable dir
    Registry-->>Installer: registry keys created/updated
    FS-->>Installer: extensions/user data relocated
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • z-Fng

Poem

🐰 I hopped through manifests, tidy and spry,
I nudged extensions home where portable dreams lie,
Reg keys now chant "VSCode" in orderly rows,
Scripts migrate, register, and tidy what grows,
A little rabbit cheers — install, migrate, go! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: refactoring the vscode manifest and aligning registry scripts with the official installer.
Description check ✅ Passed The PR description comprehensively covers the changes, rationale, testing, and includes issue closure and conventional title checkbox completion.
Linked Issues check ✅ Passed The PR successfully addresses issue #15301 by clarifying registry file purposes, renaming install-github-integration.reg to register-installed-program.reg, and aligning with official installer behavior.
Out of Scope Changes check ✅ Passed All changes directly relate to refactoring the vscode manifest and registry scripts for portability and alignment with official installer, with no unrelated modifications.
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.

@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

vscode

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

Copy link
Copy Markdown

@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: 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 1312243 and 1019a76.

📒 Files selected for processing (7)
  • bucket/vscode.json
  • scripts/vscode/install-associations.reg
  • scripts/vscode/install-context.reg
  • scripts/vscode/register-installed-program.reg
  • scripts/vscode/uninstall-associations.reg
  • scripts/vscode/uninstall-context.reg
  • scripts/vscode/unregister-installed-program.reg
🧰 Additional context used
🧠 Learnings (4)
📚 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/vscode/uninstall-associations.reg
📚 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/vscode.json
📚 Learning: 2025-10-14T11:24:17.524Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.

Applied to files:

  • bucket/vscode.json
📚 Learning: 2025-10-14T11:15:55.229Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.

Applied to files:

  • bucket/vscode.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 (8)
scripts/vscode/unregister-installed-program.reg (1)

1-3: LGTM!

The registry deletion file correctly uses the [-KEY] syntax to remove the installed program entry, and the GUID matches the registration file.

scripts/vscode/register-installed-program.reg (1)

1-10: LGTM!

The registry template correctly creates an installed-program entry that enables integration with other applications. The {{vscode_dir}} placeholder will be replaced during post_install. Omitting UninstallString is appropriate since Scoop manages uninstallation.

scripts/vscode/uninstall-context.reg (1)

3-9: LGTM!

The uninstall registry correctly removes all four context menu entries (*, Directory\Background, Directory, Drive) that are created by install-context.reg.

scripts/vscode/uninstall-associations.reg (1)

973-979: Good coverage of additional file types.

The file now includes uninstall entries for the additional file types mentioned in the PR objectives (.json5, .jsonc, .zshrc, etc.), and properly cleans up the VSCodeSourceFile class at the end.

scripts/vscode/install-context.reg (1)

3-32: LGTM!

The context menu registrations are well-structured:

  • Correct use of %1 for files and %V for directories/drives
  • Consistent {{vscode_dir}} placeholder for Code.exe paths
  • Keyboard accelerator (&i) properly placed in "Open w&ith Code"
bucket/vscode.json (3)

70-77: LGTM - Standard Scoop manifest fields.

The env_add_path, shortcuts, and persist fields are correctly configured for portable mode operation.


87-89: LGTM - Version detection improvement.

Changing from $.name to $.productVersion for checkver is a reliable improvement, as productVersion directly provides the semantic version string.


27-42: No changes needed for the return statement on line 30.

The return statement in the pre_install script behaves as intended. In Scoop's script execution model, manifest scripts are invoked as separate script blocks where return exits the script execution without affecting parent scope—this is the correct and standard behavior for PowerShell in this context.

Comment thread bucket/vscode.json Outdated
Comment thread bucket/vscode.json Outdated
Comment thread bucket/vscode.json Outdated
Comment thread scripts/vscode/uninstall-associations.reg Outdated
@SorYoshino
Copy link
Copy Markdown
Contributor Author

/verify

@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

vscode

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

@SorYoshino SorYoshino marked this pull request as ready for review December 22, 2025 17:47
Copy link
Copy Markdown

@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

♻️ Duplicate comments (2)
bucket/vscode.json (2)

44-44: Backslash escaping is still incorrect for .reg file format.

The pattern -replace '\\\\', '\\\\' matches two literal backslashes and replaces with two - effectively a no-op for standard Windows paths like C:\Users\.... The intent is to escape each single backslash for .reg file format (e.g., C:\Users\...C:\\Users\\...).

🔎 Recommended fix using .Replace() method
-        "$vscode_path = $dir -replace '\\\\', '\\\\'",
+        "$vscode_path = $dir.Replace('\\', '\\\\')",

Using the string .Replace() method avoids regex escaping complexity and correctly replaces each single backslash with a double backslash for the .reg file format.


60-61: Unconditional cleanup risks data loss if migration fails.

Lines 60-61 unconditionally delete the original data locations ($env:USERPROFILE\.vscode\argv.json, $env:USERPROFILE\.vscode\extensions, $env:AppData\Code) immediately after the copy operations on lines 52-58. If a copy fails silently (e.g., due to permissions, disk space, or I/O errors), user extensions and settings will be permanently lost.

🔎 Recommended approaches

Option 1: Verify before cleanup

+        "# Verify migration succeeded before cleanup",
+        "$migration_ok = (Test-Path \"$dir\\data\\user-data\\User\\settings.json\") -or (Test-Path \"$dir\\data\\extensions\\extensions.json\")",
+        "if (-not $migration_ok) {",
+        "    warn 'Migration verification failed - original data preserved in AppData and .vscode'",
+        "    return",
+        "}",
         "$remove_list = 'argv.json', 'extensions' | ForEach-Object { \"$env:USERPROFILE\\.vscode\\$_\" }",
         "$remove_list + @(\"$env:AppData\\Code\") | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue"

Option 2: Skip automatic cleanup (safer)

-        "$remove_list = 'argv.json', 'extensions' | ForEach-Object { \"$env:USERPROFILE\\.vscode\\$_\" }",
-        "$remove_list + @(\"$env:AppData\\Code\") | Remove-Item -Force -Recurse -ErrorAction SilentlyContinue"
+        "info 'Migration complete. Original data preserved in:'",
+        "info '  - $env:USERPROFILE\\.vscode (argv.json, extensions)'",  
+        "info '  - $env:AppData\\Code (user-data)'",
+        "info 'You may remove these manually after verifying the portable installation.'"
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1019a76 and c72d4c0.

📒 Files selected for processing (7)
  • bucket/vscode.json
  • scripts/vscode/install-associations.reg
  • scripts/vscode/install-context.reg
  • scripts/vscode/register-installed-program.reg
  • scripts/vscode/uninstall-associations.reg
  • scripts/vscode/uninstall-context.reg
  • scripts/vscode/unregister-installed-program.reg
✅ Files skipped from review due to trivial changes (1)
  • scripts/vscode/unregister-installed-program.reg
🧰 Additional context used
🧠 Learnings (3)
📚 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/vscode/uninstall-context.reg
  • bucket/vscode.json
  • scripts/vscode/uninstall-associations.reg
📚 Learning: 2025-10-14T11:24:17.524Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.

Applied to files:

  • bucket/vscode.json
📚 Learning: 2025-10-14T11:15:55.229Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.

Applied to files:

  • bucket/vscode.json
🔇 Additional comments (8)
scripts/vscode/install-context.reg (1)

1-32: LGTM! Registry syntax and structure are correct.

The consolidation under the VSCode namespace with {{vscode_dir}} templates is well-structured. The context menu entries for files, directories, backgrounds, and drives follow Windows registry conventions correctly.

scripts/vscode/uninstall-context.reg (1)

1-9: LGTM! Uninstall entries correctly match installation.

The deletion entries properly remove all four VSCode context menu keys using correct registry syntax. This ensures complete cleanup of context menu integration.

scripts/vscode/uninstall-associations.reg (1)

1-969: LGTM! Comprehensive file association cleanup.

The uninstall registry entries correctly remove VSCode file associations using proper .reg syntax. The pattern is consistent throughout: remove OpenWithProgIDs entries, then delete associated VSCode.* class keys. The final removal of VSCodeSourceFile completes the cleanup.

bucket/vscode.json (4)

3-16: LGTM! Improved description and clearer registry integration notes.

The enhanced description better captures VS Code's capabilities, and the updated notes clearly explain the purpose of each registry file. The rename from install-github-integration.reg to register-installed-program.reg accurately reflects its actual function.


78-86: LGTM! Uninstaller now properly removes all registry entries.

The uninstaller correctly imports all three registry cleanup files:

  1. uninstall-context.reg - removes context menu entries
  2. uninstall-associations.reg - removes file associations
  3. unregister-installed-program.reg - removes installed program entry

This addresses the previous issue where uninstall-context.reg was duplicated and file associations were not removed.


70-77: The manifest fields at lines 70-77 are correctly configured. VS Code includes a bin directory, and Scoop's env_add_path functionality adds the specified directory to the system path, where the directory is relative to the install location. The shortcut and persist settings are also appropriate for portable mode. No issues found.


87-90: Verify that the VS Code update API actually returns a productVersion field.

The checkver jsonpath changed from $.name to $.productVersion. Since I cannot directly test the endpoint in this environment, you should confirm that the update API returns the productVersion field and that it contains the version string in the expected format.

scripts/vscode/register-installed-program.reg (1)

3-3: GUID is correct.

The GUID {771FD6B0-FA20-440A-A002-3B3BAC16DC50}_is1 matches the official VS Code 64-bit user installation and is properly registered under HKEY_CURRENT_USER for user-scope detection by other installers and applications.

@SorYoshino
Copy link
Copy Markdown
Contributor Author

/verify

@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

vscode

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

@SorYoshino
Copy link
Copy Markdown
Contributor Author

/verify

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 9, 2026

All changes look good.

Wait for review from human collaborators.

vscode

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

Copy link
Copy Markdown

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

🤖 Fix all issues with AI agents
In @bucket/vscode.json:
- Around line 53-64: The migration currently copies with Copy-Item and then
unconditionally deletes originals via $remove_list | Remove-Item, risking data
loss; change the flow so each Copy-Item uses -ErrorAction Stop, verify success
(e.g., compare existence and item counts or sizes of "$dir\\data\\$_" vs source
after copy), optionally create a timestamped backup of the source (e.g., copy to
a ".bak" folder) before deletion, prompt the user to confirm deletion (or
support a --force flag), and only call Remove-Item for that specific source if
verification passes; update the blocks that handle "$env:AppData\\Code" and the
"'argv.json','extensions'" loop accordingly.
- Around line 9-16: The manifest's notes list references six registry files
(install-associations.reg, install-context.reg, register-installed-program.reg
and their uninstall counterparts) but those files are missing, causing
post_install and the uninstaller to fail; add the six .reg files into the
expected location (bucket/scripts/vscode/) with the registry entries referenced
by the post_install script and the uninstaller, ensure filenames exactly match
the names in the notes array and the scripts (install-associations.reg,
install-context.reg, register-installed-program.reg, uninstall-associations.reg,
uninstall-context.reg, unregister-installed-program.reg), and verify the
post_install script and uninstaller can read/import them without silent no-ops.
- Around line 27-42: The current regex used to rewrite extension paths in the
pre_install block (applied to $_.location.path) only replaces the middle segment
and preserves the leading drive letter, producing malformed paths like duplicate
drive letters; update the replacement to target the entire prefix before the
.vscode/extensions portion so the whole original root is replaced with $data_dir
(e.g., replace the existing '(?<=/).+(?=/extensions)' usage on $_.location.path
with a pattern or explicit full-path replacement that matches the full leading
path and substitutes it with $data_dir).
🧹 Nitpick comments (1)
bucket/vscode.json (1)

3-3: Consider shortening the description.

The description is quite lengthy. Scoop manifest descriptions are typically more concise. Consider simplifying to the essential information.

✍️ Suggested concise description
-    "description": "Visual Studio Code is a lightweight yet powerful, cross-platform source code editor providing rich support for development, debugging, and extension-based customization for modern web and cloud workloads.",
+    "description": "Lightweight but powerful source code editor with rich extension ecosystem and debugging support.",
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f42da0a and 1517380.

📒 Files selected for processing (1)
  • bucket/vscode.json
🧰 Additional context used
🧠 Learnings (3)
📚 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/vscode.json
📚 Learning: 2025-10-14T11:24:17.524Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:24:17.524Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Capture and Playlist folders are created at runtime (after running the application), not included in the installer, so they should only be in the persist list and not in post_install scripts.

Applied to files:

  • bucket/vscode.json
📚 Learning: 2025-10-14T11:15:55.229Z
Learnt from: SorYoshino
Repo: ScoopInstaller/Extras PR: 16333
File: bucket/potplayer.json:55-64
Timestamp: 2025-10-14T11:15:55.229Z
Learning: In PotPlayer manifests (bucket/potplayer.json), the Model and Engine folders are created at runtime (not included in the installer), so they should only be in the persist list and not in post_install scripts that handle .original directories.

Applied to files:

  • bucket/vscode.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 (8)
bucket/vscode.json (8)

37-39: Good defensive coding for uuid migration.

Adding the uuid property when it's missing but metadata.id exists ensures compatibility with VS Code's extension management. This handles legacy extension installations gracefully.


44-52: Registry template processing logic is well-designed.

The post_install script correctly:

  • Escapes backslashes for Windows registry paths
  • Dynamically processes registry template files
  • Handles both user-level and global installations by replacing registry hives and GUIDs
  • Uses Unicode encoding for registry files (required by Windows)

This approach provides good flexibility for supporting different installation contexts.


74-79: Shortcut creation looks correct.

The shortcut properly references Code.exe and uses a clear, user-friendly name.


80-80: Persist configuration is correct for portable mode.

Persisting the data directory ensures user settings, extensions, and workspace data survive updates and reinstalls, which is essential for a portable VS Code installation.


83-87: Uninstaller logic is well-structured.

The uninstaller:

  • Correctly gates registry cleanup behind $cmd -eq 'uninstall' to prevent running during updates
  • Imports corresponding uninstall registry files to clean up file associations, context menu, and installed program entries
  • Appropriately suppresses output with *> $null

This ensures clean removal of registry entries when the application is uninstalled.


90-92: The productVersion field exists in the API response and is appropriate for version detection. The API endpoint reliably returns "productVersion": "1.108.0", confirming the jsonpath change from $.name to $.productVersion is valid and semantically correct.


65-71: [rewritten review comment]
[exactly ONE classification tag]


73-73: No action needed—the bin directory exists in VS Code's archive.

The VS Code win32-x64 archive includes a bin/ directory at the top level containing launcher wrappers (code.cmd, code, code-tunnel.exe). Adding bin to PATH is correct and allows these scripts to be accessible from the command line. The main Code.exe executable is at the archive root, not in bin/, so this configuration is appropriate.

Likely an incorrect or invalid review comment.

Comment thread bucket/vscode.json
Comment thread bucket/vscode.json
Comment thread bucket/vscode.json Outdated
@SorYoshino
Copy link
Copy Markdown
Contributor Author

/verify

@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

vscode

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

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.

VS Code Windows registry files

1 participant