Skip to content

Feature/privileged helper file ops - #847

Open
abiligiri wants to merge 7 commits into
XcodesOrg:mainfrom
abiligiri:feature/privileged-helper-file-ops
Open

Feature/privileged helper file ops#847
abiligiri wants to merge 7 commits into
XcodesOrg:mainfrom
abiligiri:feature/privileged-helper-file-ops

Conversation

@abiligiri

Copy link
Copy Markdown
Contributor
  • Route file operations such as move , select, symlink, rename, uninstall through privileged helper
  • Add preference to route file operations through privileged helper.
  • Show a spinner when uninstall is in progress

Note that this requires a change in XcodesOrg/XcodesKit#7 to be merged. I will update the Swift Package reference here to XcodesOrg/XcodesKit once that is merged.

These changes allow XcodesApp to be used by non-admin user to install and manage versions of Xcode on enterprise systems where the privileged helper is installed and run as admin.

Ports moveApp/createSymbolicLink/rename/remove from developer_id onto
current HelperXPCProtocol (now Sendable) and adds FileOperations.swift
implementing them.
…ileged helper

Adds usePrivilegedHelperForFileOperations preference and wires
HelperClient's new moveApp/createSymbolicLink/rename/remove methods
into AppState's select, createSymbolicLink, renameToXcode, and
uninstall flows, gated behind the toggle. Falls back to direct
FileManager operations (via FileOperations/XcodeSelectionFilesystemService)
when the toggle is off.
Points the XcodesKit package dependency at abiligiri/XcodesKit async-move-item-for-helper branch, which makes XcodeUnarchiveService.MoveItem async so the post-unarchive move into /Applications can go through Current.helper.moveAppAsync when usePrivilegedHelperForFileOperations is enabled.

This is a temporary fork pin; the corresponding XcodesKit change should be upstreamed to XcodesOrg/XcodesKit and this pinned back to a released version once merged.
Uninstall now permanently deletes files instead of moving to Trash, and the delete can take a noticeable number of seconds with zero visual feedback in the row/detail pane. Sets installState to .uninstalling at the start of AppState.uninstall(xcode:) and resets it on failure; on success the existing post-uninstall updateInstalledXcodesAsync() recompute already clears it back to .notInstalled.

Requires the XcodesKit fork's new .uninstalling(Path) case (abiligiri/XcodesKit@fbee0cd).
…ileOperations strings

The xcstrings.yml CI check requires every key to have translations for all 18 supported languages (ca, de, el, es, fi, fr, hi, it, ja, ko, nl, pl, pt-BR, ru, tr, uk, zh-Hans, zh-Hant), and these two new keys were English-only.
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.

1 participant