Commit Graph
69 Commits
Author SHA1 Message Date
Zorg fc4f8cb753 Harden policy on what operations clients are allowed to take
* For the Installer and Downloader XPC Services, if these executables are code signed with an Apple issued Team ID, then the connecting client must also be code signed with a matching Team ID.
* For the Downloader XPC Service, the request URL must be http/https
* For Autoupdate, if stage 1 of installation hasn't been completed yet and this executable is code signed with an Apple issued Team ID, then the connecting client must also be code signed with a matching Team ID. As before, multiple simultaneous connections are still disallowed.
* For Autoupdate, if it's not signed with Apple issued certificate, when installing package updates the bundle being updated must be itself and owned by root on disk (as one expects from a PKG installation)
* The authorization prompt message in the Installer Service is more computed inside the service so the client can't pass a completely arbitrary message
* Add extra nullable checking of parameters coming from XPC endpoints
* Add more thread-safe synchronization for Autoupdate installer
* Add logs for more failure points
2025-09-07 18:06:30 -07:00
Viktor Szépe e9989a8ae7 Fix typos (#2537) 2024-04-13 16:12:23 -07:00
Zorg 7cc751ff4f Fail gracefully when auxiliary tool cannot be located (#2436) 2023-09-06 21:05:59 -07:00
Zorg 0e865f07c5 Fix Updater.app not starting when running Sparkle as root on Sonoma (#2432)
This may occur for example when you run sparkle-cli as root or use Sparkle.framework in a root process. This is not typically a common use case, but could be used from daemons.

The issue is that Sonoma doesn't like starting our Updater app in the user domain when intermediate directories containing it are root owned (due to lack of file permission access that wasn't present in Ventura). So now we try to create intermediate directories in the standard user's home directory.
2023-09-02 10:01:23 -07:00
Zorg 06edf5695d Remove unnecessary min macro checks (#2318)
Minimum OS preprocessor checks should only be used when compiler may generate compile warnings for deprecated APIs when the deployment target is raised.
2023-02-11 22:24:56 -08:00
Zorg be7f6952c2 Reduce code size and make codebase more consistent (#2305) 2022-12-27 12:03:03 -08:00
Zorg 2ddef5179e Bump initial installer message timeouts and declare daemon/agents as Interactive (#2162) 2022-06-18 11:40:45 -07:00
Zorg 15e8270291 Silence deprecation warnings when bumping deployment target (#2152) 2022-06-11 13:09:23 -07:00
Zorg 339e26984e Add support for running framework and CLI as root (#2119)
When the framework or sparkle-cli is run as root, we always launch the installer (Autoupdate) in the system domain.

For the progress tool agent, we chown() the copied Updater.app so the Updater app has proper ownership of it (and clean it up later). The progress tool app may not be able to clean up the parent directory, but that's okay and will be garbage collected on a later run.

To get the username and home directory for the user session when running the framework as root, we use the SecurityConfiguration framework. Sparkle needs and depends on an active GUI user login session. If a user ssh's in to install an update, that user must be the same as the active logged in user.

Installing interactive based package updates as root is not supported. For sparkle-cli, we disallow using --interactive when running as root.

An additional error exit code is added for sparkle-cli when ran as root and trying to install a interactive based package update, which is unsupported.
2022-05-07 09:33:27 -04:00
Eitot 180f8975cf Replace deprecated code with newer APIs (#2112)
* Use UniformTypeIdentifiers framework to replace deprecated types

kUTType* constants are deprecated since macOS 12. The UniformTypeIdentifiers framework is available since the macOS 11 SDK.

* Replace renamed constants

* Use API_AVAILABLE macro instead of __OSX_AVAILABLE
2022-04-24 16:51:48 -07:00
Zorg acc4674c3e Fix volume detection being wrong in rare cases (#2026) 2021-11-24 11:33:04 -05:00
Zorg 80abad4477 Move XPC Services inside Sparkle framework (#1965)
Also bump FRAMEWORK_VERSION from A to B to work around system cache issues.
2021-10-17 23:35:09 -07:00
Zorg 1dea970512 Update changelog and documentation (#1956)
* Update author to Sparkle Project when generating documentation

* Sync change log from 1.27.0

* Add recommendation to not call checkForUpdatesInBackground directly

* Add testing documentation for latsUpdateCheckDate

* Fix formatting with user driver header documentation
2021-09-19 08:44:01 -07:00
Mayur Pawashe cce5edd78d Remove installer interaction delegate API / refactor finishing update cycle (#1925) 2021-09-02 23:12:26 -07:00
Tony Arnold ee679586cf Add a workflow that builds and publishes a release via GitHub Actions (#1908)
The workflow assumes changelog and version information have been updated and the tag has not been created yet before running it. When the workflow finishes, it should take you to a release page with the uploaded binaries, where you can verify the final details and publish a tag officially.

Also the following improvements were made:

* Change CURRENT_PROJECT_VERSION to represent a monotonically increasing bundle version (starting at 2000)
* Add MARKETING_VERSION to represent marketing version of Sparkle, comprised of SPARKLE_VERSION_MAJOR, SPARKLE_VERSION_MINOR, SPARKLE_VERSION_PATCH, and the new SPARKLE_VERSION_SUFFIX for pre-releases.
* Verify code signing signatures of extracted SPM zip file in make release and CI
* Generate changes to Sparkle podspec, just like the Package.swift file, based on current marketing version
* Improve format of Info.plist version strings when appending git hash info, eliminating unnecessary whitespace
* Simplify validating that XPC Service versions align with framework version
* Handle lightweight tags in addition to annotated tags in release-move-tag.sh
2021-08-26 22:42:38 -07:00
Mayur Pawashe e5c63b6369 Set $USER and $HOME variables when running guided pkg installers (#1884)
Set $USER and $HOME variables when running guided pkg installers

This allows pre/post install scripts to reference the user's environment correctly. The standard pkg installer GUI preserves these two variables.
2021-07-07 08:31:33 -07:00
Daniel Jalkut 232ce2543e Fix the build with Xcode 13 by explcitly importing ImageIO. Previously it was being implicitly imported along with Foundation. 2021-06-09 14:04:26 -04:00
Zorg 3306ccd994 Suppress deprecation warnings for SMJobSubmit functions 2021-05-15 11:58:01 -07:00
Zorg 712753d812 Add log linking to sandboxed steps if app isn't sandboxed at all 2021-05-01 14:36:45 -07:00
Zorg e8d5c8024c Log error if developer sandboxes installer launcher service 2021-05-01 14:30:21 -07:00
Zorg db6ef214ab Update authorization prompt when updating an app
We have a slightly different prompt for an app updating itself vs an app/tool updating another app. Also put prompt in the localization strings.
2021-04-18 11:44:30 -07:00
Zorg 467ffb15ca Pass whether or not system domain is being used back to framework
This avoids needing to do a file system check in InstallerConnection to determine if we need to connect to the system or user domain.
2021-04-03 17:16:38 -07:00
Zorg 5cd1d3c824 Move helper tools into executables directory of framework 2021-02-28 10:25:42 -08:00
Zorg dfaed624ae Merge branch 'master' into ui-separation-and-xpc 2017-01-17 15:58:02 -05:00
Zorg 2bb5ce4318 Make SUBundleIcon & SUApplicationInfo take SUHost, not NSBundle
When we retrieve the "CFBundleIconFile" key from the Info dictionary, we should rely on SUHost's method of obtaining that value now.
2017-01-07 22:55:13 -05:00
Zorg e1a4ad9371 Add level parameter to SULog()
Current levels are: default and error
2017-01-05 22:51:36 -05:00
Zorg 853a0ecd82 Use SU prefix for ApplicationInfo and BundleIcon classes
This is to hopefully make merging recent changes from master easier.
2016-12-24 21:19:20 -05:00
Michel Fortin 5f255c4865 Fixing memory leak where transferring of property dictionary to ARC. 2016-08-27 11:20:34 -04:00
Zorg 47f08be1a0 Don't check or download updates if updater isn't allowed interaction
This only affects updater delegates that return NO from -updaterShouldAllowInstallerInteraction:

This improves the user experience in sparkle-cli where now the checking can be aborted before even downloading the update feed, if it knows ahead of time that installation will fail.
2016-08-20 18:56:01 -04:00
Zorg 766dd50aeb More SU -> SPU prefix changing 2016-08-06 21:00:14 -04:00
Zorg c9f673cda8 Use SPU prefix in many places 2016-08-05 19:10:21 -04:00
Zorg 8c564fef1f Remove +[SUFileManager defaultManager] and use alloc/init 2016-07-30 10:39:17 -04:00
Zorg ea1b04391f Improve cache storage handling of files
We first create a directory with respect to the app's bundle ID being updated, sparkle's bundle ID, and a directory inside for a specific purpose. Then we remove all old directories inside there, and create a new unique temporary directory.

This is to avoid conflicts with eg: multiple updaters running against each other around the same time, or files for one function interfering with files from another purpose, while still having a way to clean up old files.
2016-07-30 01:00:14 -04:00
Zorg 5852ecf0e7 Improve handling of disallowing update interaction
When resuming updates, if interaction is disallowed, we can't continue on with interactive package installation
2016-07-29 20:21:53 -04:00
Zorg e2da47b7c7 Improve handling of storing files in cache
Create distinct subdirectories in our cache directory so files for different purposes won't conflict.

For the installer, move the download archive to the installer's cache location. If the installer is running as root, this moves it to a place only root can access I believe. This is also to prevent other functionality from touching these files.
2016-07-28 22:54:28 -04:00
Zorg 32bf570b4c Add some comments to installation process 2016-07-28 20:27:12 -04:00
Zorg 3be36d8f22 Don't pass installer/agent path to launcher XPC service
The InstallerLauncher code now tries to locate these tools inside Contents/MacOS/ or inside the Resources directory. The installer launcher XPC service now has a copy of the tools included in its bundle.

This may seem like wasting space but it enables eg, the XPC service not trusting a sandboxed application. A developer could always remove the tools from the Sparkle framework if necessary (we can't because the XPC services are optional..)

Using the XPC service allows the developer to sign the installer executable (Autoupdate.app). The agent app can be moved and signed into the MacOS executables directory as well. We don't do that automatically because Xcode's tooling doesn't play nice with attempting that, although that could be looked at later.
2016-07-27 19:57:46 -04:00
Zorg 646ed6f3c4 Improve logic for allowing installer interaction
We now distinguish between the updater delegate allowing interaction and the update driver allowing interaction. We also remove an interaction allowed flag from the AppInstaller, letting shouldShowUI flag suffice.
2016-07-26 20:00:56 -04:00
Zorg 0ca688073b Disable root support & checking
Assume that the updater will be run as a logged in user.
The command line driver and progress app aren't completely root safe anyway, and running the progress app under a different user could be quite awkward from root
2016-07-26 19:16:38 -04:00
Zorg eac55846a8 Avoid copying the installer to a temporary location 2016-07-25 17:13:18 -04:00
Zorg 1384b5a80f Allow tagging installation type in appcast item enclosure
This is now necessary for package type installations so we can know whether or not we should authenticate ahead of time.

Of course, we also verify that the download contains the type of installation we expect (because the appcast is not very trusted).
2016-07-24 23:35:47 -04:00
Zorg d8196e1c5d s/cancelled/canceled/ 2016-07-24 20:17:09 -04:00
Zorg 1d3776d5c7 Show app icon in the prompt for authorization 2016-07-24 19:23:56 -04:00
Zorg e5643e2990 Improve authorization prompt handling
We now present a better worded dialog (X wants to update. Please type your password to allow this. OK/Cancel)
We still need to set the icon for the dialog window.

I also fixed some issues with canceling the dialog still throwing an error.
2016-07-24 17:05:26 -04:00
Zorg c95b337b09 Don't need SUSubmitInstaller.h/m anymore 2016-07-24 15:37:33 -04:00
Zorg a1d43997d9 With JoinExistingSession, the agent doesn't need to submit the intaller ever 2016-07-24 13:03:39 -04:00
Zorg 21ad358772 Add JoinExistingSession key to InstallerLauncher service
This is necessary for older OS versions (10.8 & 10.9), otherwise authorization interaction will not be allowed
2016-07-24 11:06:37 -04:00
Zorg 41ee168f2c Change try again error to authorize later error 2016-07-23 14:49:19 -04:00
Zorg c2db46f656 Add error codes to log messages 2016-07-23 14:46:35 -04:00
Zorg 345ed3b60e Add resuming downloaded updates without starting the installer automatically
This allows automatically downloading updates, and having them prompt up later, so the user can perform authorization later for starting up the installer
2016-07-23 09:08:29 -04:00