-
Notifications
You must be signed in to change notification settings - Fork 1.5k
zed: Update installer script to turn off auto update #16508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdds a post-install step to the Zed Scoop bucket that ensures Zed's Changes
Sequence Diagram(s)sequenceDiagram
participant Installer
participant Filesystem
participant Network
Note over Installer,Filesystem: Post-install: disable Zed auto-updates
Installer->>Filesystem: Ensure %APPDATA%/Zed exists
alt settings.json exists
Installer->>Filesystem: Read settings.json (keep comments)
else settings.json missing
Installer->>Network: Download initial_user_settings.json
Network-->>Installer: initial_user_settings.json
end
Installer->>Installer: Ensure auto_update = false (preserve other keys)
Installer->>Filesystem: Write updated settings.json (UTF-8)
Note right of Filesystem: Installation complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (2)
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. Comment |
|
All changes look good. Wait for review from human collaborators. zed
|
There was a problem hiding this comment.
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 (1)
bucket/zed.json (1)
16-30: Add error handling for JSON parsing and file operations.The auto-update disable logic lacks error handling. If the JSON file is corrupted or parsing fails,
ConvertFrom-Jsonwill throw an unhandled exception, causing the installation to fail. Similarly, file system operations (New-Item,Out-File) may fail silently or raise exceptions if permissions are insufficient. Wrap the JSON operations in atry-catchblock to gracefully handle errors and provide helpful diagnostics.Additionally, the condition on line 27 (
-ne $false) avoids unnecessary writes but could be clearer with an inline comment explaining the intent (e.g., "only write if we modified the setting").Consider this improved structure:
"# Turn off Auto Update", "$zedSettingsPath = Join-Path $env:APPDATA \"Zed\\settings.json\"", "$zedDir = Split-Path $zedSettingsPath", "if (!(Test-Path $zedDir)) {", " New-Item -ItemType Directory -Path $zedDir | Out-Null", "}", - "if (Test-Path $zedSettingsPath) {", - "$jsonContent = Get-Content $zedSettingsPath -Raw | ConvertFrom-Json", - "} else {", + "try {", + "if (Test-Path $zedSettingsPath) {", + "$jsonContent = Get-Content $zedSettingsPath -Raw | ConvertFrom-Json", + "} else {", - "$jsonContent = @{}", - "}", - "if ($jsonContent.\"auto_update\" -ne $false) {", + "$jsonContent = @{}", + "}", + "} catch {", + "Write-Host 'Warning: Failed to parse Zed settings. Auto-update disable skipped.' -ForegroundColor Yellow", + "exit 0", + "}", + "# Only write settings if auto_update is not already false", + "if ($jsonContent.\"auto_update\" -ne $false) {", "$jsonContent | Add-Member -NotePropertyName \"auto_update\" -NotePropertyValue $false -Force", "$jsonContent | ConvertTo-Json -Depth 10 | Out-File -FilePath $zedSettingsPath -Encoding UTF8", - "}" + "}",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
bucket/zed.json(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-16T06:32:15.420Z
Learnt from: qyurila
Repo: ScoopInstaller/Extras PR: 16346
File: bucket/zed.json:18-21
Timestamp: 2025-10-16T06:32:15.420Z
Learning: The Zed Windows application has three separate executables after InnoSetup extraction:
- `zed.exe` at root: GUI application (used in shortcuts)
- `bin/zed`: Shell script for WSL integration
- `bin/zed.exe`: Zed CLI binary with different behavior than the GUI
All three should be preserved in the manifest.
Applied to files:
bucket/zed.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). (2)
- GitHub Check: WindowsPowerShell
- GitHub Check: PullRequestHandler
🔇 Additional comments (1)
bucket/zed.json (1)
14-15: Verify the extraction logic and-Removalflag necessity.Line 14 extracts to
{app}, and the new line 15 extracts the same archive to{code_GetInstallDir}with the-Removalflag. Extracting the same file twice seems unusual—clarify whether this is intentional (e.g., for backward compatibility or extracting different components to different locations). Also confirm that-Removaldeletes the archive after the first extraction and doesn't prevent the second extraction.
<manifest-name[@version]|chore>: <general summary of the pull request>Summary by CodeRabbit