Commit Graph
62 Commits
Author SHA1 Message Date
Zorg 8125490931 Pre-warm installs before relaunch (#2421)
Move a lot of the installation work to be done during the first phase of installation (when possible), before the target app needs to be terminated. For the common case where the old and new bundles are on the same volume, the final phase of installation requiring a restart is now just an atomic swap.

Also move the termination listener to the agent app which resolves some launch/CI failures we've been seeing.
2023-08-27 22:22:52 -07:00
Zorg 8039288f64 Harden verification of Sparkle update download (#2392) 2023-06-17 17:01:45 -07:00
Zorg 270582b2e7 Pass bookmark data for the downloaded update (#2359)
Also let Xcode 14.3 update the nibs.
2023-04-12 22:23:50 -07:00
Zorg be7f6952c2 Reduce code size and make codebase more consistent (#2305) 2022-12-27 12:03:03 -08:00
Zorg f5d4ad52ca Allow user to re-try installing/relaunching application (#2234)
If the app termination request is delayed or canceled, the user can check for updates again with the standard user driver and try installing/relaunching again, which will trigger the installer to send another quit event to the running application.

Before the install/relaunch window would close but the check for updates option would still be present but not functional.
2022-08-21 08:54:03 -07:00
Zorg 47f335614a Wait for a threshold amount of time before replying with status info data (#2230)
This also reverts 6a69f26dcc and 4cb6719c6b
2022-08-19 10:40:25 -07:00
Zorg 6a69f26dcc Clean up handling appcast item registration message (#2223) 2022-08-07 17:08:33 -07:00
Zorg 4cb6719c6b Critical update alerts may not show up as promptly as they should when automatically installing them (#2221)
Wait for appcast item registration before finishing automatic update driver.

This fixes a potential race issue where sometimes the automatic update driver on completion would sometimes not trigger to prompt an update alert immediately for critical updates. Note in this case, the update would still be installed on app termination and would still be scheduled to alert the user on the regular update check interval, so this issue is not severe.
2022-08-06 11:28:47 -07:00
Zorg d544d456e0 Synchronize usage of XPC connections to main queue (#2178) 2022-06-25 21:29:44 -07:00
Zorg 2ddef5179e Bump initial installer message timeouts and declare daemon/agents as Interactive (#2162) 2022-06-18 11:40:45 -07:00
Zorg 3a64116913 Update and review internal documentation (#2030) 2021-12-04 22:59:17 -08:00
Mayur Pawashe 6b9981f567 Add generation of API docs (#1915) 2021-08-09 18:27:44 -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
Zorg 8dc4e78cb2 Remove unused installationPath variable from normalization changes 2021-05-14 22:09:41 -07:00
Zorg fbe48e5738 Allow skipping/canceling of an update that is currently installing 2021-05-01 19:53:01 -07:00
Zorg 1244612946 Clear download from installer when extraction fails
One example of extraction failing is the delta update failing to apply.
2021-04-24 19:11:36 -07:00
Zorg 414c8affc5 Compute app path normalization in progress agent
Compute path instead of having installer pass over arbitrary path to agent.
2021-03-27 22:17:25 -07:00
Zorg b3e7a03660 Update and replace bundle directories even more atomically on apfs
With these changes, it should not be possible for neither an old or new bundle to be at the destination.

We also perform temporary directory cleanup after final installation stage is and relaunching an app is performed because we can save some time (150 ms+ in one of my cases).
2021-03-21 17:54:51 -07:00
Zorg 89b7fef457 Add and use function to log NSError objects recursively 2021-03-19 12:35:22 -07:00
Zorg f43b5ee3c3 Propagate agent errors to Sparkle 2021-02-28 22:14:35 -08:00
Zorg 1526a024b8 Propagate installer errors to Sparkle 2021-02-28 21:40:17 -08:00
Zorg 79a9c50d2d Add support for updating/installing from flat packages
With these changes, modern pkg's should no longer need to be archived.

Only guided package installations are supported for flat packages. Specifying an interactive package installation type will result in a rejection. If the file URL has a ".pkg" suffix it is by default assumed to be a guided pkg installation now, which relieves the burden of needing to previously specify sparkle:installationType in the app cast item enclosure, in this case (for 2.x). Moreover, this relieves the burden of developers needing to archive their pkg for Sparkle.
2021-01-30 22:59:09 -08:00
Zorg d38fd92668 Use double quote includes in a bunch of other places I missed 2020-10-03 00:41:59 -07:00
Jordan Rose cb12461be1 Separate prevalidation out of constructor (like 92e00ba on 1.x) 2020-06-10 12:14:30 +01:00
Jordan Rose 261f5dc797 Push SUSignature through SUAppcastItem (like 8ad1f57 on 1.x) 2020-06-10 12:14:30 +01:00
Daniel Jalkut ee64dc7574 Update imports to use framework-style imports to avoid warnings when CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES. Add CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER to xcconfig file to protect against any changes that would introduce such warnings for clients who have the waring enabled. 2019-02-04 13:39:48 -05:00
Kent Sutherland d574574345 Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10.
Removed __has_feature(objc_generics) check and use generisc to help silence the warnings.
2018-06-14 21:22:38 +02:00
Kornel Lesiński 2d30762570 Merge remote-tracking branch 'origin/master' into ui-separation-and-xpc
* origin/master: (39 commits)
  %s is deliberate in this format string
  Unused
  Make generate_appcast available as a shared scheme
  Shush Xcode
  Link straight to docs from the readme
  ignore .html files when scanning for archives
  Missing strings translation.
  Updated swift
  Warn against abusing installUpdatesIfAvailable
  when generating the appcast, if an .html file exists of the same name as the archive, then it will be linked in as the releaseNotesLink
  Revert "Fix pt_BR translations"
  Revert "Fix pt_BR translations (#1039)"
  Fix Japanse localization
  Add more info to auth tool run failure
  Fix pt_BR translations (#1039)
  Fix pt_BR translations
  Disable the keyboard shortcut for the install button for scheduled updates to avoid accidental installs.
  added `sparkle:shortVersionString` to the enclosure, #1032
  Changelog
  percent encode the filename used in the delta url
  ...
2017-03-24 12:14:05 +00:00
Zorg dfaed624ae Merge branch 'master' into ui-separation-and-xpc 2017-01-17 15:58:02 -05:00
Zorg e1a4ad9371 Add level parameter to SULog()
Current levels are: default and error
2017-01-05 22:51:36 -05:00
Zorg 36ed896d0f Rename SPUInstallerProtocol -> SUInstallerProtocol, remove -cleanup
This is to prepare for the next merge from master.
2016-12-26 19:12:02 -05:00
Zorg fd533f937e Don't pass version comparator to SUInstaller 2016-12-26 13:03:20 -05:00
Zorg 553168ba51 Merge branch 'master' into ui-separation-and-xpc 2016-12-23 14:44:32 -05:00
Zorg 9ea4cf1bf6 Merge branch 'master' into ui-separation-and-xpc 2016-12-04 17:05:01 -05:00
Zorg 213bedfa37 Merge branch 'master' into ui-separation-and-xpc 2016-09-03 22:50:25 -04:00
Zorg fb2aea0d86 Fix normalization relaunch path setting and improve relaunching code
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=1 now works properly again. In the progress agent, we don't use the path sent from the installer unless the normalized setting is enabled.
2016-08-27 10:40:38 -04:00
Zorg 251feb7e07 Rename registerRelaunchBundlePath to registerApplicationBundlePath 2016-08-27 02:24:37 -04:00
Zorg db642a0700 Fix relaunching if multiple instances of app were running
We leave the "application was alive and needs to terminate logic" to the progress agent rather than to the installer too.
2016-08-26 18:23:42 -04:00
Zorg 46a75cde97 Terminate application in the progress agent instead of user driver
This allows us to remove SPUUserDriverUIComponent and remove a bunch of logic in the user driver regarding termination. The user drivers generally don't need to know about the application bundle anymore, and strictly now only show UI events.

This has another advantage of the agent being able to quit multiple instances of an application even if the application to update is sandboxed.

We enforce the logic that an application can only be relaunched if it was running initially.
2016-08-25 23:46:42 -04:00
Zorg 1282e42031 Defend against possible symbolic link attack 2016-08-14 23:07:44 -04:00
Zorg 766dd50aeb More SU -> SPU prefix changing 2016-08-06 21:00:14 -04:00
Zorg e53539b19e Don't deprecate +defaultComparator, although discourage it and use alloc/init 2016-08-06 11:18:00 -04:00
Zorg c9f673cda8 Use SPU prefix in many places 2016-08-05 19:10:21 -04:00
Zorg 5ad5598a19 Make sure update directory != nil during cleanup 2016-07-30 17:49:37 -04:00
Zorg 1ca233eadf Validate the update before extraction whenever possible
If we download a package type installation or a delta update, we should validate the update before trying to unarchive it.

We can't do this with ordinary updates because we handle changing of DSA keys for that particular case.
2016-07-30 17:36:22 -04:00
Zorg 2fc57ce288 Move installation validation to separate class 2016-07-30 16:03:52 -04:00
Zorg d42ac08bf2 Split connection agent counter into two separate variables 2016-07-30 15:38:09 -04:00
Zorg 23e027d02f Have progress agent terminate after relaunching, not after stopping progress 2016-07-30 14:18:39 -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