Compare commits

..
1009 Commits
Author SHA1 Message Date
Kornel Lesiński 6146b0a002 Version bump 2015-01-25 10:54:43 +00:00
Kornel ce22598d13 Merge pull request #481 from MaddTheSane/useModules
Have Sparkle build a framework module.
2015-01-22 16:45:20 +00:00
C.W. Betts c067f7a13b Have Sparkle build a framework module. 2015-01-20 14:57:07 -07:00
Kornel Lesiński 89c21b3acd Updated changelog 2015-01-15 09:54:06 +00:00
Kornel Lesiński 2adadf56e1 Explicit @synthesize 2015-01-15 09:41:00 +00:00
Kornel 57530564a6 Merge pull request #446 from tonyarnold/skip-install
Skip installing the framework by default — fixes #419
2015-01-15 09:30:25 +00:00
Kornel 3bebcfdd68 Merge pull request #476 from greenbuffo/master
Fix Autoupdate.app crash on 10.7 (issue #441)
2015-01-14 23:12:36 +00:00
Chris Campbell b5fc2be113 Fix Autoupdate.app crash on 10.7 (issue #441)
Autoupdate.app can crash in the middle of installing an update, leaving
the user with a broken application. The crash is caused by the status
window’s controller (SUStatusController) being prematurely deallocated
before the window is closed. This change prevents such a crash by
keeping a strong reference to the SUStatusController in
TerminationListener.
2015-01-14 11:42:33 -05:00
Kornel 6dc6240fab Merge pull request #471 from GerTeunis/master
Using a weak id delegate property will crash during instantiation of NIB on OS X 10.7
2014-12-28 21:05:36 +00:00
Ger Teunis 4aecd9056b Using a weak id delegate will crash during instantiation of NIB on OS X 10.7 2014-12-27 14:05:09 +01:00
Kornel fbd20b7084 Merge pull request #442 from sparkle-project/cachedir
Use Library/Caches rather than app support directory
2014-12-23 11:30:38 +00:00
Kornel d695893329 Merge pull request #465 from bitigchi/patch-1
Capital Case Correction
2014-12-22 20:55:48 +00:00
Kornel 8443f88bb2 Merge pull request #466 from bitigchi/patch-2
Small fixes
2014-12-22 20:55:35 +00:00
Kornel acb1568708 Merge pull request #467 from bitigchi/patch-3
Small fixes
2014-12-22 20:55:24 +00:00
Kornel 51581fd3f5 Merge pull request #468 from bitigchi/patch-4
Context fixes
2014-12-22 20:53:47 +00:00
Emir 15b2d6256f Context fixes
Fixed poor spelling and context issues.
2014-12-22 21:08:25 +02:00
Emir 5d2fd5ca6d Small fixes
Capitalisation and context fixes
2014-12-22 21:01:54 +02:00
Emir 6f0e194705 Small fixes
Capitalisation and context fixes
2014-12-22 20:58:33 +02:00
Emir 4f4800bf26 Capital Case Correction
Turkish-lang specific capitalisation correction.
2014-12-22 20:55:16 +02:00
Kornel 1d3d15d5c1 Merge pull request #461 from kylef/lzma
Add support for lzma compressed tarballs
2014-11-23 12:22:36 +00:00
Kyle Fuller f139ccc5e7 Add support for lzma compressed tarballs 2014-11-22 17:16:30 +01:00
Jake Petroules 760a1589ba Merge pull request #456 from vslavik/defer-SUClearLog
Don't call SUClearLog() unless logging something
2014-11-16 11:45:12 -08:00
Václav Slavík b9f987382c Don't call SUClearLog() unless logging something
Don't delete the log file and log app name to it when only checking for
updates - this is something done frequently, on many apps' startup.
Instead, clear the log before writing the first entry to it, so that it
stays untouched if there's nothing to add to it.

Log the application name before the first "real" log entry, instead of
doing it unconditionally every time checkForUpdatesWithDriver: is called.
2014-11-16 17:00:36 +01:00
Jake Petroules 313b146b8e Merge pull request #448 from ivira/master
Proofing of Ukrainian localization.
2014-11-02 11:04:28 -08:00
Jake Petroules 3676feef94 Merge pull request #449 from orzFly/patch-1
Fix a repeated string in Traditional Chinese
2014-11-02 11:01:22 -08:00
Yeechan Lu 7157782c4c Fix a repeated string in Traditional Chinese 2014-11-03 01:22:48 +08:00
Vera Tkachenko f803d31274 Proofing of Ukrainian localization. 2014-11-02 11:36:14 +02:00
Tony Arnold f996ad8e04 Skip installing the framework by default — fixes #419 2014-10-31 13:26:54 +11:00
Jake Petroules 91166ca7ea Merge pull request #445 from tonyarnold/fix-xcode-6.1-warnings
Update LastUpgradeCheck within xcschemes and pbjproject to 0610 for Xcode 6.1
2014-10-30 00:20:08 -07:00
Tony Arnold e1a6467792 Fix warnings under Xcode 6.1 relating the SUUpdateAlert XIB 2014-10-30 12:30:10 +11:00
Tony Arnold 152ed05389 Update LastUpgradeCheck within xcschemes and pbjproject to 0610 for Xcode 6.1 2014-10-30 12:24:53 +11:00
Kornel df57ff045d Merge pull request #444 from kainjow/master
Removed some pragmas
2014-10-27 22:22:30 +00:00
Kevin Wojniak c5868c6eea Removed useless sole pragma mark 2014-10-27 13:55:41 -07:00
Kevin Wojniak ebcbb71e8c Removed outdated SUClearLog comment 2014-10-27 13:54:59 -07:00
Kevin Wojniak a90b075eec Removed use of pragma once in SULog to be consistent with the other headers 2014-10-27 13:54:14 -07:00
Kevin Wojniak f7629eb044 Changed NSSortDescriptor key input to allow for removal of pragma 2014-10-27 13:52:03 -07:00
Kevin Wojniak f1132002b9 Removed pragma which disabled a warning that is no longer shown in Xcode 6.1 2014-10-27 13:51:05 -07:00
Kornel Lesiński 82674cfa9b Use Library/Caches rather than app support directory
Fixes #146
2014-10-20 23:49:33 +01:00
Kornel 096180e879 Merge pull request #439 from erik999/master
Fixed Swedish translations
2014-10-16 13:16:16 +01:00
Erik Vikström be7e968834 Fixing Swedish translations
See https://github.com/sparkle-project/Sparkle/issues/436
2014-10-16 08:59:51 +02:00
Kornel 7fcd8be9d2 Merge pull request #437 from MaddTheSane/exportErrors
Make the error definitions public
2014-10-14 11:57:36 +01:00
C.W. Betts 85f1815d8b Make the error definitions public 2014-10-13 18:24:32 -06:00
Kornel bb5e302980 Merge pull request #434 from codyrobbins/master
Changed a straight apostrophe into a curly one
2014-10-08 01:51:55 -04:00
Cody Robbins 814028cb83 Changed a straight apostrophe into a curly one
Changed the apostrophe in the title of the ‘Don’t Check’ button on the update permissions prompt dialog from a straight one to a curly one.
2014-10-07 14:28:52 -04:00
Kornel 7e1b47976d Merge pull request #432 from yetamrra/master
Add delegate method for errors
2014-10-04 13:38:42 -10:00
Benjamin Gordon feae8bf7b3 Call delegate didAbort in other drivers when showErrors is false. 2014-10-04 16:25:34 -06:00
Benjamin Gordon 7a6d4bd380 Added SUUpdater delegate method for failures. 2014-10-04 16:18:49 -06:00
Kornel 3f9e50d10f Merge pull request #426 from alfwatt/master
Check for a modal window being onscreen before trying to put up the Spar...
2014-09-23 19:30:52 -07:00
Kornel Lesiński ba407a84b9 Updated changelog 2014-09-23 18:57:43 -07:00
Alf Watt 86429ecd50 Check for a modal window being onscreen before trying to put up the Sparkle prompt. 2014-09-23 18:57:10 -07:00
Jake Petroules 0344e2d5fa Add screenshot to README showing Sparkle in action. 2014-09-06 21:51:47 -04:00
Jake Petroules 46f2c07587 Add instructions to the README for building release packages. 2014-08-27 22:15:12 -04:00
Jake Petroules 1690bfa9bd Fix package building for Debug configuration. 2014-08-27 22:03:22 -04:00
Jake Petroules 19c6098d30 Share the distribution scheme and configure it to run tests.
This way, we don't rely on automatic scheme creation in Travis, nor do
we have to update the Makefile for Travis if we want to add an
additional test target to the project.

Also, Travis should now build all targets (including BinaryDelta and
Sparkle Test App), giving us better build coverage.
2014-08-27 21:52:40 -04:00
Jake Petroules ecf602f589 Avoid hardcoded file paths. 2014-08-27 21:37:47 -04:00
Jake Petroules 49721abdaa Add ARM support to the system profiler as OS X might later run on it. 2014-08-27 21:19:09 -04:00
Jake Petroules d7ef18ec91 Use string constants in system profiler. 2014-08-27 21:11:45 -04:00
Jake Petroules 89081ca030 Eliminate a few more string constants. 2014-08-27 20:53:38 -04:00
Jake Petroules 8d74807b23 Use string constants for RSS element and attribute names. 2014-08-27 20:53:27 -04:00
Jake Petroules f72bd52e87 Fix minor spelling error. 2014-08-27 20:48:58 -04:00
Jake Petroules 771a4c9b6b Rename Sparkle appcast keys to make clear elements vs attributes. 2014-08-27 20:08:57 -04:00
Jake Petroules 945a82e9f0 Prefer string constants to strings. 2014-08-27 19:58:10 -04:00
Jake Petroules a4c5e78794 Merge branch 'tamasprezi-tags_fix' 2014-08-27 19:49:39 -04:00
Tamás Lustyik 25cda72d66 Fixed Sparkle tags parsing 2014-08-27 19:49:03 -04:00
Kornel d3c6bd0250 Merge pull request #414 from sparkle-project/visibility
Only export public symbols.
2014-08-26 10:22:21 +01:00
Jake Petroules aa88b40b24 Only export public symbols. 2014-08-25 18:58:12 -04:00
Jake Petroules c87ab4b9c1 Merge pull request #399 from MaddTheSane/errEnum
Have Sparkle’s error codes be defined using NS_ENUM.
2014-08-23 20:41:23 -04:00
Jake Petroules 352aa18377 Merge branch 'kainjow-master' 2014-08-23 20:35:15 -04:00
Jake Petroules 6638b7f9c4 Merge branch 'master' of https://github.com/kainjow/Sparkle into kainjow-master
Conflicts:
	Sparkle/SUUpdater.h
2014-08-23 20:34:49 -04:00
Jake Petroules ec5b2a22c8 Make sure CFBundleVersion is a semantic version number.
CFBundleShortVersionString is now used to embed the Git rev info instead.
2014-08-23 18:03:12 -04:00
Jake Petroules c926aa48f5 Spaces to tabs in Info.plist 2014-08-23 16:44:40 -04:00
Jake Petroules c839ccf916 BinaryDelta: avoid crash with bad paths. 2014-08-23 01:04:41 -04:00
Jake Petroules 0171677513 Fix Clang static analyzer warning.
Closes #385
2014-08-22 23:13:44 -04:00
Jake Petroules 3314d9e3a5 Add Sparkle Appcast attributes as constants. 2014-08-22 22:31:39 -04:00
Jake Petroules 2d33875017 Prefer named constants where available. 2014-08-22 22:04:59 -04:00
Jake Petroules 0ff409a3d9 Improve formatting in license file.
Use a more standard header and fix line length.
2014-08-22 21:50:35 -04:00
Jake Petroules e89d3a7e15 Clean up Autoupdate.m a bit. 2014-08-22 21:37:00 -04:00
Jake Petroules bce54912ee Remove dead code.
Does nothing, not needed.
2014-08-22 21:10:24 -04:00
Jake Petroules 0851dc9a67 Fix regression in SULocalizedString macro. 2014-08-22 20:39:56 -04:00
Jake Petroules bfaeffc8f9 Simplify code path. 2014-08-21 19:53:38 -04:00
Jake Petroules 223436a6b7 Silence direct ivar access warning. 2014-08-21 19:38:21 -04:00
Jake Petroules 8db491ade0 Further reduce macro usage. 2014-08-21 19:25:53 -04:00
Jake Petroules b774241f25 Use Info.plist keys instead of macros.
This helps ensure that all code paths are compiled during development, reducing the chance of build errors (especially in CI). Additionally, developers can change these values without having to rebuild Sparkle (but it is still safe because modifying the plist will break the code-signing seal).
2014-08-21 19:12:29 -04:00
Jake Petroules bb743d80e0 Reduce duplication and macros. 2014-08-21 18:41:16 -04:00
Jake Petroules 888c3d4797 Copy Autoupdate.app in a separate phase. 2014-08-21 18:12:46 -04:00
Jake Petroules 54de8d1f2a Properly set install names and rpaths for targets. 2014-08-21 17:52:35 -04:00
Jake Petroules 68dff7ac81 Keep settings in xcconfig, remove unnecessary ones. 2014-08-21 17:17:58 -04:00
Jake Petroules 83032dc7ac Use proper variables in shell scripts. 2014-08-21 17:14:48 -04:00
Jake Petroules 2820b36d7e Silence warnings in XCTest framework. 2014-08-21 17:01:44 -04:00
Jake Petroules 2a7b94bc9d Add CodeSignOnCopy, RemoveHeadersOnCopy attributes. 2014-08-21 17:01:27 -04:00
Jake Petroules c393d58fe5 Update podspec for v1.8. 2014-08-21 16:46:04 -04:00
Kevin Wojniak 8d8cc35c96 Use standard Denial-of-Service acronym. 2014-08-04 09:17:41 -07:00
C.W. Betts 69bfc27960 Retain binary compatibility with older versions of Sparkle. 2014-08-02 12:38:53 -06:00
C.W. Betts d2ebc47c1e Have Sparkle’s error codes be defined using NS_ENUM.
This has the benefit of setting their size/type (OSStatus), and more usable with Swift.
2014-07-29 20:03:10 -06:00
Kornel Lesiński ee73e4c3e9 Code formatting 2014-07-29 02:05:22 +01:00
Kornel Lesiński 8ecbb25274 Warn when version is missing 2014-07-29 02:05:12 +01:00
Jake Petroules e437b720a4 Merge pull request #398 from MaddTheSane/nsEnumedEnums
Change enums to NS_ENUMs
2014-07-26 17:00:00 -04:00
C.W. Betts b8e28910ba Change SUCharacterType to an NSInteger. 2014-07-26 14:50:49 -06:00
C.W. Betts 852b6e0976 Change ints in NS_ENUMs to NSIntegers. 2014-07-26 11:12:59 -06:00
C.W. Betts b7eb5403ff Replace typedef enums with typedef NS_ENUM.
For one thing, it make Swift happier. Also, we don’t have to worry about what size/type the value is.
2014-07-26 11:03:18 -06:00
Kornel Lesiński 0b186dc939 Updated changelog 2014-07-26 15:57:09 +01:00
Kornel Lesiński 22dff08b8d Make it clear that bundled DSA key is only for the test app 2014-07-26 15:45:31 +01:00
Kornel Lesiński b9e94d49ae Ensure that updateItem isn't freed during the update 2014-07-26 14:38:30 +01:00
Kornel Lesiński 867a91cbe4 Clarified error message 2014-07-26 02:26:40 +01:00
Kornel Lesiński aadadeef5b Version bump 2014-07-26 02:16:59 +01:00
Kornel Lesiński 7b7e3f6e23 Log detailed signature verification failures 2014-07-26 02:16:59 +01:00
Kornel Lesiński e2e37da3ce nil-safe dictionary 2014-07-26 02:16:59 +01:00
Kornel Lesiński 6d861c5d92 Rely on SULog prefix 2014-07-26 02:16:59 +01:00
Kornel Lesiński 80dee159de Simpler newline 2014-07-26 02:16:59 +01:00
Kornel Lesiński de9ec2a849 Always copy log to NSLog 2014-07-26 02:16:58 +01:00
Kornel Lesiński 7a1f627c79 Close windows before termination, not after 2014-07-26 02:16:58 +01:00
Kornel Lesiński cf7711fb83 Updated readme 2014-07-26 00:41:09 +01:00
Kornel Lesiński c7ec996c23 Add scheme required by xcodebuild 2014-07-26 00:04:53 +01:00
Kornel Lesiński a8c2a98379 Run unit tests in Travis 2014-07-25 23:47:31 +01:00
Kornel Lesiński 7148c0f3e6 Added others to podspec 2014-07-25 13:00:14 +01:00
Kornel 05b5758058 Merge pull request #393 from xhacker/podspec
Add podspec
2014-07-25 12:56:21 +01:00
Xhacker Liu c2f498f157 Add podspec. 2014-07-25 01:52:57 -07:00
Kornel Lesiński e11f8387b2 Added DSA verifier test 2014-07-25 02:19:29 +01:00
Kornel Lesiński d3198961d7 Don't crash using CFPreferences when defaultsDomain is unknown 2014-07-25 01:30:00 +01:00
Kornel Lesiński 3f37fe7674 Xcode upgrade check harassment marker 2014-07-25 01:28:32 +01:00
Kornel Lesiński 245b4e1608 Xcode’s being weird 2014-07-25 00:41:53 +01:00
Jake Petroules 9516d6d667 Merge pull request #387 from MaddTheSane/QuarantineVal
Quarantine removal
2014-07-21 18:06:27 -04:00
C.W. Betts b13b57e800 remove unnecessary return; 2014-07-19 21:46:29 -06:00
Kornel 9480f40522 Merge pull request #378 from grahammiln/travis
Add Travis continuous integration support
2014-07-20 02:55:16 +01:00
C.W. Betts 32d4de464d Don't use new code if specifically targeting OS versions that have the new API. 2014-07-19 15:05:08 -06:00
C.W. Betts 578666e9e6 Minor fix. 2014-07-19 14:44:06 -06:00
C.W. Betts 591d7d0049 Better, forward-compatible way of looking up NSURLQuarantinePropertiesKey, as suggested by @jakepetroules 2014-07-19 14:38:51 -06:00
Jake Petroules 417e018432 Merge pull request #388 from MaddTheSane/XcodeMaintanence
Xcode maintenance.
2014-07-18 16:04:49 -04:00
C.W. Betts fa2a121217 Xcode maintenance:
libxar is no longer weak-linked.
Removing undefined copy copies. Maybe they were icons?
Name the copy frameworks as "Copy Frameworks"
2014-07-18 13:47:26 -06:00
C.W. Betts 5a3fd1e12a Indenting code. 2014-07-18 13:31:54 -06:00
C.W. Betts cb19fe8864 Use some 10.10-specific APIs to remove the quarantine attribute. 2014-07-18 13:28:20 -06:00
C.W. Betts fb206d9f71 Use the system-available quarantine string to get the quarantine metadata attribute. 2014-07-18 13:03:31 -06:00
Jake Petroules 83c93809c4 Merge pull request #379 from sononum/master
avoid attempt to insert nil object into dictionary
2014-07-15 13:44:30 -04:00
Ulrich Zurucker b95f5bc83c avoid attempt to insert nil object into dictionary 2014-07-15 13:14:04 +02:00
grahammiln 35efebf76f Add Travis continuous integration support
Adding configuration file and extending makefile to support
http://travis-ci.org.
2014-07-14 14:50:49 +02:00
Jake Petroules cca13834ca Merge pull request #374 from MaddTheSane/patch-1
Update Autoupdate-Info.plist
2014-07-09 22:48:39 -04:00
MaddTheSane c36aee449d Update Autoupdate-Info.plist 2014-07-09 20:45:54 -06:00
Kornel Lesiński 2d15514466 Updated changelog 2014-07-10 00:28:22 +01:00
Kornel 2471a5f05d Merge pull request #368 from sparkle-project/autolayout
Rely on autolayout
2014-07-09 12:39:41 +01:00
Kornel d61e0d57a9 Merge pull request #373 from 1024jp/japaneseLocalization
Update Japanese localization
2014-07-09 12:38:57 +01:00
1024jp 7dc42eb6ea Update Japanese localization 2014-07-09 00:43:49 +02:00
Kornel 59114fb9dc Merge pull request #372 from MaddTheSane/addGreek
Include the Greek localization.
2014-07-08 17:53:40 +01:00
C.W. Betts 8f73838fa0 Include the Greek localization. 2014-07-08 10:32:01 -06:00
Kornel Lesiński fce6957a66 RSS-y Accept header
Fixes #284
2014-07-07 02:46:57 +01:00
Kornel Lesiński def8cfa1ff Whitespace-only clang-format changes 2014-07-07 02:25:04 +01:00
Kornel Lesiński 99df53ba96 Since it’s awakeFromNib, it won’t hurt to remove the view
#369
2014-07-07 02:05:45 +01:00
Kornel Lesiński 77d16de08a Separate autosave names for states with/without release notes 2014-07-07 02:03:35 +01:00
Kornel e040ccfef1 Merge pull request #336 from pornel/newdsa
New DSA verification code
2014-07-07 01:55:34 +01:00
Kornel Lesiński f2ca019cb0 Rely on autolayout 2014-07-07 01:49:08 +01:00
Kornel Lesiński 336db58e96 Removed UK initials from comments 2014-07-07 00:17:30 +01:00
Kornel Lesiński 6826505d3e Apply clang-format rules 2014-07-05 01:19:42 +01:00
Kornel Lesiński 8e41993ead Rely on precompiled header 2014-07-05 01:05:03 +01:00
Kornel Lesiński 19c3d2ebf3 Removed odd self=nil assignments 2014-07-05 01:05:03 +01:00
Kornel Lesiński c9a631d2e4 Removed unused method 2014-07-05 01:05:02 +01:00
Kornel Lesiński f2cd127729 Removed unnecessary params 2014-07-05 01:04:49 +01:00
Kornel Lesiński b001a3e52e Removed unnecessary initializer 2014-07-05 01:04:49 +01:00
Kornel Lesiński c9bb1bf81c Formatting 2014-07-05 01:04:49 +01:00
Kornel Lesiński d9c287c899 Double-check SecTransformExecute return value 2014-07-03 23:50:23 +01:00
Kornel Lesiński 18d7c5f8cd Fix potential memory leak 2014-07-03 23:50:20 +01:00
Kornel Lesiński 4697623be6 Add contributors to the License.txt file 2014-07-03 23:47:30 +01:00
Zachary Waldowski 4f1cfa0d9c Amend spurious copyright notice 2014-07-03 23:47:30 +01:00
Kornel Lesiński 697a3436e5 Deleted 10.6 code 2014-07-03 23:42:30 +01:00
Zachary Waldowski ae72844847 Make SUDSAVerifier forward-compatible with Lion security 2014-07-03 23:42:30 +01:00
Kornel Lesiński 8385dfd0f4 Quicker restart 2014-07-03 20:59:00 +01:00
Jake Petroules 31ee181ad2 Enable -Wdirect-ivar-access; the codebase is now clean of this warning. 2014-07-02 18:56:47 -04:00
Jake Petroules 0e14c9ca6a Convert remaining ivars to properties to avoid direct ivar access. 2014-07-02 18:55:54 -04:00
Jake Petroules aac2a91833 Avoid direct ivar access for existing properties. 2014-07-02 18:00:39 -04:00
Kornel ce10ccd97e Merge pull request #364 from MaddTheSane/ARC
Migrate the Disk Image and piped unarchiver to ARC.
2014-07-02 12:36:06 +01:00
C.W. Betts 77a58843fe Migrate the Disk Image and piped unarchiver to ARC. 2014-07-01 20:52:50 -06:00
Jake Petroules 3b1f97a298 Move remaining private ivars to properties/implementation. 2014-07-01 22:08:13 -04:00
Jake Petroules 7e4f74af14 Move private ivars to @implementation.
Declaration of ivars in @interface is deprecated in modern runtime.
2014-07-01 22:08:13 -04:00
Jake Petroules 4ac95c9560 Re-enable -Wobjc-interface-ivars warning.
Now that we are ARC and 64-bit...
2014-07-01 22:08:12 -04:00
Jake Petroules 6d7092f10a Remove some ivars in favor of properties. 2014-07-01 22:08:12 -04:00
Kornel c209639c4d Merge pull request #362 from sparkle-project/cfError
Release cfError independently of *error
2014-07-02 02:37:46 +01:00
Kornel 9ec502f5ab Merge pull request #360 from sparkle-project/tbz2
2.5MB → 720KB
2014-07-02 02:10:12 +01:00
Kornel Lesiński 8ae0f10162 Use noErr constant of OSStatus 2014-07-02 02:06:55 +01:00
Kornel Lesiński 6b86508d38 Always release cfError 2014-07-02 02:06:55 +01:00
Kornel Lesiński 841e14e8b8 Retain delegate for duration of the function 2014-07-02 02:06:27 +01:00
Jake Petroules 2bc1de6f1f Add missing __unused attributes. 2014-07-01 20:56:42 -04:00
Jake Petroules 3604e36917 Add missing __autoreleasing attributes. 2014-07-01 20:55:44 -04:00
Jake Petroules 69f349397b Turn off some extremely tough ARC warnings. 2014-07-01 20:55:16 -04:00
Jake Petroules c778dff301 Merge pull request #361 from MaddTheSane/patch-1
Make the setTestFeedURL test run.
2014-07-01 20:47:50 -04:00
MaddTheSane 51a012896f Make the setTestFeedURL test run.
I think the test framework saw `setTestFeedURL` as a setter. This change changes it to `testSetTestFeedURL`, which will run as a test.

And for some odd reason, crashes.
2014-07-01 18:45:34 -06:00
Kornel Lesiński 66962fe8d8 Merge branch 'ARC' of https://github.com/MaddTheSane/Sparkle
* 'ARC' of https://github.com/MaddTheSane/Sparkle:
  Fix a release bug.
  Force Xcode to use spaces on source code files.
  Convert Sparkle to ARC, take three.
2014-07-02 01:31:28 +01:00
Kornel Lesiński b463afee27 Use tarball to reduce distribution size by 70% 2014-07-02 01:24:31 +01:00
Kornel Lesiński 71c7e2f9a2 -f works as || true 2014-07-02 01:13:22 +01:00
Kornel Lesiński 969622840d Added localized string comments 2014-07-02 01:12:48 +01:00
Kornel Lesiński 6910ce4413 Added missing string 2014-07-02 01:12:48 +01:00
Jake Petroules 892c5f1054 Warn if Doxygen is not installed, when building documentation. 2014-07-01 19:47:30 -04:00
Jake Petroules 84cdbbd45b Include Sparkle Test App and BinaryDelta dSYM in binary package. 2014-07-01 19:45:42 -04:00
Jake Petroules d79507b663 Update version numbers. 2014-07-01 19:35:29 -04:00
Kornel Lesiński ab07cda5eb Merged Allow text to expand #346 2014-07-02 00:08:13 +01:00
Kornel f4e0fceeac Merge pull request #349 from sparkle-project/holydeletedcodebatman
Closures instead of temp dictionaries
2014-07-01 23:56:25 +01:00
Kornel Lesiński 9344928872 Updated changelog 2014-07-01 23:33:23 +01:00
Kornel Lesiński 5b123215ed Fixed whitespace in xcodeproj, applied sort-Xcode-project-file.sh 2014-07-01 02:57:37 +01:00
Kornel 2bebf0f2d1 Merge pull request #353 from sparkle-project/clang-format
Clang format
2014-07-01 02:56:19 +01:00
Jake Petroules 4a1eddadf2 Fix corruption of Xcode project caused by last merge. 2014-06-30 21:37:36 -04:00
Kornel 19473aae5e Merge pull request #351 from sparkle-project/doxygen
Documentation
2014-07-01 02:17:53 +01:00
Jake Petroules e0a1bbbac5 Convert normal comments to doc comments in SUUpdater/SUUpdaterDelegate.
Documentation will now show up for these classes in the Xcode sidebar
and in generated Doxygen documentation.
2014-06-30 21:16:29 -04:00
Jake Petroules ebf9a8172a Fix some Doxygen warnings. 2014-06-30 21:16:29 -04:00
Jake Petroules 676b713df0 Add a target to build Sparkle API documentation using Doxygen. 2014-06-30 21:16:28 -04:00
Kornel Lesiński b26bfeba0e Localize "The update is improperly signed."
#294
2014-07-01 02:13:24 +01:00
C.W. Betts 1c5523ed83 Merge branch 'master' into ARC 2014-06-30 19:09:40 -06:00
C.W. Betts 2acc9114e4 Force files modified via Xcode to use spaces. 2014-07-01 02:04:23 +01:00
C.W. Betts b87a89c24d Fix a release bug. 2014-06-30 19:03:26 -06:00
C.W. Betts 5106d7010a Merge branch 'master' into ARC 2014-06-30 18:58:55 -06:00
C.W. Betts 1a968424db Force Xcode to use spaces on source code files. 2014-06-30 18:57:01 -06:00
Kornel Lesiński 344433d468 Change brace style to Linux 2014-07-01 01:47:42 +01:00
C.W. Betts 000c4a9832 Merge branch 'master' into ARC 2014-06-30 18:34:24 -06:00
Kornel Lesiński 4e972c997c Use constant for queue identifier 2014-07-01 00:29:39 +01:00
Kornel Lesiński 55a7ca5b9c Removed unused synchronous installation 2014-07-01 00:27:17 +01:00
Kornel Lesiński bf9ba560f0 Use closure instead of info dict 2014-07-01 00:27:11 +01:00
Jake Petroules 2a2eef97a9 Add .clang-format configuration file for source code formatting. 2014-06-30 17:23:41 -04:00
Jake Petroules 0e68e5e590 Use asset catalogs and add more Retina-compatible icon sizes to ICNS. 2014-06-30 17:23:18 -04:00
Jake Petroules dedae6e626 Make Sparkle README icon 96x96 to display properly on Retina. 2014-06-30 17:22:25 -04:00
Jake Petroules b96a37f922 Silence warnings that only seem to be appearing due to a compiler bug. 2014-06-29 23:23:50 -04:00
Jake Petroules f3ed1fafe3 Use new operatingSystemVersion API when available. 2014-06-29 23:17:32 -04:00
Jake Petroules 3f829bd49c Clean up Xcode configuration.
Make use of inheritance by applying ConfigCommon to the root node and
move all UI-applied settings into xcconfig for easier management.
2014-06-29 23:02:35 -04:00
Jake Petroules 72d8e4e5a6 Add Xcode and Makefile targets to build a Sparkle release package.
Use `make release` to build Sparkle and create a Sparkle-VERSION.zip,
ready for upload.
2014-06-29 22:38:36 -04:00
Jake Petroules 5d0fa33725 Fix output encoding in localizable strings Makefile target. 2014-06-29 21:35:26 -04:00
Jake Petroules 6c9f27106f Make the repository significantly more organized.
Now everything is not pretty much all in one directory.
2014-06-29 21:27:33 -04:00
Kornel Lesiński b9b24be4bb Allow text to expand 2014-06-30 01:11:19 +01:00
Kornel Lesiński 1dd1fe44e1 Use single line mode on textfield that AutoLayout can’t wrap 2014-06-30 01:10:53 +01:00
Kornel Lesiński a7f5217f3d Added window autosave identifier
Fixes #52
2014-06-30 00:06:57 +01:00
Jake Petroules eb0411fb51 Restore original Sparkle icon.
This reverts: 984aac852f,
93ebf843c2,
8d2054e62a,
1325d3fe40,
2579f2c3a3,
and partially reverts 6ca5c3a337.

This icon belongs to a third party and should never have been merged.
2014-06-29 18:21:30 -04:00
Kornel e2674a7549 Merge pull request #344 from MaddTheSane/staticFix
Fix a bug pointed out by the Static Analyzer.
2014-06-29 22:50:50 +01:00
C.W. Betts b000517983 Fix a bug pointed out by the Static Analyzer. 2014-06-29 15:27:32 -06:00
Kornel 268c2c9bab Merge pull request #337 from pornel/autolayout
Switched SUUpdateAlert.xib to AutoLayout
2014-06-29 21:40:46 +01:00
Kornel Lesiński f464382475 Copied align to other XIBs 2014-06-29 21:38:31 +01:00
C.W. Betts 7a3890c9c0 Remove the left alignment on the description text. 2014-06-29 21:30:47 +01:00
Kornel Lesiński 73ecd41dae Switched SUUpdateAlert.xib to AutoLayout 2014-06-29 21:30:47 +01:00
Kornel 20fc16a7d5 Merge pull request #340 from sparkle-project/publicidentifiers
Keep old namespace and framework's bundle ID for backwards compatibility
2014-06-29 21:18:06 +01:00
Kornel Lesiński 6159e77565 Keep old namespace and framework's bundle ID for backwards compatibility
Partial revert of f916f2e723
2014-06-29 20:35:50 +01:00
Jake Petroules 20a8ffd955 Prefer real constants to preprocessor defines. 2014-06-29 03:01:43 -04:00
Jake Petroules 444809da92 Force feedURL/setFeedURL to be called on the main thread.
This is better than relying solely on documentation.
2014-06-29 02:54:45 -04:00
Jake Petroules 8c805970fb Don't crash if defaultName/defaultsDomain is nil. 2014-06-29 02:03:49 -04:00
Jake Petroules 70046f6e07 Quiet Clang static analyzer. 2014-06-29 01:19:03 -04:00
Jake Petroules 964587274c Add old release notes to change log. 2014-06-29 00:58:28 -04:00
Jake Petroules 44d544cf5a Link to Foundation and AppKit instead of Cocoa.
No need to pull in a CoreData dependency.
2014-06-29 00:33:17 -04:00
Jake Petroules 91f5d0125c Perform some Objective-C modernizations. 2014-06-29 00:25:35 -04:00
Jake Petroules cf4ab0d8e6 Remove trailing whitespace in source code files. 2014-06-29 00:08:52 -04:00
Jake Petroules 39db8e1dc6 Replace references to Mac OS X with OS X as the OS is now called. 2014-06-29 00:08:52 -04:00
Jake Petroules 04c8a23f2d Line wrap LICENSE in a sane manner, update. 2014-06-29 00:08:52 -04:00
Jake Petroules fa4daa0569 Update .gitignore; contents.xcworkspacedata need not be ignored. 2014-06-28 23:35:56 -04:00
Jake Petroules 8cd2241fed Silence useless warnings in test product. 2014-06-28 23:29:36 -04:00
Jake Petroules 1334414d2e Rename finish_installation to Autoupdate for consistency. 2014-06-28 23:29:36 -04:00
Jake Petroules 2049c95770 Add an aggregate target to easily build everything. 2014-06-28 23:11:16 -04:00
Jake Petroules d537efcf9b Remove unused file. 2014-06-28 23:01:34 -04:00
Jake Petroules f916f2e723 Replace references to andymatuschak.org with sparkle-project.org. 2014-06-28 22:58:12 -04:00
Jake Petroules 4ca9ba1ce3 Enable as many warnings as possible.
The codebase now compiles cleanly with -Wall -Weverything, minus a few.
2014-06-28 22:47:22 -04:00
Jake Petroules df6dc14ace Silence all warnings in bsdiff/bspatch.
Warnings should not be enabled for third party code.
2014-06-28 22:46:55 -04:00
Jake Petroules f8b0f2c5b7 Fix warnings. 2014-06-28 22:40:44 -04:00
Jake Petroules 8c94f4bb2d Explicitly mark unused parameters. 2014-06-28 22:40:17 -04:00
Jake Petroules 8ec5f0ca3c Avoid variable-length arrays in C. 2014-06-28 21:17:37 -04:00
Jake Petroules 2f16e3f526 Fix warning about explicitly synthesizing properties. 2014-06-28 21:15:11 -04:00
Jake Petroules a80eeedaeb Add missing header to fix warnings.
Otherwise, SUHost is only forward declared in this context.
2014-06-28 21:14:45 -04:00
Jake Petroules 08bc0d574e Fix use of potentially uninitialized variables. 2014-06-28 21:13:31 -04:00
Jake Petroules c015f5e968 Don’t attempt to return from a void method. 2014-06-28 21:12:54 -04:00
Jake Petroules 76d5480313 Add missing parameter types. 2014-06-28 21:12:21 -04:00
Jake Petroules 135bcb483e Let the compiler know that SULog is a format function.
This allows it to warn properly on malformed format strings.
2014-06-28 21:11:43 -04:00
Jake Petroules e2854d3a29 Add explicit casts for type conversions.
The +0 and >>0 in SUDSAVerifier are present for readability;
the compiler is more than capable of optimizing them into nothing.
2014-06-28 21:10:53 -04:00
Jake Petroules ef5a0a997d Make string constants static as they are not used outside the translation unit. 2014-06-28 21:08:49 -04:00
Jake Petroules 74158c6da9 Add missing extern declaration. 2014-06-28 21:08:08 -04:00
Jake Petroules e5d0015185 Don’t compare floating point values with == 2014-06-28 21:07:23 -04:00
Jake Petroules d390a58f72 BOOL is a signed char; make sure it’s only ever YES or NO, not in [2, 255]. 2014-06-28 21:04:57 -04:00
Jake Petroules 435f89c11f Replace id with specific types where appropriate. 2014-06-28 21:02:33 -04:00
Jake Petroules 9984eb9ba3 Remove unused exception parameters. 2014-06-28 21:00:14 -04:00
Jake Petroules 89f5c6eb4b Add __attribute__((noreturn)) to hint for compiler optimizations.
exit() logically guarantees the method will never return;
this attribute allows the compiler to optimize for this case.
2014-06-28 20:58:14 -04:00
Jake Petroules 9c787a08aa Remove trailing semicolons. 2014-06-28 20:55:48 -04:00
Jake Petroules 88bc70cb9a Silence sign conversion warnings in third party code. 2014-06-28 20:37:38 -04:00
Jake Petroules 7262555d72 Silence CSSM warnings in SUDSAVerifier. 2014-06-28 20:35:58 -04:00
Jake Petroules 1ce94b8e2f Xcode project: set organization name and class prefix. 2014-06-28 19:48:30 -04:00
Jake Petroules a62180b3ac Fix memory leak. 2014-06-28 19:42:59 -04:00
Jason Lee e7b7094372 zh-CN translate "Learn More" button 2014-06-28 23:44:23 +01:00
Kornel Lesiński e17d55146d Fixed potential CFRelease of NULL, code style fixes 2014-06-28 23:38:27 +01:00
Sam Deane 98e5959461 If the downloaded update fails the code signing check, log out some more detailed information to help with diagnosing the problem. 2014-06-28 23:26:12 +01:00
Kornel 06a897ed03 Merge pull request #39 from pornel/Xcode5xibs
Migrate xibs to Xcode 5
2014-06-28 23:19:41 +01:00
Kornel 2348532907 Merge pull request #335 from pornel/master
Finish moving all informal protocols to formal protocols.
2014-06-28 21:40:58 +01:00
Kornel Lesiński 98cde3310d Updated README 2014-06-28 21:27:44 +01:00
C.W. Betts 66b734322d Merge branch 'master' into ARC 2014-06-28 13:22:54 -06:00
C.W. Betts bb990ad172 Finish moving all informal protocols to formal protocols.
Fix improperly-named protocols.
2014-06-28 13:19:27 -06:00
C.W. Betts d33cc1efd6 Migrate the SUUpdateAlert xibs to Xcode 5. 2014-06-28 11:26:16 -06:00
C.W. Betts 1eedc27e5f Convert the xibs to Xcode 5.1 format.
The SUUpdateAlert wasn’t migrated in this commit because of the autolayout branch.
2014-06-28 11:24:26 -06:00
Kornel Lesiński 133a701d24 Remove option to install unverified updates 2014-06-25 02:04:41 +01:00
C.W. Betts 2459733d26 Remove unused autorelease pool class usage.
Do we even still use the BinaryDelta tool?
2014-06-22 19:07:43 -06:00
Kornel Lesiński 0585a22f07 Reflect version requirement in sample appcast 2014-06-22 19:41:36 +01:00
Kornel Lesiński 07a6893e1f Release 1.7 2014-06-22 19:05:01 +01:00
C.W. Betts 93e339f32e Convert Sparkle to ARC, take three. 2014-06-20 13:26:39 -06:00
C.W. Betts 4b119a1eed Use more Blocks/libdispatch code. 2014-06-20 11:27:09 -06:00
C.W. Betts c2c94bdb1f Replace NSAutoreleasePool classes with Autorelease Pool blocks.
They’re faster, even if they’re used outside of ARC.
Use dispatch functions to spin off new threads.
Update the Binary Delta tool's class to be better.
2014-06-20 10:51:03 -06:00
C.W. Betts d14e89ef53 We don’t need the NSAppKitVersionNumber10_[456] defined.
First, we don’t use them. Second, they should be defined since we’re targeting 10.7 and later, with at least the 10.9 SDK.
2014-06-19 19:09:41 -06:00
C.W. Betts 7bd4e56cd5 We don’t need to declare ivars in the interface block if they are only accessed via accessors.
This is only true because we’re targeting x86_64 on OS X. The same is true for all iOS architectures, but not i386 on OS X.
Use CFBridgingRelease in a few places: it acts just like [(id)CFMakeCollectable(obj) autorelease] on non-ARC code, but is a bit cleaner.
2014-06-19 15:32:20 -06:00
C.W. Betts 8577ed8953 Many changes:
Getting rid of unneeded parentheses.
Remove more pre-10.7-only code.
Add comments.
More property declarations.
Make SUUpdatePermissionPromptDelegateInformalProtocol a protocol with the name SUUpdatePermissionPromptDelegateProtocol.
2014-06-19 15:02:04 -06:00
C.W. Betts 7b8fd7c097 Remove pre-10.7 code. 2014-06-19 13:06:55 -06:00
C.W. Betts cb15481e88 Restore setAutomaticallyDownloadsUpdates: to the SUUpdater header as a property. 2014-06-19 12:55:47 -06:00
C.W. Betts efa8447b1f Fix an over-release bug. 2014-06-18 13:55:52 -06:00
C.W. Betts e140353ed5 Refer to frameworks/libraries via their SDK versions, as opposed to the system ones.
Rename “Apple Frameworks and Libraries” to just “Frameworks” so newly added frameworks are added there.
2014-06-18 10:37:30 -06:00
Kornel Lesiński d6316b6d9c Modern if syntax ;)
astyle -t -o -O -c -xM -z2 -U -j -H *.[mhc]
2014-06-17 20:48:00 +01:00
Kornel Lesiński b0c9c31dc1 Modern syntax 2014-06-17 20:48:00 +01:00
Zachary Waldowski 9d03d79ca7 Replace use of antiquated ProcessInformationCopyDictionary. 2014-06-17 00:54:52 +01:00
Zachary Waldowski 519dccf64b Replace deprecated Gestalt. 2014-06-17 00:54:08 +01:00
Zachary Waldowski 1392f5155a Replace deprecated GetProcessForPID. 2014-06-17 00:53:57 +01:00
Zachary Waldowski 76ce31f2f6 Replace use of -performSelector:withObject: 2014-06-17 00:53:21 +01:00
Kornel Lesiński f46d7b5c1e Version bump 2014-06-17 00:47:56 +01:00
Kornel Lesiński d94c316583 Dropping 10.6 2014-06-17 00:47:56 +01:00
Kornel Lesiński c97a0462ae xctest 2014-06-17 00:47:14 +01:00
C.W. Betts a62db7348d Fix the XCTest build project.
The extension was set to octest; it should have been xctest.
2014-06-15 20:21:07 -06:00
Kornel Lesiński bd77daac35 XCTest 2014-06-13 01:39:53 +01:00
Andrew Madsen b41165e2e2 Added tests for comparisons of X.Y.Z.Build# style version numbers. 2014-06-13 01:35:57 +01:00
Andrew Madsen 49c622b36b Removed redefinition of DEBUG from SUUpdater.h, which broke our use of #ifdef DEBUG in multiple places in our code. Grr... 2014-06-13 01:35:57 +01:00
Michael Gorbach 2d33235886 Get rid of Sparkle’s custom binary stripping settings, since they were causing trouble with repeated compilations generating errors. Instead, we can rely on NNW’s Copy Phase for the Sparkle framework to strip symbols as needed. 2014-06-13 01:35:57 +01:00
Kornel Lesiński 2aa4899efd Tested Xcode 6b 2014-06-13 01:35:57 +01:00
Kornel a0f368823b Merge pull request #30 from dyremeen/master
Added localization for nb
2014-06-11 11:14:50 +01:00
Dyre Meen afec652729 Added localization for nb 2014-06-11 11:21:37 +02:00
Kornel 0ae81e3c05 Merge pull request #25 from GabrielUlici/master
Updated the Romanian Translation and added some mac models to the SUModelTranslation.plist
2014-06-02 00:51:00 +01:00
Gabe 90d319cb02 updated a string in ro.lproj/SUUpdateAlert.xib and arranged the layout
of it.lproj/SUUpdateAlert.xib
2014-06-01 23:53:41 +02:00
Gabe 4ffb2d2361 updated iMacs, MacBooks and MacBooks Air 2014-06-01 15:01:40 +02:00
Gabe e8508a4a66 Romanian Translation Updated 2014-05-27 22:12:27 +02:00
Kornel Lesiński a5b92c2008 Rename scripts 2014-05-21 23:13:29 +01:00
Kornel Lesiński d7185de470 Add error handling to sign_update 2014-05-21 23:13:29 +01:00
Kornel Lesiński 0c1eca9f82 Dehipsterify sign_update 2014-05-21 23:13:00 +01:00
Kornel Lesiński 88de072950 Show priv key in Finder 2014-05-21 22:22:05 +01:00
Kornel Lesiński 5efef76004 Abort on any error 2014-05-21 22:22:05 +01:00
Kornel Lesiński 95eb6456e3 Don’t use temp file 2014-05-21 22:22:04 +01:00
Kornel Lesiński 4cbffd02e3 Increase key size
Fixes #23
2014-05-21 22:21:49 +01:00
Kornel Lesiński 47a4978e6a Secure keys’ permissions 2014-05-21 22:18:23 +01:00
Kornel Lesiński 0400bc4d66 Less hipster generate_keys 2014-05-21 22:18:03 +01:00
Kornel Lesiński e1ef953067 Removed unused notifications
Fixes #18
2014-04-27 19:04:40 +01:00
Kornel Lesiński bfa28948f0 BinaryDelta using fileSystemRepresentation instead of UTF8Strings for paths 2014-04-27 18:44:05 +01:00
Kornel Lesiński 409b35c20f Changelog 2014-04-25 23:22:59 +01:00
porneL aa92d572dd Removed MIME hack 2014-04-25 23:22:59 +01:00
Antonin Hildebrand f1d3e4dd7f fix warnings
Conflicts:
	SUAppcastItem.h
	SUUpdater.h
2014-04-25 16:48:59 +01:00
Kornel 8a45304d55 Merge pull request #16 from tamasprezi/master
Fixed typo that caused crashes in BinaryDelta
2014-04-22 15:08:38 +01:00
Tamas Lustyik f56a6025a0 Fixed typo that caused crashes in BinaryDelta 2014-04-22 15:32:44 +02:00
Kornel Lesiński 805447d748 Removed archive password prompt 2014-04-12 15:18:57 +01:00
Rudy Richter cdfd506cc0 turn on generation of debug symbols since they’re needed in order to generate a dSYM 2014-04-12 15:14:46 +01:00
Antonin Hildebrand 90098dae5a define correct dependencies on locale scripts 2014-04-12 15:14:46 +01:00
C.W. Betts 3148182f1b Remove pre-10.6-specific code. 2014-04-08 18:36:56 -06:00
MaddTheSane 31172f61f9 Remove duplicate interface definitions. 2014-04-07 23:34:42 -06:00
C.W. Betts d35a68f5be We are explicitly targeting Mac OS X 10.6 and later:
We don’t need to check to see if some code signing functions are available: they should be available already.
TODO: check to see when xar was added.
2014-04-07 23:11:15 -06:00
C.W. Betts 6745346f1d Include C headers, import Objective C headers. 2014-04-07 23:08:19 -06:00
Kornel 1ab5de851f Merge pull request #12 from vincedev/master
Make SUStandardVersionComparator.h accessible
2014-04-04 21:50:39 +01:00
Vincent CARLIER 358933f965 SUStandardVersionComparator.h is included in Sparkle.h 2014-04-04 20:55:55 +02:00
Vincent CARLIER a60255c95c SUStandardVersionComparator.h is make public 2014-04-04 20:55:12 +02:00
Kornel 2c54ec012d Merge pull request #9 from armadsen/master
(Re)fixes bug where URLs are naively double escaped.
2014-03-13 20:07:07 +00:00
Andrew Madsen b671c6bef6 (Re)fixes bug where URLs are naively double escaped. See https://github.com/andymatuschak/Sparkle/commit/00b67269d69f311ce4dcc39437f1d8ac1825b383 for original fix. 2014-03-13 11:42:19 -06:00
C.W. Betts 6f24f56f0d Move SUStatusController to Objective C 2 getters and setters. 2014-03-02 14:53:21 -07:00
Kornel Lesiński 59f9e0ee1b Sorted Xcode config 2014-03-01 14:19:27 +00:00
Kornel Lesiński ac7fd917d3 Removed Elgato-specific code 2014-02-17 23:07:13 +00:00
Kornel Lesiński 53f0f4f9ee Deleted redundant strings files 2014-02-17 22:58:07 +00:00
Kornel Lesiński 55c57abd2f Deleted untranslated strings files 2014-02-17 03:58:12 +00:00
Kornel Lesiński 006e71fa89 Removed junk comment from strings files 2014-02-17 03:57:43 +00:00
Kornel c6d47ed68d Merge pull request #3 from MaddTheSane/master
Fix a bug
2014-02-12 09:53:15 +00:00
MaddTheSane fd906d9589 The checkTimer Invar should have been retained. 2014-02-11 23:42:52 -07:00
Kornel 3e6431f94d Merge pull request #2 from MaddTheSane/master
More Objective C @properties
2014-02-10 14:55:44 +00:00
C.W. Betts 4a015ada8f Remove redundant semicolon. 2014-02-09 15:58:13 -07:00
C.W. Betts 2c1b3783e4 Use for… in… Objective C enumeration where possible. 2014-02-09 14:52:32 -07:00
C.W. Betts 808bde2699 Use dot notation in NTSynchronousTask.
Change the getter for the done ivar to isDone.
2014-02-09 14:46:26 -07:00
C.W. Betts fde6b4775e Move the NTSynchronousTask class to Objective C properties. 2014-02-09 14:40:11 -07:00
C.W. Betts 92bafa92bf Make SUAppcastDelegate a formal protocol.
Synthesize more Objective C getters and setters using Objective C properties.
2014-02-09 14:25:02 -07:00
Kornel Lesiński 7e2d4b019e Fixed unit test bundle identifier 2014-02-08 22:11:47 +00:00
C.W. Betts 10b8872afb Removed an unused variable. 2014-02-02 21:15:16 -07:00
MaddTheSane d4d984f42c Merge pull request #1 from pornel/master
Merge
2014-02-02 20:13:23 -08:00
C.W. Betts bd98b33e25 Use more modern Objective C syntax. 2014-02-02 15:56:05 -07:00
C.W. Betts 79f447d537 Use Objective-C properties for the SUAppcastItem class. 2014-02-02 15:44:20 -07:00
Kornel Lesiński a4759c871e Removed 10.4 code 2014-02-02 22:18:34 +00:00
Kornel Lesiński a3b9a74fe1 Disable plug-ins in release notes WebView 2014-02-02 21:25:45 +00:00
Kornel Lesiński faba759574 Avoid setting useless private font family name in the WebView 2014-02-02 21:25:41 +00:00
C.W. Betts 91800e3036 Quiet protocol warnings. 2014-02-02 14:22:55 -07:00
C.W. Betts d7dbbe4bb9 Implementing formal protocols for most Sparkle delegates. 2014-02-02 14:15:28 -07:00
Kornel Lesiński 2579f2c3a3 Holy megabyte icon, Batman! 2014-02-02 19:41:24 +00:00
Kornel Lesiński 01e9bd82be Use preprocessor config instead of cflags
Newer terminology for relaunch.
Fail if finish_install tool name not defined.
2014-02-02 17:30:49 +00:00
Kornel Lesiński d34d2853f6 Configurable name for finish_installation.app 2014-02-01 17:27:27 +00:00
Kornel Lesiński fd1ffce3e2 Version bump 2014-02-01 17:27:17 +00:00
Kornel Lesiński 6ae7b68659 Trimmed config further 2014-02-01 13:32:12 +00:00
Kornel Lesiński 54dc6d0071 Converted old NIBs to XIB 2014-02-01 12:41:36 +00:00
Kornel Lesiński a773ac5856 Enabled all translations 2014-02-01 12:24:40 +00:00
Kornel Lesiński 686c87242c Removed code for 10.4 2014-02-01 11:58:25 +00:00
Kornel Lesiński f2eaaeb4a3 Fixed XIB layout issue
Changed XIBs to support at least 10.6
2014-02-01 10:45:05 +00:00
Kornel Lesiński 5676acaebc Removed duplicate/irrelevant config 2014-02-01 10:45:05 +00:00
Kornel Lesiński 0055adcc52 Merge update zh_CN #259
* pull/259/head:
  update zh_CN

Conflicts:
	zh_CN.lproj/SUAutomaticUpdateAlert.strings
2014-02-01 02:26:09 +00:00
Kornel Lesiński ad518eb209 Merge pt-BR L10n polishing #274
* pull/274/head:
  pt-BR localization polishing

Conflicts:
	pt_BR.lproj/Sparkle.strings
2014-02-01 02:19:41 +00:00
Kornel Lesiński 20100c283f Merge remote-tracking branch 'pull/277/head'
* pull/277/head:
  Updated the Romanian translation

Conflicts:
	Sparkle.xcodeproj/project.pbxproj
2014-02-01 02:17:47 +00:00
Kornel Lesiński fc88f94d5d Merge remote-tracking branch 'pull/287/head'
* pull/287/head:
  Select Korean and Slovak for Sparkle.strings localization
2014-02-01 02:15:50 +00:00
Kornel Lesiński 222ab3edd9 Merge remote-tracking branch 'pull/290/head'
* pull/290/head:
  finish_installation.app and pkg files will not removed when we use *.pkg installer and restart system in the installer.
2014-02-01 02:15:22 +00:00
Kornel Lesiński 4b831a1394 Merge remote-tracking branch 'pull/292/head'
* pull/292/head:
  add a return type to the -init methods to satisfy a warning for missing-method-return-type
2014-02-01 02:13:53 +00:00
Kornel Lesiński bdc45d7e47 Prevent catastrophic data loss when finish_installation.app is not present for any reason #295
* pull/295/head:
  Quiet a warning caused by using a non-constant template format string.
  Take care not to attempt copying the finish_installation.app unless we have actually succeeded in locating it. In the strange scenario that the finish_installation.app was not present in the Sparkle bundle, the target path was evaluated as being the host app's Application Support folder itself, and Sparkle would proceed to completely wipe out the host's Application Support folder as it tried to copy the non-existent

Conflicts:
	SUUIBasedUpdateDriver.m
2014-02-01 02:13:03 +00:00
Kornel Lesiński 6ca5c3a337 Updated README 2014-02-01 01:10:08 +00:00
porneL 4ab8fd1010 Added NSURLDownloadDelegate declarations 2014-02-01 00:50:45 +00:00
Kornel Lesiński 3f40f444db Warnings-- 2014-02-01 00:50:45 +00:00
Kornel Lesiński f1d5103a07 10.6 deployment target 2014-02-01 00:50:45 +00:00
Kornel Lesiński 890f1fb393 Fixed format argument 2014-02-01 00:31:43 +00:00
Kornel Lesiński d7993257fe Merge remote-tracking branch 'origin/quiet-automatic-update'
* origin/quiet-automatic-update:
  Allow manual checks when an install on quit update is pending
  Allow the delegate to trigger a silent install and relaunch
  Support silent relaunches
  Increment the sudden termination counter if installing on quit
  Set up install on quit for critical automatic updates too
  Updating Sparkle.strings for the new, more strongly worded strings that are displayed for a 'critical update'
  Prompts the user to update after a week (rather than a day) if he doesn't quit the app.
  Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag
  Fixed a no-autorelease-pool leak.
  We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them.

Conflicts:
	SUBasicUpdateDriver.m
	en.lproj/Sparkle.strings
	finish_installation.m
2014-02-01 00:31:23 +00:00
Kornel Lesiński c99378c170 Xcode 5.1 config check 2014-01-31 23:31:46 +00:00
Kornel Lesiński 00d8b64b41 Ignore DerivedData 2014-01-31 23:31:45 +00:00
Kornel Lesiński 6a79789d32 Convert all strings files to UTF-8 (UTF-16 must die) 2014-01-31 23:31:45 +00:00
Kornel Lesiński ec8f46af91 Merge branch 'vslavik'
* vslavik:
  Disable -Werror in release builds.
  Another Werror to remove
  Need to turn this -Werror off too
  Build only active ARCH (at Xcode5 suggestion)
  Clang errors when format strings expected but aren’t provided
  Setting Deployment Target 10.7 globally
  Removing unneeded GC configurations
  Removing GC target
  remove SDK

Conflicts:
	Configurations/ConfigFrameworkReleaseGCSupport.xcconfig
	SUUIBasedUpdateDriver.m
	Sparkle.xcodeproj/project.pbxproj
2014-01-31 23:26:08 +00:00
Brian Webster 2ae8248c35 Removed redundant method declaration 2014-01-31 23:20:56 +00:00
Brian Webster d9d3ff2a8e Fixed pt_BR strings file encoding 2014-01-31 23:20:56 +00:00
Nate Weaver b420ad65be Wrap AuthorizationExecuteWithPrivilegesAndWait in pragmas to ignore deprecated functions.
I feel dirty.
2014-01-31 23:20:56 +00:00
Jorge Leandro Perez 5504d6896f Fixes static analyzer warnings 2014-01-31 23:20:47 +00:00
Jorge Leandro Perez d888705fd8 Enables Skip Install flag 2014-01-31 23:20:32 +00:00
Doug Russell 8d1109b59f Disable turkish localization because xcode believes it is corrupted 2014-01-31 23:19:11 +00:00
Kornel Lesiński 25aca9f56f Merge branch 'blackpixel'
* blackpixel:
  Fixed issue with icon
  New icon
  Updated icon.
  Switched the icon to be representative of the app. We'll want to find a better way of doing this once we have multiple apps pointed at this repo.
  fixed a 'content rectangle not entirely onscreen' warning
  updated sends system profile to use info.plist if user defaults key isn't present
  Support for notifications on some updater events
  Fix warnings
  fixed the Debug App Store configuration.. it was misnamed and causing a build error.
  fixing up the xcode configs to match ours for simpler building

Conflicts:
	Sparkle.xcodeproj/project.pbxproj
	Sparkle.xcodeproj/xcshareddata/xcschemes/Sparkle.xcscheme
	th.lproj/Sparkle.strings
2014-01-31 23:18:25 +00:00
Kornel Lesiński e75a9b0591 Merge branch 'earthlingsoft'
* earthlingsoft:
  Set development region to English
  Fixed Bug #428216: "Update alert does not use a proper emdash"
2014-01-31 23:16:38 +00:00
Kornel Lesiński 5dfc6ab3b2 Merge branch 'MrNoodle'
* MrNoodle:
  - Was using non-nil terminated c-string resulting in a nil string being returned which caused an erroneous condition check.
2014-01-31 23:16:22 +00:00
Kornel Lesiński 76cca58776 Merge branch 'uliwitness'
* uliwitness:
  Revert "Switch off secure updates for now"
  Shut up all of Xcode's complaints.
  Don't look at error variables if result says success.
  Less warnings.
  Shut up some warnings & make build with newer Xcode.
  Less unsafety with format strings.
  Switch off secure updates for now
  Quick hack to make this build again. Should probably just move to Sparkle mainline, now that they're halfway current.
  Satisfy some overly picky compilers.
  Make this build on 10.7. Might break building on earlier OSes.
  Removed the pt_PT localization from Uli's branch, since it was largely untranslated, and used the one from master instead.
  Fixed layout of localization XIBs
2014-01-31 21:46:49 +00:00
Kornel Lesiński 7141818b31 Revert "Switch off secure updates for now"
This reverts commit 6a48420e07.
2014-01-31 21:46:11 +00:00
Vaclav Slavik 52bee98867 Disable -Werror in release builds. 2013-11-14 17:36:57 +01:00
Paul Kim b262c2b581 - Was using non-nil terminated c-string resulting in a nil string being returned which caused an erroneous condition check. 2013-10-29 11:14:03 -04:00
Daniel Jalkut 192c3b4c2d Quiet a warning caused by using a non-constant template format string. 2013-09-26 15:59:44 -04:00
Daniel Jalkut cfe375b5f3 Take care not to attempt copying the finish_installation.app unless we have actually succeeded in locating it. In the strange scenario that the finish_installation.app was not present in the Sparkle bundle, the target path was evaluated as being the host app's Application Support folder itself, and Sparkle would proceed to completely wipe out the host's Application Support folder as it tried to copy the non-existent 2013-09-26 15:58:57 -04:00
Matt Thomas 271970697e Another Werror to remove 2013-09-21 12:29:02 +02:00
Matt Thomas 1539c0c077 Need to turn this -Werror off too 2013-09-21 12:29:02 +02:00
Matt Thomas aa25194536 Build only active ARCH (at Xcode5 suggestion) 2013-09-21 12:29:02 +02:00
Matt Thomas 6ab4163957 Clang errors when format strings expected
but aren’t provided
2013-09-21 12:29:02 +02:00
Matt Thomas dfa27acde2 Setting Deployment Target 10.7 globally
(we don}t really care about PPC support, etc)
2013-09-21 12:29:02 +02:00
Matt Thomas 50c3df3a6f Removing unneeded GC configurations 2013-09-21 12:29:02 +02:00
Matt Thomas 31a49c83b5 Removing GC target 2013-09-21 12:29:02 +02:00
Matt Thomas a57eb736cb remove SDK
This will default to the current one (SDKROOT = macosx)
2013-09-21 12:29:02 +02:00
Andy Kim 52b2d75d63 Merge branch 'master' of git://github.com/andymatuschak/Sparkle 2013-09-17 18:20:42 +09:00
Andy Kim 9ea81e21b9 Set development region to English 2013-09-17 18:12:35 +09:00
Dan Schimpf eda214a3ec add a return type to the -init methods to satisfy a warning for missing-method-return-type 2013-08-30 14:51:55 -07:00
Andy Matuschak d2b7fd6236 Adding left-behind SUPasswordPrompt.xib from 048ce10 2013-08-11 09:05:36 -07:00
Takayama Fumihiko 77ce7c19e9 finish_installation.app and pkg files will not removed when
we use *.pkg installer and restart system in the installer.

In this case, "Application Support" directory is corrupted
by unnecessary pkg files.
We need to scan files under "Application Support" directory
and examine whether pkg file or not.

It is quite annoying.

Therefore, this patch changes location of
finish_installation.app and pkg files to
"~/Library/Application Support/APPNAME/.Sparkle".
Then, we can remove finish_installation.app and pkg files
certainly.
2013-08-11 16:54:38 +09:00
Andy Matuschak 048ce10ed5 Updated Danish localization courtesy Daniel Østergaard Nielsen. 2013-08-07 16:12:03 -07:00
Shon Frazier b23d4a9641 Select Korean and Slovak for Sparkle.strings localization 2013-07-26 11:06:07 -04:00
Gabe 843bbe7ece Updated the Romanian translation 2013-06-11 02:56:05 +02:00
BR Lingo a7dbe4184c pt-BR localization polishing 2013-05-23 19:23:23 -03:00
61 3287299f53 update zh_CN 2013-03-25 16:53:11 +08:00
Uli Kusterer 1b71d3ebd1 Shut up all of Xcode's complaints. 2013-03-16 16:59:02 +01:00
Uli Kusterer ef8edef094 Don't look at error variables if result says success. 2013-03-16 16:58:37 +01:00
Uli Kusterer c793adf2ed Less warnings. 2013-02-09 20:22:25 +01:00
Uli Kusterer 5cf229ba41 Shut up some warnings & make build with newer Xcode. 2013-02-09 20:19:38 +01:00
Uli Kusterer 4789ebdec5 Less unsafety with format strings. 2013-02-09 20:19:09 +01:00
Michael Ehrmann 0ed83cf9f2 Fixing issue with update as non admin user where the quarantine flag did not get correctly removed from new application 2013-02-04 08:18:49 -08:00
Michael Ehrmann c37fc01bb1 Release notes referenced by URL in updates item description field can be delivered via https:// 2013-02-04 08:18:48 -08:00
Andy Matuschak 7fae28135e Merge pull request #229 from mugginsoft/master
Hush method return type warnings when importing SUUpdater.h
2013-02-04 08:13:00 -08:00
Andy Matuschak 82c722ba37 Merge pull request #240 from ryanmaxwell/master
Correct build warnings for 3 issues - detailed in each commit
2013-02-04 08:08:40 -08:00
Ryan Maxwell aba5567a15 Fix stuffing unsigned int into int variable, causing build warning 2013-01-30 11:30:58 +13:00
Rick Fillion 1325d3fe40 Fixed issue with icon 2013-01-14 13:30:40 -05:00
Rick Fillion 8d2054e62a New icon 2013-01-14 10:03:40 -05:00
Ryan Maxwell d593a04dda Update Project file/Scheme to recommended Xcode settings 2013-01-12 14:45:10 +13:00
Ryan Maxwell 8fa758f8aa Fix "corrupted" turkish strings file 2013-01-12 14:42:50 +13:00
Ryan Maxwell 2a0d8afe4e update .gitignore 2012-12-08 14:28:08 +13:00
Andy Matuschak 3e3a11bd0f Merge remote-tracking branch 'blackpixel/warnings-pull-request'
Conflicts:
	th.lproj/Sparkle.strings
2012-12-06 18:47:02 -08:00
Doug Russell 41b2f054f8 Fixed warnings in xibs, switched to lldb and fixed occasional copy phase error from incorrect text encoding 2012-12-06 13:40:55 -08:00
Rick Fillion 93ebf843c2 Updated icon. 2012-12-05 12:57:27 -05:00
Rick Fillion 984aac852f Switched the icon to be representative of the app. We'll want to find a better way of doing this once we have multiple apps pointed at this repo. 2012-12-04 13:24:52 -05:00
Jonathan Mitchell 69c9c70d21 Add explicit method return types in header to supress warnings when including framework in projects with more exacting warnings such as -Wextra. 2012-11-27 10:20:02 +00:00
Simone Manganelli 478c7fd8cd fixed a 'content rectangle not entirely onscreen' warning 2012-11-26 13:35:42 -08:00
Andy Matuschak 243fdf8f7f Fall back on DSA-only installation checks for .pkg installations 2012-11-20 14:56:35 -08:00
Andy Matuschak 337002f421 Merge branch 'CodeSigning' 2012-11-19 17:37:53 -08:00
Andy Matuschak a7ba6a7421 Merge pull request #210 from kainjow/master
Disable row selection in system profile table
2012-11-15 23:06:33 -08:00
Andy Matuschak 7b3928db9b Fixes #222: Long version ids (12 digits based on reverse date) cause update to work no longer 2012-11-15 22:49:55 -08:00
Andy Matuschak b86770c39f Fixed unit tests for 10.8 2012-11-15 22:49:43 -08:00
Andy Matuschak f6622104bf Fixes #221: char *oldDestinationString 2012-11-15 22:40:39 -08:00
Andy Matuschak 860739fce2 Merge remote-tracking branch 'ryanmaxwell/master' 2012-11-15 22:28:47 -08:00
Jamie Pinkham 08065bc05b updated sends system profile to use info.plist if user defaults key isn't present 2012-11-15 11:46:54 -05:00
Andy Matuschak 38eb63a7a2 Updates to Turkish localization courtesy Emir Sarı 2012-11-13 09:22:51 -08:00
Ryan Maxwell f7daf04204 Update remaining english straight single ' quotes to curly ’ quotes 2012-11-10 20:10:46 +13:00
Ryan Maxwell 2350c59cc8 Update strings files to standardize ellipsis character (…) instead of three dots (…)
Also change don't to curly quote don’t in dialog.
2012-11-10 19:46:44 +13:00
Doug Russell 4eebdb82c4 Support for notifications on some updater events 2012-10-18 14:39:59 -07:00
Doug Russell 066d634ef6 Fix warnings 2012-10-18 12:20:08 -07:00
Jamie Pinkham 9e2e489109 fixed the Debug App Store configuration.. it was misnamed and causing a build error. 2012-10-18 11:07:42 -04:00
Jamie Pinkham f9c428ee06 fixing up the xcode configs to match ours for simpler building 2012-10-17 13:08:24 -04:00
Andy Matuschak 16cdd6bf64 Adding Arabic localization, courtesy Muhammad Azmi Al-Hashemi 2012-09-12 22:56:07 -07:00
Kevin Wojniak e657bcf03a Disable row selection in the system profile table by implementing the table delegate and turning off "Avoid Empty Selection", "Preserve Selection" and "Select Inserted Objects" on the array controller in the nib. 2012-09-05 10:16:33 -07:00
Andy Matuschak d138f64bd6 Fixes #198: Problem with 10.5
Implicitly linking the Obj-C runtime with the 10.7 SDK is causing us to
inadvertently reference libblocks symbols, which don't exist prior to
10.6.
2012-08-16 20:03:45 -07:00
Andy Matuschak 3c37f775fb Merge branch 'master' into CodeSigning 2012-08-15 18:14:37 -07:00
Andy Matuschak 7a283bfaeb Fixes #133: Sparkle deleting/replacing the wrong executable when it unpacks
-[SUHost installationPath] can return different values before and after
the installation is performed, because it may attempt to normalize the
installation path--but only if the normalized version of the path isn't
already present. Which it would be after the installation had completed.

Now we only compute the installation path once for the whole installation
process.
2012-08-15 18:01:35 -07:00
Andy Matuschak c1510a5bea Adding Thai localizations to the project. 2012-07-26 19:00:21 -07:00
Chotiwat Chawannakul 7a20432b1b Add Thai localization 2012-07-27 00:25:35 +07:00
Andy Matuschak 3d8be2d2da Fixed potential crasher in code signing in the case that the host application is not code signed. 2012-07-24 09:13:47 -07:00
Andy Matuschak a59e8ff958 Added kSecCSCheckAllArchitectures to the flags for code signing validation so that inactive architecture binaries are checked as well in the update. 2012-07-24 09:08:42 -07:00
Andy Matuschak 26077f47af Update to the Brazilian Portuguese localization from Victor Figueriedo 2012-07-23 17:03:59 -07:00
Andy Matuschak 118f3c5141 Merge pull request #183 from sinbad/fix-10.6-arg-list-too-long
Use NSFileManager interface for DMG unarchive only for 10.7+.
2012-07-05 18:27:47 -07:00
Andy Matuschak 22b65a3095 Making sure to initialize all Security types 2012-07-05 18:13:28 -07:00
Andy Matuschak 05c51a1c05 Merge branch 'EncryptedDiskImages' 2012-07-05 18:09:42 -07:00
Andy Matuschak 21f95465da Fixes #48: Adopt standard code signing in favor of DSA signing
Thanks to Mattt Thompson (@mattt) for tag-team-ing this with me.

With this change, if your app deploys only to 10.6+, then you can
dispense altogether with the DSA signatures on future updates to your
application: just make sure the "to" version satisfies the "from"
version's Apple code signing requirements. Most of you are probably
already doing that, and if you're not, you should be anyway.

Specifically, Sparkle validates the designated requirement of the "from"
version against the "to" version. By default, as of this writing, that
means that the bundle identifiers must be the same, and that the leaf
certificate of the signature is the same. So if you keep code signing
your app with the same cert, Sparkle will Just Work without any
additional DSA signature nonsense for you to deal with.

Traditional Sparkle DSA signatures will still be honored.

This support has only been extended to updates to the main app bundle.
If you're updating some other bundle, you will have to use DSA signatures
to secure your updates in the future.

***IMPORTANT: previously, Sparkle considered an update "safe" if both the
appcast and update were distributed over https. That is nowhere near as
strong a verification measure as code signing or the old-school DSA
signatures, so with this change, support for unsigned, https-distributed
updates has been removed. If you're targeting 10.6+, start code-signing
your apps if you haven't already, and everything will be fine. If you're
targeting earlier OS Xs, you'll need to start adding DSA signatures to
your appcasts. When you link this changed version of Sparkle into your
app, it will warn you on launch if you are not code signed and do not
have a DSA public key specified in your Info.plist.
2012-07-05 10:04:17 -07:00
Andy Matuschak ab74bdca79 Removed Japanese localization of password prompt from the Xcode project 2012-07-03 18:52:08 -07:00
Andy Matuschak 69d471aefb Allow the user to try reentering his password if authentication fails. 2012-07-03 18:51:21 -07:00
Andy Matuschak d620dc0b52 Removing Japanese localization of the password prompt, since I changed the design 2012-07-03 18:43:22 -07:00
Andy Matuschak d3f975816e Delegated password prompting to the update driver.
The SUDiskImageUnarchiver shouldn't know about UI, and besides,
it's important that update drivers which should not display UI (like
the automatically-installing and probing drivers) should not display
password prompts.
2012-07-03 18:37:50 -07:00
Steve Streeting 91ac9178f1 Use NSFileManager interface for DMG unarchive only for 10.7+. On 10.6, [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files.
The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine.
2012-06-28 13:28:30 +01:00
Andy Matuschak ae52d2743e Removed changes to the project.pbxproj that were unrelated to the password prompt 2012-06-26 18:45:41 -07:00
Andy Matuschak a4082a0e54 Redesigned password prompt UI 2012-06-26 18:44:55 -07:00
Andy Matuschak 9c8e825289 Removed methods from SUPasswordPrompt.h that didn't need to be exposed there 2012-06-26 18:43:52 -07:00
Stefan Hoffmann 9662452c09 Fixes #44: maximumSystemVersion key 2012-05-28 23:02:14 +02:00
Rudy Richter 0a3051349a remove the ASW tags since we're submitting this as a pull request to andy 2012-05-23 17:11:31 -04:00
Andy Matuschak 1c258cb690 Updating Danish localization courtesy Daniel Østergaard Nielsen 2012-05-23 09:47:43 -07:00
Rudy Richter 4ba453f337 support for encrypted disk images 2012-05-22 10:59:20 -04:00
Andy Matuschak 6960045e2b Fixes #175: Bug: update alert text collides with automatic download checkbox 2012-05-09 09:19:20 -07:00
Andy Matuschak 803925f2cf Fixes #174: Bug: sparkle:shortVersionString ignored for non-enclosure items 2012-05-09 08:49:55 -07:00
Andy Matuschak 97c71ef700 Fixes #170: An environment variable set by Sparkle 2012-05-07 19:39:31 -07:00
Andy Matuschak 595c6ce491 Merge branch 'master' into quiet-automatic-update 2012-04-28 20:38:42 -07:00
Andy Matuschak 6b7752792d Fixing some new Clang warnings from Xcode 4.4 2012-04-28 20:38:18 -07:00
Andy Matuschak b7dc2438a7 Fixes #169: Security Issue in Parsing XML using NSXMLDocument
External entities are no longer parsed in appcasts: pre-10.7, we use the
"tidy" option for XML document parsing, which happens to behave this way,
and in 10.7+ we use a new explicit option for this behavior.
2012-04-28 20:32:35 -07:00
Andy Matuschak 12904a5af6 Merge pull request #160 from mattstevens/manual-check-fix
Fix manual update checks when an automatic update is pending
2012-03-02 21:08:09 -08:00
Matt Stevens 7fc9e32ce7 Allow manual checks when an install on quit update is pending 2012-03-01 22:41:49 -07:00
Andy Matuschak 9aa3015929 Merge pull request #159 from ivira/master
Ukrainian localization
2012-03-01 18:41:46 -08:00
Vera Tkachenko 09f0c43e7c Minor fix of Ukrainian localization 2012-03-01 01:02:21 +02:00
Vera Tkachenko a570191859 Minor improvements of Russian localization: proofing and truncated button labels. 2012-02-29 23:50:21 +02:00
Vera Tkachenko d7dea30de6 Added Ukrainian localization 2012-02-29 23:07:04 +02:00
Andy Matuschak 409e7e22bf Merge remote-tracking branch 'mattstevens/delegate-auto-update' into quiet-automatic-update 2012-02-29 09:45:08 -08:00
Andy Matuschak ed456740b0 Merge branch 'master' into quiet-automatic-update 2012-02-29 09:45:01 -08:00
Andy Matuschak 8a25500eca Merge pull request #23 from tzikis/master
Greek Translation
2012-02-29 09:42:23 -08:00
Matt Stevens cdfcd1469e Allow the delegate to trigger a silent install and relaunch 2012-02-28 19:53:52 -07:00
Andy Matuschak 4c54349c23 Merge branch 'master' into quiet-automatic-update 2012-02-24 08:57:23 -08:00
Andy Matuschak 4d00e8c569 Fixes #157: Delayed relaunch not working 2012-02-24 08:55:22 -08:00
Andy Matuschak 02088e0da6 Merge pull request #156 from christianz/master
Corrected some minor spelling errors in the Norwegian Sparkle.strings
2012-02-22 08:22:55 -08:00
Christian Zachariasen f341d0c3a9 Corrected minor spelling errors 2012-02-22 12:35:42 +01:00
Matt Stevens 833081ffa9 Support silent relaunches 2012-02-16 00:42:40 -07:00
Andy Matuschak faed494d4e Merge branch 'quiet-automatic-update' of github.com:andymatuschak/Sparkle into quiet-automatic-update 2012-02-15 22:38:23 -08:00
Andy Matuschak dbebe4b3b2 Merge branch 'master' into quiet-automatic-update 2012-02-15 22:38:01 -08:00
Andy Matuschak e27828d248 Merge pull request #144 from mattstevens/custom-defaults-domain
Support a custom user defaults domain
2012-02-14 09:52:34 -08:00
Andy Matuschak 44cf0d0e51 Merge pull request #145 from mattstevens/install-on-quit-cleanup
Clean up after install on quit updates
2012-02-14 09:48:12 -08:00
Andy Matuschak 320b3aa62a Merge pull request #148 from mattstevens/silent-update-fixes
Silent update fixes
2012-02-14 09:45:01 -08:00
Matt Stevens 1d8adc8fac Increment the sudden termination counter if installing on quit 2012-02-12 21:15:57 -07:00
Matt Stevens bc458a6ab5 Set up install on quit for critical automatic updates too
Fixes the SUInstallLaterChoice for critical update prompts.
2012-02-12 21:15:57 -07:00
Matt Stevens 6be55685c8 Clean up after install on quit updates 2012-02-12 20:02:46 -07:00
Matt Stevens 29b7321094 Support a custom user defaults domain
This is useful for situations like a background app that updates a
parent preference pane but wants to maintain defaults in the background
app's domain.
2012-02-11 15:31:12 -07:00
Andy Matuschak 449b00ed3e Merge pull request #139 from mattstevens/pathToRelaunch
Host bundle is changed by pathToRelaunchForUpdater:
2012-02-08 22:37:19 -08:00
Andy Matuschak 4c2573702e Merge pull request #142 from mzch/master
Improved Japanese translations (fixes #141)
2012-02-08 22:14:25 -08:00
Koichi MATSUMOTO 88d4b348d9 Improved Japanese translations
Improved some strange translations in Japanese
2012-02-08 15:37:30 +09:00
Matt Stevens bf07a9435b Pass both host and executable paths to finish_installation
This fixes pathToRelaunchForUpdater by supporting an executable path
other than the host bundle path.
2012-02-06 22:16:25 -07:00
Andy Matuschak 799b2a381f Merge pull request #136 from ksuther/master
Xcode warning cleanup
2012-02-01 11:02:56 -08:00
Kent Sutherland 8b4cf14e53 Explicitly set the file encoding of Romanian Sparkle.strings to stop Xcode warning. 2012-02-01 13:29:25 -05:00
Kent Sutherland 515511d5e9 Adjusted initial window position of SUUpdateAlert for Romanian/Slovenian so Xcode doesn't show warnings. 2012-02-01 13:27:46 -05:00
Andy Matuschak aca8cc6fbf Renamed GC build configuration for clarity per #135 2012-01-27 08:46:46 -08:00
Andy Matuschak 1bc3834345 Fixing feature that normalizes installed app names and disabling it by default. Fixes #133. 2012-01-17 22:39:49 -08:00
Andy Matuschak 73e96cdcab Updating project for 4.2.1; changing SDK to 10.7 2012-01-17 21:51:43 -08:00
Andy Matuschak 760e32c5bd Added Slovenian localization courtesy Mojca Miklavec 2012-01-11 09:21:24 -08:00
Andy Matuschak cf1b167954 Merge branch 'master' of github.com:andymatuschak/Sparkle 2012-01-05 18:44:48 -08:00
Andy Matuschak 5ef6c64568 Fixes #129: Still need the OpenSSL license? 2012-01-05 18:44:26 -08:00
Andy Matuschak 7e05e97c95 Merge pull request #126 from dmdeller/patch-1
OpenSSL path should be globally replaced, right?
2011-12-19 11:41:27 -08:00
David Deller 5cd98c5508 OpenSSL path should be globally replaced, right?
With MacPorts OpenSSL installed, this version produces different results, which makes me nervous.
2011-12-18 11:40:58 -05:00
Andy Matuschak e6deed9c56 Merge branch 'master' into quiet-automatic-update 2011-11-18 19:17:37 -08:00
Andy Matuschak 290f64f552 Fixes #121: finish_installation deployment target is 10.6, not 10.5 2011-11-18 19:17:11 -08:00
Andy Matuschak 59caa1f300 Re-added Romanian resources with relative paths to the project. 2011-11-18 19:14:24 -08:00
Andy Matuschak 882b5c9b8a Minor layout adjustments to the Romanian localization 2011-11-18 19:11:49 -08:00
Gabriel Ulici 7ba0c583af Translated the string and xib files 2011-11-18 13:31:36 +01:00
Gabriel Ulici b275cab13f Added Romanian Localization 2011-11-18 13:30:08 +01:00
Uli Kusterer 6a48420e07 Switch off secure updates for now 2011-11-12 15:03:46 +01:00
Uli Kusterer 59f9236009 Merge remote-tracking branch 'andymatuschak/master'
Conflicts:
	pt_PT.lproj/SUAutomaticUpdateAlert.xib
2011-11-12 13:39:34 +01:00
Andy Matuschak f20c121745 No longer linking to libcrypto 2011-11-11 17:59:39 -08:00
Andy Matuschak 25040affc2 Fixes #111: Sparkle won't build due to -Werror with -Wformat=2 and missing newlines 2011-11-11 17:57:40 -08:00
Andy Matuschak 82e6250250 Merge pull request #118 from smiranda/master
Improvements to the European Portuguese localization (pt_PT)
2011-11-10 09:13:52 -08:00
Sérgio Miranda 9f2d53a3a2 Improvements to the European Portuguese localization (pt_PT) 2011-11-10 14:24:35 +00:00
Andy Matuschak ec4ebbdcfb Merging darkshadow2's changes for libcrypto -> CDSA 2011-11-09 21:34:27 -08:00
Andy Matuschak 716bb30e7c Merge branch 'master' into quiet-automatic-update 2011-11-09 21:23:18 -08:00
Andy Matuschak aeeae26d1c Critical security patch--re-enabling signature and downgrade checking.
When merging Uli Kusterer's branch, we left enabled a preprocessor flag that would disable DSA checking and downgrade prevention. That should not have been merged into master. My apologies to the community for not noticing this sooner.
2011-11-09 21:22:38 -08:00
Andy Matuschak 095d223e70 Fixes #116: Update error: Can't make a temporary directory 2011-11-09 20:53:18 -08:00
Andy Matuschak 55eed9efd8 Fixes #113: Need to check isReadableFileAtPath: when copying out DMG contents 2011-11-02 10:27:32 -07:00
Andy Matuschak d092ae9295 Resolved merge 2011-10-27 22:04:01 -07:00
Andy Matuschak 5457476e4a Fixes #109: Error extracting dmg archives 2011-10-27 21:59:45 -07:00
Andy Matuschak 5dce90eafa Merge pull request #28 from wildchocolate/master
Fixed leaks with NSFileManager
2011-10-20 08:05:26 -07:00
Brittany Tarvin 268ea201da Fixed leaks with NSFileManager 2011-10-20 09:52:02 -05:00
Brittany Tarvin 613b759077 Fixed issues that led to crashes on Mac OS X 10.7 Lion.
These fixes remove the use of the File Manager API that was causing crashes on Lion. This should resolve issue #827357. We are now using NSFileManager instead of the older File Manager API, but only on 10.6 and later. These changes should work for those targeting 10.4, but will allow users running 10.7 to still update without crashing.
2011-10-17 14:30:00 -05:00
Uli Kusterer 02e090c291 Quick hack to make this build again. Should probably just move to Sparkle mainline, now that they're halfway current. 2011-10-15 12:02:18 +02:00
Uli Kusterer f6a2e76685 Merge branch 'master' of git://github.com/andymatuschak/Sparkle
Conflicts:
	Sparkle.xcodeproj/project.pbxproj
	pt.lproj/SUAutomaticUpdateAlert.xib
	pt_PT.lproj/SUAutomaticUpdateAlert.xib
	tr.lproj/SUAutomaticUpdateAlert.xib
2011-10-11 10:19:30 +02:00
Andy Matuschak 8f5b9f03ac Updating Sparkle.strings for the new, more strongly worded strings that are displayed for a 'critical update' 2011-10-10 22:49:49 -07:00
Andy Matuschak bb682da743 Prompts the user to update after a week (rather than a day) if he doesn't quit the app. 2011-10-10 22:44:17 -07:00
Andy Matuschak bf38b0c9fd Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag
You would use this like:
<item>
    <title>My great update</title>
    ...
    <sparkle:tags>
        <sparkle:criticalUpdate />
    </sparkle:tags>
</item>

The behavior of this tag presently is: rather than waiting for the user to quit the app (or for some large amount of time to pass), the user will be prompted to install the update (with a stronger message) immediately upon its receipt. This behavior could be improved for the manual update case as well.

We can also use this new mechanism to create special behavior for e.g. paid updates.
2011-10-10 22:40:27 -07:00
Andy Matuschak e64516c089 Fixed a no-autorelease-pool leak. 2011-10-10 22:40:24 -07:00
Andy Matuschak fc725cce01 Background updates would never get scheduled when the net's down. 2011-10-10 10:29:52 -07:00
Andy Matuschak 95398cd26f Fixed a no-autorelease-pool leak. 2011-10-10 09:28:56 -07:00
Andy Matuschak b515c15f9b We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them.
With this patch, we make good on the description of that box: updates are automatically installed when the app is quit. No user intervention involved whatsoever if they checked that box.

If the user doesn't quit the app for a day after the update is downloaded, we'll show the dialog we've always used for automatically downloaded updates (Install Now / Install on Quit / Skip This Update).
2011-10-04 20:48:28 -07:00
Andy Matuschak 01e8cf90c6 finish_installation doesn't show any UI if it's not relaunching, since those installations were not kicked off by user action. 2011-10-04 20:48:09 -07:00
Andy Matuschak 7152bd0ffa Merge branch 'master' of github.com:andymatuschak/Sparkle 2011-10-03 22:55:57 -07:00
Andy Matuschak 05861e5340 Merging "ulimerge," which contains a great number of changes and contributions from Uli Kusterer, Elgato, and other contributors.
Highlights:
- appcast entries with a "new version" but without a download (paid updates, update notification for users of dropped HW)
- installation now happens in a tool, rather than in the app being replaced
- Sparkle-related logs now separated into a separate file ~/Library/Logs/SparkleUpdateLog.log for easier QA/triage
- tons of small bug fixes
- more details at https://github.com/andymatuschak/Sparkle/pull/18
2011-10-03 22:45:50 -07:00
Andy Matuschak aa853a0f0f Increased the time required before finish_installation shows a dock icon from 1.2 seconds to 5 seconds 2011-09-30 09:52:32 -07:00
Andy Matuschak a47151c638 Moved the finish_installation plist into its Xcode group 2011-09-30 09:52:32 -07:00
Andy Matuschak 06642bba20 Fix to reachability patch in 9cc1905f87 for file:// URLs, which were crashing 2011-09-30 09:42:30 -07:00
Andy Matuschak f04a460d63 Removing the SDKROOT from ConfigBinaryDelta.xcconfig so it'll use ConfigCommon's (10.6) 2011-09-30 09:29:06 -07:00
Andy Matuschak 7d4ce0daeb Actually put the archs back; that didn't get caught in the last commit. 2011-09-29 18:32:56 -07:00
Andy Matuschak a2bcd53eaa Put the deployment targets and architectures back from 950e3894b35dd8bcfc1d4d692ebc0aafdeda8e44; kept the SDK root. 2011-09-29 18:29:19 -07:00
Andy Matuschak 5a47fb64c3 Merge remote branch 'ksuther/ulimerge' into ulimerge 2011-09-29 10:29:15 -07:00
Andy Matuschak c96aa2eda8 The finish_installation tool will not relaunch the host app if it's using the "Install on Quit" functionality. 2011-09-28 18:11:43 -07:00
Vasileios Georgitzikis e30a342813 Updated Greek translation 2011-08-28 14:59:05 +03:00
Kent Sutherland 320672c1f9 Disabled skip install on finish_installation so it isn't archived by Xcode 4. 2011-08-15 12:47:27 -04:00
Uli Kusterer 0bd27c0cb7 Satisfy some overly picky compilers. 2011-08-08 04:34:45 +02:00
Kent Sutherland 436107f20e Fixed preprocessor error if DEBUG isn't defined. 2011-08-01 13:14:02 -04:00
Uli Kusterer abda56d047 Make this build on 10.7. Might break building on earlier OSes. 2011-07-31 20:04:35 +02:00
Kent Sutherland 950e3894b3 Compile for i386/x86_64 on 10.6 only. 2011-07-25 16:44:32 -04:00
Kent Sutherland 2300f2bcb0 Set the level of the update check status window to NSFloatingWindowLevel if the host application is background-only. 2011-07-25 16:44:32 -04:00
Kent Sutherland a6d776ca04 Add SUVersionDisplayProtocol to public headers of framework. 2011-07-25 16:44:32 -04:00
Kent Sutherland 76e79d6f92 Set the base configuration of finish_install to the old relaunch configuration. 2011-07-25 16:44:32 -04:00
Kent Sutherland 9cc1905f87 Use SCNetworkReachabilityCreateWithName rather than SCNetworkCheckReachabilityByName, which is deprecated. 2011-07-25 16:44:31 -04:00
Michael Nickerson 78e24a6fe6 Changed from using OpenSSL to Apple's CDSA to verify DSA signatures. 2011-07-05 20:31:36 -04:00
Andy Matuschak f1a353840a Merge pull request #19 from dmgctrl/pr_gitignore
Added gitignore to strip out Xcode cruft.
2011-06-30 19:10:29 -07:00
Jason Allum 0f34252f4a Added gitignore to strip out Xcode cruft. 2011-06-30 09:17:01 -04:00
Andy Matuschak 000a24c63b Using /usr/bin/openssl in the signing scripts instead of /usr/bin/env openssl.
Fixes bug 793221.
2011-06-13 18:47:17 -07:00
Andy Matuschak 32d4f249d4 Added a new Info.plist key: SUPromptUserOnFirstLaunch. Set this to YES to disable Sparkle's usual behavior of waiting 'till the second launch of an app to prompt for update permission.
This is useful for apps which don't, under normal operations, get quit. Like a menu extra.
2011-05-26 18:52:24 -07:00
Andy Matuschak 96272fce7d Removed the pt_PT localization from Uli's branch, since it was largely untranslated, and used the one from master instead. 2011-05-10 17:28:45 +02:00
Andy Matuschak dc925712dc Fixed layout of localization XIBs 2011-05-10 17:24:27 +02:00
Andy Matuschak e71915b4fb Revert "Removing dead -[SUUpdateAlert showsReleaseNotesText] method"
It wasn't so dead after all. Curse you, bindings!
2011-05-10 08:02:33 -07:00
Andy Matuschak 31b9ba8dde Fixed localization warnings. 2011-05-09 22:57:50 -07:00
Andy Matuschak 83708695af Added a canonical scheme and got the unit tests going again. 2011-05-09 22:56:09 -07:00
Andy Matuschak bb363db7f8 Fixed some project warnings. 2011-05-09 22:40:38 -07:00
Andy Matuschak ba6c3b6854 Cleaned up SUUpdater.h 2011-05-09 22:32:45 -07:00
Andy Matuschak 200da2b1be Removing BuildSparkleFinishInstallTool.command -- I don't think it belongs in master. 2011-05-09 22:25:19 -07:00
Andy Matuschak db652744ef Removing dead -[SUUpdateAlert showsReleaseNotesText] method 2011-05-09 22:22:58 -07:00
Andy Matuschak 9f3d4fb524 Nuking ThreadSafePreferences 2011-05-09 22:22:12 -07:00
Andy Matuschak 86b6502342 Fixing a merge error which put finish_installation in /tmp rather than in ~/Library/App Support 2011-05-09 22:18:17 -07:00
Andy Matuschak fa671073fa Changing download destination from ~/Desktop to ~/Library/App Support/HOST_NAME 2011-05-09 22:08:09 -07:00
Andy Matuschak 4f1e5a72a0 Added back master's Turkish localization 2011-05-09 21:39:28 -07:00
Andy Matuschak bca574119b Removed the pt_PT localization from Uli's branch, since it was largely untranslated, and used the one from master instead. 2011-05-09 21:36:46 -07:00
Andy Matuschak acb8f5f076 Fixed layout of localization XIBs 2011-05-09 21:07:51 -07:00
Uli Kusterer 16ff5c6683 Added Sparkle icon to finish_installation application. 2011-05-03 11:30:10 +02:00
Uli Kusterer 67d53c04b7 Get rid of deprecation warnings on 10.6/Xcode 4 while still allowing to build for 10.4 compatibility (I hear Patrick needs that). 2011-05-03 11:05:37 +02:00
Uli Kusterer 910f78b569 Add strings file to the finish_installation tool. Apparently also remove a leftover NIB, though I don't remember actually doing that. 2011-05-02 17:40:52 +02:00
Uli Kusterer fdaf26e95d Added two new Mac Pro models. 2011-05-02 17:30:07 +02:00
Uli Kusterer a8854375f5 Manually merge project file (recreating the finish_installation application target) and make things build and run again. 2011-05-02 17:29:53 +02:00
Uli Kusterer 9937e5a17b Merge andymatuschak/Sparkle. 2011-05-02 15:52:15 +02:00
Uli Kusterer 67b0860a9f Add a dummy line to make sure that the binary is linked against WebKit when Sparkle is used. The SUUpdateAlert.xib file contains a WebView and if we don't link against WebKit, we will get a runtime crash when decoding the NIB. It is better to get a link error. 2011-05-02 12:48:43 +02:00
Uli Kusterer 5b90432f7e Make sure the update alert is *really* not resizable. 2011-05-02 12:46:52 +02:00
Uli Kusterer 7cd8974b7e Make Sparkle more robust when the permissions of ~/Library/Application Support/EyeTV are screwed up. We now authenticate if needed, when we copy the finish_installation tool. 2011-05-02 12:46:37 +02:00
Uli Kusterer 9c042a5767 The buttons in the update alert now auto-resize. Since we change the button width when we show "Learn More..." for no-download updates (e.g. paid updates or updates that may no longer run on the user's Mac), this simplifies localization a lot.
The requisite NIB changes have been checked in previously with the newest localizations.
2011-05-02 12:42:13 +02:00
Uli Kusterer 3db00fa137 All XIBs, all the time. 2011-05-02 12:31:21 +02:00
Uli Kusterer f6710e2379 Sparkle now warns the delegate before and after it brings up a modal panel. One can e.g. use this to unfloat floating windows that would otherwise cover the alerts. 2011-05-02 12:29:30 +02:00
Uli Kusterer 990dee6a8d Newest Elgato localizations. 2011-05-02 12:25:37 +02:00
Uli Kusterer 7bfec0f3c0 Added two MacBook Air models. 2011-05-02 09:50:05 +02:00
Andy Matuschak 3ea1a9eee4 Merge branch 'master' of https://github.com/lapcat/Sparkle into lapcat-master 2011-04-07 17:37:12 -07:00
Andy Matuschak f6e292fad3 Added Turkish localization courtesy Tasin Is. 2011-04-07 17:09:37 -07:00
Jeff Johnson 1cce7890d8 Delete stray LIBRARY_SEARCH_PATHS build setting. 2011-03-25 21:26:19 -05:00
Jeff Johnson 61340cab17 Delete redundant Sparkle in test app linked libraries. For some strange reason, there were two. 2011-03-25 21:08:07 -05:00
Jeff Johnson 4a95dbeddc Link against Cocoa rather than AppKit and Foundation. 2011-03-25 21:08:07 -05:00
Jeff Johnson 45178111b3 Don't include SUStandardVersionComparator.m in test app or unit test targets, because it's already in the framework target. 2011-03-25 21:08:07 -05:00
Jeff Johnson eef0f5f0dc Delete reudundant GCC_DEBUGGING_SYMBOLS build setting, because it's already specified in the xcconfig. 2011-03-25 21:08:07 -05:00
Jeff Johnson 1e1025f17d Delete redundant -Wundeclared-selector, because it is already specified in the xcconfig. 2011-03-25 19:01:20 -05:00
Jeff Johnson 69407123ba Let Xcode add developmentRegion to the project. 2011-03-25 18:58:11 -05:00
Andy Matuschak 096d43a7a6 Updated Slovak localization; thanks to Rudolf Gavlas 2011-03-01 18:55:58 -08:00
Andy Matuschak 00b67269d6 Bug #681912: Sparkle naively double-escapes enclosure URLs 2010-11-26 12:07:32 -08:00
Andy Kim 5fe0a7cb59 Merge branch 'master' of git://github.com/andymatuschak/Sparkle 2010-11-25 02:22:37 -08:00
Adam Wróbel 7baf50506b Call EVP_MD_CTX_init and EVP_MD_CTX_cleanup.
According to openssl documentation EVP_Verify should be accompanied by
calls to EVP_MD_CTX_init and _cleanup to avoid memory leaks. Not sure, but
adding for conformity's sake.
2010-10-15 01:27:14 +08:00
Adam Wróbel 40616b864a Generate keys that actually work with openssl.
According to FIPS 186-2 standard DSA keys should be >= 512 and <= 1024 bits.
Using a 2048 bit key on my system yields an openssl error in Sparkle's
SUDSAVerifier and causes the update to be rejected.

The error says (can be read only after hacking on Sparkle's code):
error:0A071066:dsa routines:DSA_do_verify:bad q value
2010-10-15 01:27:12 +08:00
Andy Matuschak 561bbbe294 Because of the way Sparkle forces SUUpdaters to be per-bundle singletons, it was possible for an SUUpdater to be dealloced before registerAsObserver was called, which in turn made an exception get thrown on unregisterAsObserver. 2010-09-13 10:28:18 -07:00
Andy Matuschak fba7231261 We used to not register SUUpdater as an observer of the shared user defaults controller if we were running as a bundle. The performance win is minimal, and if I stop doing that, we won't accidentally try to unregister as an observer and bother developers who break on [NSException raise]. 2010-09-10 17:16:31 -07:00
aidansteele b3ac18f173 Forgot to close dangling file descriptor in previous commit. 2010-08-24 22:58:56 +08:00
aidansteele e2a59fccb2 Fixed delta updates bug wherein updates fail on empty file.
mmap()ing empty files caused EINVAL to be returned and _hashOfFile
would return an incorrect result. This has been rectified.
2010-08-24 22:58:55 +08:00
Andy Matuschak a8f26b16c2 Merge branch 'master' of git@github.com:andymatuschak/Sparkle 2010-07-30 21:08:56 -07:00
Andy Matuschak b7a3999da8 [Bug 611564] [NEW] sparkle fails to build with clang due to -Werror.\n\nAlso, switching to Clang because hoorah. 2010-07-30 21:08:11 -07:00
Andy Matuschak a5c8e0b1e2 No longer hardcoding the Installer tool's relative executable path for Tiger. 2010-07-27 18:35:04 -07:00
Lukhnos D. Liu 2768e60ce1 Properly escapes the GET parameters in the appcast string with profile. 2010-07-23 13:08:39 +08:00
Andy Matuschak 9075d4a037 Fixing 603197: Package Installs Crash on 10.4 2010-07-08 22:37:28 -07:00
Andy Matuschak da35ef695b Fixing #601842: Chromium crashes when 'Install and Relaunch' is clicked 2010-07-05 12:18:22 -07:00
Andy Matuschak 394319e1fc Merge branch 'master' of git@github.com:andymatuschak/Sparkle 2010-06-20 17:20:29 -07:00
Daniel Jalkut 0c6e6fdd84 Plug leak in SUAppcastItem caused by neglecting to release minimumSystemVersion. 2010-06-20 17:20:04 -07:00
Vaclav Slavik 39bb82bd9a Don't compress in bsdiff.
bsdiff-produced patch is included in xar archive, where it's compressed
with bzip2 a second time. Leaving the bsdiff output uncompressed makes
it possible to compress it better in xar (e.g. using LZMA2 or gzip,
either of which performs better on some files).

Changes header signature of bsdiff patch file to BSDIFN40 to clearly
mark the format as different.

Backward compatibility is preserved, bspatch can read both BSDIFF40 and
BSDIFN40 formats.
2010-06-21 01:43:46 +08:00
Andy Matuschak 25d7faea7b Updates to the Czech localization. 2010-06-09 13:16:39 -07:00
Andy Matuschak a0c2de60d3 Merge branch 'master' of git@github.com:andymatuschak/Sparkle 2010-06-08 20:48:52 -07:00
Andy Matuschak e8299fd116 Fixing 578060: minor Spanish localization fix 2010-06-08 20:47:20 -07:00
Vaclav Slavik 4548228238 Fix 10.4 compatiblity broken by delta updates.
Delta updates code uses libxar, which is only available in 10.5+, and
Sparkle framework fails to load on 10.4 because of it. Instead of having
hard dependency on libxar, Sparkle now links with it weakly and checks
for its availability at runtime.  This required bumping Xcode project
compatibility to 3.2 to get weak linking support.

With this change, delta updates are still not supported on 10.4, but
Sparkle runs there again and just ignores the deltas. This should be
good enough given 10.4's age and shrinking user base.
2010-06-07 02:19:51 +08:00
Andy Matuschak fe1372c962 Fixing 572066: some fixes to the Japanese localization. 2010-05-04 13:42:27 -07:00
Andy Matuschak a6fcfa61b5 Fixing ridiculous error in the last commit caused by non-initialization of a variable. See bug #571486. Sorry about that, all. 2010-04-28 16:37:04 -07:00
Andy Matuschak c34e9b3c34 Added an extra null check to SUAppcast downloadDidFinish because NSXMLDocument and NSFileManager throw exceptions on nil arguments. See bug 456514. 2010-04-28 00:45:45 -07:00
Andy Matuschak ea81eeec57 Fixing bug 570023; two minor localization changes. 2010-04-26 01:14:47 -07:00
Andy Matuschak 19ae8506ab Removing extraneous -L and -F flags that were causing warnings. 2010-04-09 13:28:00 -07:00
Andy Matuschak 803676d56a Landing delta-updates. 2010-03-27 17:06:51 -07:00
Andy Matuschak 5975703b13 Fixed some silly compiler warnings. 2010-03-27 17:03:07 -07:00
Andy Matuschak ecd2ce227b Fixing 527923: a minor Spanish localization layout bug. 2010-02-27 16:39:17 -08:00
Andy Matuschak 3f502b6151 Fixing bug #527318, some minor Spanish layout issues. 2010-02-25 00:47:39 -08:00
Andy Matuschak fb43787317 Fixing bug #527318, some minor Spanish layout issues. 2010-02-25 00:46:57 -08:00
Uli Kusterer f81bfd9f1c Move ThreadSafePreferences.h dummy compatibility header to a different spot in Groups & Files. 2010-02-21 18:29:56 +01:00
Uli Kusterer 24ebb7b379 SUUpdateAlert.xib: Shut up warnings about offscreen windows and clipped content. 2010-02-21 18:29:23 +01:00
Uli Kusterer 2460f2fcf7 SUUpdateAlert.nib: Made sure all installButton outlets are hooked up. Converted from NIB to XIB. 2010-02-21 18:25:01 +01:00
Uli Kusterer 401e696590 Restore support for enclosure-less appcast items. If they have a sparke:version tag at the same level as the enclosure would be (as opposed to as an attribute on the enclosure), and no enclosure, but a "link" tag, the link tag's contents will be used as the URL for a "More Info" button to replace the "install" button.
Use this for paid updates, where you want to redirect users to your store page instead of installing an update they don't have a license key for.
2010-02-21 18:09:39 +01:00
Uli Kusterer 29035199f3 That checkbox was way too narrow. 2010-02-21 15:12:29 +01:00
Uli Kusterer b4210d8f61 Use symbolic constants, that's what they're for ;-) 2010-02-21 14:06:49 +01:00
Andy Matuschak c120af6b1f Fixed the "You're up-to-date!" string in the German localization to use hyphens. 2010-02-10 12:46:05 -08:00
max 96ea09e44f Fixed a crash causes by a additional autorelease. 2010-01-27 18:43:11 +01:00
Andy Matuschak f5a1b1c27d Fixing #511784: Subclass of SUBasicUpdateDriver can't find relauncher 2010-01-24 11:00:35 -08:00
Andy Matuschak 5cdfffa521 Fixing #511784: Subclass of SUBasicUpdateDriver can't find relauncher 2010-01-24 10:58:43 -08:00
Andy Matuschak a5245accf4 Fixed a few local-vs-ivar variable ambiguities. 2010-01-11 10:19:12 -08:00
Andy Matuschak 9bc63ccf7e Merge commit 'bdash/delta-updates'
This is a big one, guys. Haven't tested the new features in the merged branch yet.
2010-01-11 00:49:28 -08:00
Andy Matuschak 2e3ed79753 Fixing #502212: clang static analyzer identifies 2 leaks in Sparkle code 2010-01-11 00:28:49 -08:00
Andy Matuschak da3b5c2570 Updated Russian localization courtesy Alexandr. 2010-01-06 17:45:06 -08:00
Sean McBride 756b37d4a5 code review of CFRelease usage, minor changes 2010-01-04 20:47:55 -05:00
Sean McBride 36b7d434ad fixed extra ref count, half of bug #502212 2010-01-04 20:09:42 -05:00
Sean McBride b21b308203 all but a few places use the typical [[[foo alloc] init] autorelease] pattern, removed 3 explicit releases and use autorelease instead. There are now only 2 exceptions to this pattern left. One is probably justified, the other looks like a leak. 2010-01-01 00:53:30 -05:00
Sean McBride dab8a36a13 renamed all methods that start with underscore, since that's reserved by Apple. Similiar for global variable that started with double underscore 2009-12-31 23:38:25 -05:00
Sean McBride 152e6f9572 SUHost's technique for getting a generic bundle icon did not work, fixed 2009-12-30 00:34:19 -05:00
Sean McBride f8fbf370bc enabled GCC_WARN_UNDECLARED_SELECTOR warning now that all such warnings are fixed 2009-12-30 00:06:27 -05:00
Sean McBride 61291c77d7 Merge branch 'master' of git://github.com/andymatuschak/Sparkle 2009-12-30 00:00:20 -05:00
Sean McBride b90df8b254 fixed warning by moving private methods higher in the source file 2009-12-29 23:58:27 -05:00
Sean McBride 4dbc0dd47f removed define that was moved to pch 2009-12-29 23:56:28 -05:00
Sean McBride 9d3db1b103 fixed warning 2009-12-29 23:56:08 -05:00
Sean McBride b8c8b9e605 conditionally define NSAppKitVersionNumber constants in pch, properly conditionalise Obj-C code 2009-12-29 23:55:31 -05:00
Sean McBride d7260665d6 fixed warning by moving private methods higher in the source file 2009-12-29 23:50:31 -05:00
Andy Matuschak b96c95066c Update driver now correctly marks itself as "finished" before terminating.
This is important for apps which checked this value during an app delegate's applicationShouldTerminate:.

Thanks to Nick Zitzmann for the patch.
2009-12-27 22:49:04 -06:00
Uli Kusterer 3d352c6fcd Merge branch 'master' of github.com:uliwitness/Sparkle 2009-12-23 11:50:05 +01:00
Uli Kusterer 874572f7bb More strings changes from Elgato. 2009-12-23 11:47:24 +01:00
Uli Kusterer 8f0d7d0805 Strings changes from Elgato. 2009-12-23 11:47:07 +01:00
Uli Kusterer 65f8d2629a Actually use the build configurations. 2009-12-23 11:44:51 +01:00
Uli Kusterer c0ca2249a5 Revert Patrick's version number change.
- It made bracketed build numbers look like components of the version, which gave wrong results
- Added a test for one such broken build-numbered version number

TODO: Tests currently fail for Patrick's version numbers. Will have to write a smarter parser, or split this into two version comparator classes.
2009-12-23 11:43:58 +01:00
Uli Kusterer efe903bc73 More detailed error handling and logging.
- Take failure of stat into account
- Use correct format for printing uids
- SULog actual failure points.
- Cope with nonexistent destinations
2009-12-23 11:41:31 +01:00
Andy Matuschak fd20e0725b Added two stupid spaces. 2009-12-21 15:02:36 -06:00
Andy Matuschak 6c8f094bbe Merge commit 'seanm/master' 2009-12-20 18:20:37 -06:00
Uli Kusterer 50b76d59f7 Add missing include. 2009-12-15 16:51:01 +01:00
Uli Kusterer 4f76b42bb5 If we install under a normalized name, make sure we take owner/group from the target directory, not from a nonexistent destination application we haven't installed yet. 2009-12-15 16:50:43 +01:00
Uli Kusterer d593ab38ad Fix configuration for finish_installation.app target:
Otherwise it won't build correctly on 10.4 and gives us "unsupported required load command" errors instead of starting up.
2009-12-15 16:49:35 +01:00
Uli Kusterer a17f974357 Merge branch 'master' of github.com:uliwitness/Sparkle 2009-12-15 16:31:19 +01:00
Andy Matuschak 40dee9958b Added Portuguese translation courtesy Sérgio Miranda. Thanks! 2009-12-14 22:35:56 -06:00
Uli Kusterer 575bdda768 Make sure that, even on 10.4, we delete our temp folder. Also, we no longer use the stop-gap measure of trashing the temp folder, we really delete it after successful installation. 2009-12-14 22:36:34 +01:00
Uli Kusterer 9b116929ad Slightly more user-suitable error message. 2009-12-14 22:34:49 +01:00
Uli Kusterer 2e8fa61a5a More more correct way of creating an NSString from a C-string path. 2009-12-14 22:34:25 +01:00
Uli Kusterer cd93eb9098 Method for removing a file with optional authorization. 2009-12-14 22:33:00 +01:00
Uli Kusterer 4c765d86ee More correct way of turning a C-string path into an NSString. 2009-12-14 22:32:32 +01:00
Uli Kusterer fa8aaced55 Make sure we also delete the temp dir when the user clicks "cancel" during the download. 2009-12-14 22:30:56 +01:00
Uli Kusterer 1b02ab5f7f Make sure we delete the temp directory. 2009-12-14 22:28:47 +01:00
Uli Kusterer 0e609cc528 Make sure we delete the temp directory. 2009-12-14 22:28:14 +01:00
Uli Kusterer 5ec4c74b0b Fix typo in LONG_INSTALLATION_TIME constant. 2009-12-14 22:24:48 +01:00
Uli Kusterer 4d7006950a Make sure mdimport is run synchronously, not asynchronously. 2009-12-14 22:22:23 +01:00
Uli Kusterer e49a69895a Fix authorized file moving code:
- We now correctly handle the case where the containing directory doesn't allow us adding files without authorization (e.g. /Applications).
- We do the quarantine release *before* the copy.
2009-12-14 22:21:27 +01:00
Uli Kusterer 27f2b9c219 Move 10.4 SDK setting into xcconfig file. 2009-12-14 22:18:15 +01:00
Patrick Stein db820fbb0f updated the installer program to show an icon when the installation takes more than 1.2 seconds,
long installations have a program in the Dock
short installations just look like the program is restarting
some variable renaming to no longer have camelCasePath for char *
2009-12-12 13:52:42 +01:00
Patrick Stein ad4e9c74e0 changed back 10.4 settings cause it broke the updater on 10.4 2009-12-11 19:44:22 +01:00
Uli Kusterer 4797446f7c Be paranoid and wait for the mdimport to finish before we launch the app. Might make spurious "no executable" errors a bit less likely. 2009-12-11 15:17:59 +01:00
Uli Kusterer 0ffcde4fbb Make sure we delete the temporary folder when the user cancels the download. Also make sure we delete it on 10.4, which seems to have a bug in removeFileAtPath: that won't delete nested empty folders. As a quick fix, I just trash the folder in that case. We already put the old version in the trash anyway, and this saves me from having to write, test and debug a recursive removal function. 2009-12-11 15:13:30 +01:00
Patrick Stein f555e1143f Merge remote branch 'uliwitness/master' 2009-12-11 14:54:32 +01:00
Uli Kusterer bc3fd4542b Remove 10.4 SDK setting. Causes more problems than it helps. 2009-12-11 14:46:30 +01:00
Patrick Stein d3fac14586 Merge remote branch 'uliwitness/master' 2009-12-11 13:31:39 +01:00
Patrick Stein d0425a140a Updating an application now longer shows the installation application n the Dock (LSUIElement) , Removed TransformProcessType call as it will force the installer application to show in the Dock. 2009-12-11 13:28:10 +01:00
Uli Kusterer 64ec0c317e Tests for version numbers with build numbers. 2009-12-11 13:10:29 +01:00
Patrick Stein 5f694f82af Intermediate Update directory name contains the version number of the downloaded version 2009-12-11 12:53:52 +01:00
Uli Kusterer 590122f25a Merge remote branch 'andymatuschak/master' 2009-12-11 12:51:33 +01:00
Patrick Stein 9b670b9ea7 removed cmdline installation tool and copied installation app to Sparkle framework. 2009-12-11 12:24:41 +01:00
Patrick Stein 65e836cba1 fixed Version Comparision , added more testcases 2009-12-11 12:12:23 +01:00
Patrick Stein c634f61f2a commented unused boxView code. 2009-12-11 11:56:18 +01:00
Patrick Stein 776e78c459 added Prefix header to finish_installation_tool
added SystemConfiguration.framework to Sparkle
added SUWindowController.m to finish_installation_tool
added SUStatusController.m to finish_installation_tool

now compiles Sparkle. Now going to fix the testbuild
2009-12-11 11:51:15 +01:00
Andy Matuschak a03235851c Removing GNU-style ?: operators. Thanks for the report, Uli. 2009-12-10 15:52:47 -08:00
Uli Kusterer d2f843f92c Danish localization updates. 2009-12-08 19:09:11 +01:00
Uli Kusterer e9c69673ad Set floating window level on the update alert again, but only for bg-only apps. Don't want to annoy users by having an always-visible panel. 2009-12-08 19:03:20 +01:00
Uli Kusterer a453afa29a Delegate can now control how version numbers are formatted/displayed to the user, so we can e.g. exclude build numbers or whatever makes sense for a particular application. 2009-12-08 19:02:10 +01:00
Uli Kusterer cee669c276 Shutting up warnings due to missing includes and fix indentation on one line. 2009-12-08 18:58:59 +01:00
Uli Kusterer 2e0c1b0086 One more SULog() replacing an NSLog(). 2009-12-08 00:44:01 +01:00
Uli Kusterer 7686c86792 Adjust the width of the status window so all localizations fit. 2009-12-08 00:43:08 +01:00
Uli Kusterer 2e0f0211d1 We now really put the old app in the trash (and any file we have to move out of the way to install a new app when we reset an edited name), even on non-admin user accounts. +++ TODO: Work around double authorization. 2009-12-08 00:37:39 +01:00
Uli Kusterer 4f8d745305 Changed a few NSLogs() to SULogs(). 2009-12-08 00:36:07 +01:00
Uli Kusterer 9788c6849e We should now correctly replace renamed apps, trashing the custom-named one, installing a new one with a default name, and also moving out of the way any existing copy with the default name. 2009-12-08 00:29:55 +01:00
Uli Kusterer 48dfbac37a Don't insist on having a file to replace. When we normalize the name, we may not have one. 2009-12-08 00:20:29 +01:00
Uli Kusterer e4eccce811 Updated localizations. 2009-12-08 00:17:50 +01:00
Uli Kusterer 097c2fea42 Build for more than just current architecture. We only build 32-bit because otherwise we'll get errors against 10.4 SDK (where 64-bit AppKit is not yet supported). 2009-12-07 23:52:43 +01:00
Uli Kusterer 5a5b171a68 Commented preprocessor switches. Added a named switch for normalizing an app name (it was just a #if 1 before). 2009-12-04 09:35:20 +01:00
Uli Kusterer 343d6866c4 - finish_installation is now a real bundled app, so it can be localized.
- It contains its own copy of Sparkle.strings and SUUpdateStatus.nib so it can show its progress prettier
- We call TransformProcessType() before our first call to [NSApplication sharedApplication], so we can be launched as a command line tool and get a proper window server connection, and so our progress bars animate.
- We still support the old "relaunch"-style mode of operation, just by not passing the folder to install. This is useful for other relaunch occasions, like setting one's own dock icon flag.

- To do: Make sample app use the new finish_installation.
2009-12-04 09:20:21 +01:00
Uli Kusterer 2ad144c739 Partial Elgato string merges. 2009-12-04 09:13:25 +01:00
Uli Kusterer 983ad61d78 Maybe that makes the progress bar animate? No, it doesn't. 2009-12-04 09:12:42 +01:00
Uli Kusterer 27e87143e1 target is an ObjC object, so nil, not NULL. 2009-12-04 09:11:50 +01:00
Uli Kusterer d0b802e09b Added preprocessor defines to SUConstants.h for turning on/off DSA and downgrades. We let users downgrade using our URL scheme, and we warn them beforehand, so the downgrade possible attack paranoia gets in the way. 2009-12-04 09:11:11 +01:00
Uli Kusterer 8c67631efb Use installPath, not bundlePath here. 2009-12-04 09:06:55 +01:00
Uli Kusterer 18df114b70 Bring window to front when progress panel changes to "Install and restart", it's essentially a new alert coming up. 2009-12-04 08:52:42 +01:00
Uli Kusterer c51bf739cf Shut up undeclared selector warning. 2009-12-04 08:51:13 +01:00
Uli Kusterer 43a0a7db4f Merge of changes from SVN repository:
- Changed NTSynchronousTask to also give the status return value and direct stderror output to the outputData.
- Changed includes so this builds as part of an app, too, not just as a framework
- Made sure SUAppcast's dealloc releases some leaked ivars.
- Added infoURL, extracted from link, that can point to a "more Info" page for download-less URLs
- Added support for version attribute on item so we can support update notifications that don't include an enclosure (e.g. paid upgrades, or upgrades that would require a system update)
- Added/improved a few description methods to ease debugging.
- Added SULog so one can ask for a special log with additional information when there are update issues.
- Added mayUpdateAndRestart for apps that absolutely, positively can't restart right now (e.g. cuz they're burning a CD and would produce a coaster).
- Added updaterWillRelaunchApplication delegate method, analogous to the notification. Useful to have app delegate quit helper apps during installation.
- Made SUBasicUpdateDriver's abortUpdate implicitly retain/autorelease the update driver, because the notification center otherwise releases it and it goes away, causing crashes in superclass's abortUpdate.
- Merge of SUKeepDownloadOnFailedInstallKey and SUFixedHTMLDisplaySizeKey.
- Avoid a few warnings about missing prototypes
- Be paranoid, hdiutil can verify the download again, so let it. Better for internal apps where we turn off DSA checks, too.
- SUHost has an -installationPath now, independent from the bundlePath, so one can normalize the app name from "MyApp 1.1b4" back to "MyApp" Users assume the file name contains the correct version number when there is one in it. Saves support a few round-trips each time.
- Be better at threading: Try calling non-thread-safe methods on main thread only, and don't assume delegates know when they need to be thread-safe, call them on main thread where possible.
- Added a method to put the old copy of the app in the trash. 1.5git changed in this spot, so I didn't actually merge the code that uses it back in yet.
- Fix version comparison so it doesn't get confused by bracketed build numbers in version strings
- Make sure cancel button is disabled during extraction, otherwise user would crash.
- Don't put auto-update window at floating window level. It's huge and can't be switched to background! If you're an NSBGOnly where you need that, turn it on only in that case, but don't generally do such nonsense.
- Hide release notes view if there aren't any.
- Test whether we are on dial-up before checking for updates in background. It's not nice to cause (possibly expensive) dial-up periodically.
- Temporarily comment out DSA complaints for easier testing.
- Don't store (possibly already invalidated) one-shot NSTimers in an ivar. It's bad style. Retain it instead.
- Decompress some monster expressions with nested method calls in ternary operators and nested in method calls again.
- Don't use implicit "id" for params or return types.
- finish_installation now puts up a progress window, so user knows update is still not finished.
- Use ThreadSafePreferences (included dummy version that uses regular prefs for projects that don't use ThreadSafePreferences).

- Todo later: Change finish_installation to be prettier.
2009-12-04 08:40:46 +01:00
Uli Kusterer bbcfe7edf4 - More WIP creating finish_installation that waits
for quit, updates and relaunches the app, so
updates don't happen while app is still running.
NSBundle gets royally confused and points to the
old path (loading new NIBs into the old app in the
worst case) when you move a running app.
- Temp folder is now user's desktop, as
NSTemporaryDirectory() doesn't stay the same
between two separate apps, and may be emptied on quit.
- Relaunch gets created in App Support now, for
same reasons as above.
- Less dependency on prefix headers, that only leads
to lazy, un-reusable code.
2009-12-04 07:46:07 +01:00
Uli Kusterer a11578a863 WIP turning the relaunch tool into a finish_installation tool. 2009-12-04 07:40:28 +01:00
Andy Matuschak b546304d5d Updated Danish localization courtesy David Munch. 2009-11-28 12:37:27 -08:00
Sean McBride d7774c0dc0 performed a code review, specifically:
- changed some #include to #import
- fixed some NULL -> nil Cocoa coding conventions
- added new compiler warnings and fixed some warnings they generated
- check for nil from NSTemporaryDirectory
- added missing files to unit test and test app targets
- added xcconfig files for unit test target
- added @private to some ivars
- changes some variables from signed to unsigned as appropriate
- changed from base 2 to base 10 measurements of file size, consistent with both the actual meaning of metric prefixes and Apple's new policy as of 10.6
- reduced some unneeded copy-paste of code
- fixed failure to check for null from malloc and unneeded check against null before calling free
- OSErr was incorrectly used instead of OSStatus
- added some consts & statics to global strings
- fixed some issues discovered by static analysis
- fixed some 64bit issues, mostly related to casting and the use of slightly incorrect types/sizes
- some dealloc methods were using accessors, changed to access ivars directly, as per Apple guidelines
- removed old NS_DURING, NS_HANDLER, NS_ENDHANDLER macros
- fixed a bug where immutable data was being mutated
- removed all instance of "== YES" as they are dangerous
- removed some redundant nil checks
- fixed some leaks
- conditionally replaced deprecated method usage
- cleanup CF/NSMakeCollectable usage
- fixed bug in GC where memory could be collected too early due to lack of strong references when using UTF8String
- prevent passing null to CFRelease
2009-10-31 21:07:00 -04:00
Andy Matuschak bd80144c7b Fixing #456514: Appcast download crashes on 10.5 if download fails 2009-10-20 13:55:03 -07:00
Andy Kim 315cbaab1b Merge branch 'master' of git://github.com/andymatuschak/Sparkle
Conflicts:
	en.lproj/Sparkle.strings
2009-09-29 18:33:44 -07:00
Andy Matuschak af37928283 Fixed a Spanish localization issue in the update permissions prompt; fixed release-mode compatibility for Leopard. 2009-09-20 00:15:06 -04:00
Andy Matuschak 6a3df43017 Fixed Bug #428216: "Update alert does not use a proper emdash" 2009-09-20 00:05:23 -04:00
Andy Matuschak c747ffc35b Fixed Bug #428216: "Update alert does not use a proper emdash" 2009-09-19 16:55:16 -04:00
Joachim Bengtsson 7bfbe83d87 When failing to parse a feed item, tell the developer *what* the error is. No need for a full-fledged NSError because these errors only go to the console, not displayed to the user (who doesn't care). 2009-09-06 17:54:02 -07:00
Joy Zhao a871569867 Bug #423014: "Translation errors in Spanish and Italian" 2009-09-03 23:42:46 -07:00
Grant Erickson 65b071eb86 If no suitable packages or bundles are found to be installed, Sparkle will install the first package it finds in the distribution archive. 2009-09-03 23:29:50 -07:00
Christiaan Hofman 0e99d4fa80 Bug #402074: ".pkg installations should support asynchronous installation" 2009-09-03 23:20:03 -07:00
Andy Matuschak 8f00c3c274 Fixing Bug #422201: ""Checking for updates..." needs to be added to spanish (es.lproj) strings"
The Spanish localizer actually sent these over, but I forgot to add 'em in!
2009-09-01 20:36:46 -07:00
Stuart Morgan 4fad53007f Change availability checks so that they build on 10.4 2009-09-01 20:10:16 -07:00
Andy Matuschak e7435964a2 Fixing Bug #421608: "Update fails if more than one .app exists in the archive" 2009-08-30 20:24:28 -07:00
Ernesto Gomez Cereijo 8ea15468b4 Updated the Spanish localization. 2009-08-28 09:17:35 -07:00
Andy Matuschak 9025bef687 Fixed moving to trash on Tiger. 2009-08-27 22:04:51 -07:00
Fraser Speirs ffc44bb089 Added a space in the description of the SUNoFeedURL exception becuase it led me to believe that the value of SUFeedURLKey was actually @"SUFeedURLKey" and not @"SUFeedURL". 2009-08-27 11:29:15 +01:00
Andy Matuschak 6c968489eb Bug #381138: "Translator erros on check updates dialog"
A bunch of small localization tweaks courtesy Joy Zhao.
2009-08-27 00:54:21 -07:00
Andy Matuschak 2fc1b66a79 Fixing:
Bug #389869: "Sparkle runs thread-unsafe code on secondary threads"
Bug #312995: "Canceling authentication request causes crash on next update"
Bug #388793: "Need to notify SUUpdateDriverFinishedNotification on main thread"

The unfortunate side-effect of this fix is that all the file-handling code is now CoreServices-based, since NSFileManager is not thread-safe. This is disgusting and will be stricken from all records when installation is performed by relaunch in Next Major, as it should have been in the first place.
2009-08-27 00:43:32 -07:00
Andy Matuschak bd99d0451d Fixing Bug #274872: "Activate host app on automatic update when when host runs in background" 2009-08-27 00:04:53 -07:00
Andy Matuschak d62e47cd2e Fixing Bug #416798: "Sparkle should warn developers if the app has no public key and the appcast isn't https://" 2009-08-27 00:02:10 -07:00
Mark Rowe ab23fedd0c Merge branch 'master' into delta-updates 2009-08-23 15:18:46 -07:00
Simone Manganelli 43a603c1cc if the user chooses to not restart the host app after installing the new version, the Sparkle update status window goes away and stops annoying the user by staying on screen; originally by simX, http://github.com/rentzsch/clicktoflash/commit/c768f07087c769f12f7645e78dd42802da46048b 2009-08-23 14:19:57 -07:00
Simone Manganelli 9b5b541c82 Fix for Sparkle crasher in scheduleNextUpdateCheck. Originally by lapcat, http://github.com/rentzsch/clicktoflash/commit/f7ca07b3e6e6e13de8133d8e237f284f2ccdc066 2009-08-23 14:16:02 -07:00
Andy Matuschak 119bac527f Merge branch 'bdash/leak-fixes' 2009-08-23 09:52:55 -07:00
Andy Matuschak e9bc6a2915 Merge branch 'leak-fixes' of git://github.com/bdash/sparkle into bdash/leak-fixes 2009-08-23 09:52:40 -07:00
Andy Matuschak 2979338f8a Merge branch 'master' of git://github.com/bdash/sparkle into bdash/custom-user-agent-string 2009-08-23 09:46:39 -07:00
Andy Matuschak 830f633a6e Added new IB3 files for the changed localizations in the last revision.
Updated the German localization, courtesy Christoph Schmitz.
2009-08-21 19:07:37 -07:00
Mark Rowe 0d51d12e43 Merge branch 'master' into leak-fix 2009-08-21 15:28:30 -07:00
Mark Rowe 2d47989616 Remove bogus call to retain that results in a leak of an NSMethodSignature. 2009-08-21 15:26:55 -07:00
Mark Rowe f259b5e825 Return an autoreleased object as callers expect rather than leaking the dictionary. 2009-08-21 15:25:06 -07:00
Mark Rowe 3800b33c1a Merge branch 'master' into custom-user-agent-string 2009-08-21 14:47:51 -07:00
Mark Rowe dfe0eff095 Provide the ability to set a custom user agent string on all HTTP requests that Sparkle initiates. 2009-08-21 14:46:39 -07:00
Mark Rowe 8cdec40a03 Merge branch 'master' into delta-updates 2009-08-21 14:40:05 -07:00
Mark Rowe 6169234300 Rework the BinaryDelta tool to use NSOperationQueue in order to be slightly more portable.
There's slightly less concurrency as a result as all archiving operations are now performed
serially on the main thread.  Since these make up a small percentage of the overall runtime,
the increased portability makes this a reasonable tradeoff.
2009-08-21 14:40:00 -07:00
Mark Rowe 3ff2d82ecf Fix warnings and binary compatibility issues that crop up when building the BinaryDelta tool against different SDKs. 2009-08-21 14:40:00 -07:00
Mark Rowe 3ef4c09f71 Link against a static build of libxar as libxar.dylib didn't ship on Tiger. 2009-08-21 14:40:00 -07:00
Mark Rowe 79bd7ac090 Add an unarchiver for the delta format so that Sparkle can successfully install the delta updates. 2009-08-21 14:40:00 -07:00
Mark Rowe 6e648f14f4 Add support for parsing an extended <sparkle:deltas> element in the appcast that describes
the delta updates that are available for a given version.

The appcast would look a little something like the following:

<enclosure url="http://you.com/app/Your Great App 2.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:deltas>
    <enclosure url="http://you.com/app/Your Great App 1.5 to 2.0.delta" sparkle:version="2.0" sparkle:deltaFrom="1.5" length="642381" type="application/octet-stream" sparkle:dsaSignature="MCa1JyW30nbkBwaC0CFBfeinOzrN6EQuAh=" />
    <enclosure url="http://you.com/app/Your Great App 1.4 to 2.0.delta" sparkle:version="2.0" sparkle:deltaFrom="1.4" length="928231" type="application/octet-stream" sparkle:dsaSignature="B6B1K1JyW30nbkBDBfeinOAszrN6Ea1JyW3" />
</sparkle:deltas>
2009-08-21 14:40:00 -07:00
Mark Rowe c3d8254324 Add a command-line tool that can generate and apply a binary delta between two versions of an application.
The delta file is a custom format created from the xar container format.  It describes the necessary
modifications to transform the contents of the old directory in to the contents of the new.  Binary
diffs are used to compress the differences between large files such as Mach-O binaries.  The binary
diffs are generated by bsdiff and applied via bspatch, both from bsdiff 4.3, the source of which is
included and used under a BSD-style license.
2009-08-21 14:39:54 -07:00
Andy Matuschak 15095640eb Fixing Bug #400536: @"The update is improperly signed." does not localized 2009-08-20 23:53:14 -07:00
Andy Matuschak 6070419761 Bug #377834: "MoreInfoView summary appears empty in SUUpdatePermissionPrompt in non-English locales" 2009-08-20 23:48:28 -07:00
Andy Matuschak db2f48ad09 Oops: *actually* finished doing the architecture configuration update. 2009-08-20 23:42:16 -07:00
Andy Matuschak cfe5206252 Fixing Bug #396495: "Wrong method name"
Just a convention mismatch in a private method.
2009-08-20 23:32:51 -07:00
Andy Matuschak 975f679148 Removing deprecated warning flag. 2009-08-20 23:29:39 -07:00
Andy Matuschak b571a3d58d Fixing Bug #398921: Sparkle should detect read/write errors on archive extraction
Thanks to Jim Turner for the patch.
2009-08-20 23:28:26 -07:00
Andy Matuschak 5090d4b3a0 Giving the "seconds" field a little more space. 2009-08-20 23:25:04 -07:00
Andy Matuschak 799b00211d Fixing Bug #338324: "Unsigned updates delivered over https fail"
Silly boolean logic error.
2009-08-20 23:24:13 -07:00
Andy Matuschak afe8afc41f Fixing Bug #393388: Leaking NSFileManager errors 2009-08-20 23:18:15 -07:00
Andy Matuschak 090e7c0ecb Fixing Bug #304674: "Debug linking can break on default Xcode projects"
Sparkle now builds for all architectures in debug mode.
2009-08-20 23:14:52 -07:00
Andy Matuschak e557b78394 Updated the CFBundleVersion script to use the Sparkle git hash instead of the Bzr revno. 2009-08-20 23:12:51 -07:00
Andy Matuschak c53f961690 Fixing Bug #272346: "Sparkle Test App needs to use the new preferences bindings" 2009-08-20 23:02:55 -07:00
Andy Matuschak 9e6b51fac9 Fixing Bug #415707: "Crash on hitting Esc in an update alert in garbage-collected Sparkle" 2009-08-20 22:50:34 -07:00
Andy Matuschak a6f98158a7 Removed a warning caused by the last commit. 2009-08-20 22:49:15 -07:00
Andy Matuschak ca040bdf9a Fixing #394787: "SUUnarchiver passes NSNumber to method requiring long" 2009-08-20 21:22:24 -07:00
Andy Matuschak f95cf6454d A little cleanup on bricooke's patch. 2009-08-20 20:58:53 -07:00
Brian Cooke 827c6adc03 when about to show the user what will be anonymously sent, make sure the delegate is told that systemprofile info will be sent so it knows to put its custom additions in there. 2009-08-20 10:00:41 -06:00
Andy Matuschak 59d9ece06b Fixes bug #337331: "Status progress still doesn't animate"
In general, the progress indicator bindings for animate and isDeterminate are totally unreliable. Giving up on them.
2009-08-19 23:29:21 -07:00
Andy Matuschak 1dd1b09e5f Fixing #341643: "wrong version number in automatic update alert"
Thanks to Jim Turner for the patch.
2009-08-18 22:20:46 -07:00
Andy Matuschak 58296ecaf7 Added a Czech localization courtesy the Czech X Team. 2009-08-18 21:58:50 -07:00
Andy Matuschak 3b0674320f Made the test app use garbage collection when built in the GC build configuration. 2009-08-18 19:53:45 -07:00
Andy Matuschak a8b2b4f962 Removed an extraneous space from an Italian string. 2009-08-16 02:27:37 -07:00
Clint Shryock 6fc32b6800 added readme file.
Pulled information from http://sparkle.andymatuschak.org/
2009-08-13 21:09:53 -05:00
Andy Matuschak 1e20d43c2a Added brazilian portuguese localization courtesy Paulo Neto. 2009-08-11 23:37:33 -07:00
Andy Matuschak 52814bcbd0 Removed .bzrignore 2009-08-11 00:06:29 -07:00
Andy Matuschak 74fccaaab5 Added the new Polish and Japanese localizations to the project. Oops. 2009-07-31 22:46:32 -07:00
Andy Matuschak 6813a06455 Added Japanese translation courtesy Koichi Matsumoto. 2009-07-30 19:35:45 -07:00
Andy Matuschak e423cfee35 Going back to GCC for compilation. 2009-07-11 00:56:43 -07:00
Andy Matuschak 7316a00e9c Removed SL-deprecated NSFileManager methods. Left the old ones around #if'd for 10.4 support; I look forward to removing them. :)
Thanks for the patch, August.
2009-06-20 18:41:40 -05:00
August Joki 54299d766a added #ifdef's for Tiger support 2009-06-14 21:37:45 -07:00
August Joki f2a7b4b349 Fixed deprecated APIs to use replacements. 2009-06-14 19:30:46 -07:00
Andy Matuschak 150718ad6f Fixing the behavior of one of the build scripts when run multiple times; thanks for the patch, Stuart. 2009-05-22 00:02:43 -07:00
Stuart Morgan 0904ec151c Fix fr_CA linking so that it works correctly when run multiple times. 2009-05-21 21:02:35 -07:00
Andy Matuschak dff6e0832c Merging in a fix to a bug which caused the user agent string not to be null-terminated. 2009-05-19 11:44:02 -07:00
Andy Matuschak e983c03232 Added missing "Cancel Update" string. 2009-05-19 11:35:52 -07:00
Jeremiah Boyle d1c54608f7 [cleanedAgent bytes] is not null-terminated so stringWithCString produces a bad NSString. use initWithData instead. 2009-05-09 17:31:35 -04:00
Andy Matuschak 24b6c88935 Added Icelandic localization courtesy Steingrímur Árnason. 2009-05-08 09:26:46 -07:00
Andy Matuschak 6397e56c06 Updated Sparkle's license to include external licenses. 2009-04-28 20:27:24 -07:00
Andy Matuschak 9785111857 Merging in fix for 10.4 SDK 2009-04-05 14:42:09 -07:00
Stuart Morgan 522ffb08f0 Add a conditional definition of NSAppKitVersionNumber10_4 to allow building against the 10.4 SDK. 2009-04-04 21:48:21 -07:00
Andy Matuschak 22129e3ec7 Fixes #353896: SUWindowController should #import SUHost 2009-04-02 10:41:24 -07:00
Andy Matuschak 4431864770 Added Danish, Chinese Traditional, and Chinese Simplified translations to the project. 2009-04-01 20:51:21 -07:00
Andy Matuschak 23a57f7876 Fixed a bug that might occur in debug configurations with weird working paths. Thanks to Uli Kusterer for catching it. 2009-03-30 15:40:12 -07:00
Andy Matuschak 05b75aa44c Fixes Bug #321761: Update crashes below NSTask if /usr/bin/mdimport does not exist or is not executable 2009-02-11 14:54:55 -08:00
Andy Matuschak e35a1ca231 Added Polish localization courtesy Grzegorz Wilk.
Fixed a string in the Spanish localization.
2009-02-10 10:21:40 -08:00
Andy Matuschak 1cc6c2b9ca Updated Spanish localization courtesy Alexsander Akers. 2009-02-10 10:16:22 -08:00
Andy Matuschak 8c092c7453 Fixing 316105: "Icon defaults to app icon, also for non-app bundles"
Thanks to Hofman.
2009-01-12 14:31:52 -08:00
Andy Matuschak 6631fce15f Undoing accidental change to a build configuration. Oops! 2009-01-10 00:14:05 -08:00
Andy Matuschak 7071142aad Improving Sparkle's robustness against apps without a CFBundleVersion. 2009-01-09 18:57:29 -08:00
Andy Matuschak 34586bca5a Finishing fixing #279454 (up to date -> up-to-date) 2009-01-08 10:49:41 -08:00
Andy Matuschak 516638a6d7 Fixing Bug #314456 "SUPackageInstaller exec of 'open' on 10.4"
Thanks to Peter Speck for the patch. This could use some testing!
2009-01-06 14:32:10 -08:00
Peter Speck d4c39a2ad9 Fallback to Installer.app on 10.4 2009-01-06 23:09:32 +01:00
Andy Matuschak d6288c175e Fixing Bug #301614: "SUUpdater initForBundle: should be public" 2009-01-05 23:12:48 -08:00
Andy Matuschak 08b785083a Fixing Bug #300053: "Disable signature requirement when appcast and update archive URLs are local" 2009-01-05 23:11:26 -08:00
Andy Matuschak a7818f0f64 Fixing Bug #279454: "Spelling error in update framework"
"up to date" -> "up-to-date"
2009-01-05 23:06:20 -08:00
Andy Matuschak 52642aa11a Fixing Bug #275463: "SUScheduledUpdateDriver doesn't call updaterDidNotFindUpdate"
Thanks to Peter Speck for the patch!
2009-01-05 22:58:55 -08:00
Andy Matuschak 27c886f6b9 Updated French localization; thanks to Ronald Leroux. 2009-01-05 15:12:48 -08:00
Andy Matuschak 85eb5a7496 Fixing #314047: "Wrong version check in SUHost code"
Thanks to Hofman for the patch and the catch.
2009-01-05 09:42:35 -08:00
Andy Matuschak 91c242ac04 Fixes Bug #312381: "Bundles can't ask for permission to update; developers have to hard-code YES for SUEnableAutomaticChecks"
Thanks to Hofman for the patch! Now the update cycle will be started once the SUUpdater instance is instantiated; bundles no longer need to expressly start the update cycle.
2009-01-01 13:37:08 -08:00
Andy Matuschak 8ff6c147f2 Fixing 301644: Limit WebView Contextual Menu
Thanks to David Dauer for the patch.
2008-12-27 23:14:55 -06:00
Andy Matuschak 8b4bb5a078 Fixing #302886: Standard web preferences are polluted
Thanks to Martoche for the patch.
2008-12-27 23:07:36 -06:00
Andy Matuschak 9d260f9b0e Bug #275309: Crash in NSURLConnection
This one's a little experimental. Credits to Hofman for the patch. This changes the appcast fetching over to NSURLDownload from NSURLConnection. Test, please!
2008-12-23 22:11:17 -06:00
Andy Matuschak 59cd48f3de Added Danish localization courtesy Mogens Thyregod
Added Chinese Traditional localization courtesy Jack M. H. Lin
Added Chinese Simplified localization courtesy JT Lee
2008-12-18 23:22:59 -06:00
Andy Matuschak b11db20742 Added Slovak localization courtesy Rudolf Gavlas. 2008-12-18 12:28:09 -06:00
Andy Matuschak f186aa6896 Fixed some deprecated method use which caused warnings with new versions of the iPhone SDK. 2008-12-16 00:08:33 -06:00
Andy Matuschak 2bedf000a8 Added Korean localization courtesy 동성... 2008-12-10 20:02:42 -08:00
Peter Speck 3d6f4544f1 SUScheduledUpdateDriver doesn't call updaterDidNotFindUpdate 2008-09-28 16:39:05 +02:00
Andy Matuschak 13deac9b58 Fixes 271378
Sparkle is now willing to install a bundle in the archive with the same bundle identifier as the running app as a fallback strategy.

Thanks to Jim Turner for the patch.
2008-09-19 18:24:52 -07:00
Andy Matuschak 21c60ef7ce Fixes 272211
Sparkle is now installing .pkgs by launching Installer.app with open instead of NSWorkspace; the latter resulted in strange window ordering. Thanks to Peter Speck for the patch.
2008-09-19 18:16:10 -07:00
Andy Matuschak 83adbb2979 Fixes 270585
Now symlinking fr_CA.lproj correctly.
2008-09-19 14:28:05 -07:00
Peter Speck c614b679e1 Install.app launches in semi-background from PrefsPanel 2008-09-19 19:48:10 +02:00
Peter Speck 10bcc69c80 fix fr_CA.lproj symlink 2008-09-15 18:33:36 +02:00
Andy Matuschak 9eb4368d6f Updated sample appcast to be appropriate for DSA signatures being required. 2008-09-13 22:54:16 -05:00
Andy Matuschak 783fd4b475 Merging in new Dutch localization changes. 2008-09-13 22:53:53 -05:00
Andy Matuschak 00efab8ad2 generate_key.rb => generate_keys.rb 2008-09-11 22:08:32 -05:00
Andy Matuschak d73b3745bf Fixes 268756
When determining LSUIElement status, Sparkle now asks the process manager instead of checking Info.plist; this'll support apps that change their LSUIElement status at runtime.
2008-09-11 11:33:18 -05:00
Andy Matuschak ccd44c0cb2 Fixes 268723
Now forcing a DSA signature check if the client provides a public key with the app.
2008-09-10 17:48:57 -05:00
Andy Matuschak 9a0acca849 More security tidbits!
This patch prevents malicious downgrades, which are still possible with DSA validation: suppose there's some (signed) version with a security hole. A malicious attacker could serve an appcast with that version's URL and DSA signature, but a higher version number, forcing the user to "upgrade" to the version with the security hole.

While I was at it, I fixed a bug that should have completely stopped .pkg installation from working since 1.5b1. Why didn't I hear anything about that? Does anyone actually use .pkgs? It still needs testing to be sure it works.
2008-09-10 11:47:58 -05:00
Andy Matuschak 95f9658a7e Fixes 244692
Fixing a GC leak that would occur on non-64-bit machines.
2008-09-10 10:47:22 -05:00
Andy Matuschak 0fa24ce313 Restored the old default font size for release notes, now that we're doing webview preferences a different way. 2008-09-10 10:45:58 -05:00
Andy Matuschak 28ad466aa8 Fixes 268471
-- Removed obsolete configuration settings regarding 10.3 support.
-- Stopped a configuration file from getting added to the Resources folder.
2008-09-10 10:39:31 -05:00
Andy Matuschak 7e9fc0f20b Changed the security policy once more:
The user is defined as "safe" and exempt from DSA signatures if he downloaded both the appcast and the update over SSL.
2008-09-10 10:37:47 -05:00
Andy Matuschak 7f5689835b Fixed a small security hole: release notes specified with a file:// URL would be able to read files on your file system through Javascript (basically a cross-site scripting attack). file:// URLs are therefore no longer supported for release notes. 2008-09-09 23:39:00 -05:00
Andy Matuschak 478e0a53d0 Fixed a potential security vulnerability in which the download is transmitted over SSL but is from a malicious server. Now the download has to be transmitted over SSL *and* the download's host has to be the same as the appcast's. 2008-09-09 23:34:20 -05:00
Andy Matuschak 588cad8d91 Killed off SUExpectsDSASignatureKey. 2008-09-06 19:07:54 -05:00
Andy Matuschak 1d3ab8d6bb Alright, guys. No more Mr. Nice Sparklepants. Sparkle now requires either DSA-signed updates or SSL transport. If you want to put your users at risk, you're going to have to comment out some code and recompile.
I included some scripts to help you along, though. IANASG (I Am Not a Security Guy), though, so if you know your shit, feel free to do it on your own as before.
2008-09-06 18:59:50 -05:00
Andy Matuschak e086aa1660 Munged localizations so that unicode characters like em-dashes and ellipses are now in the values of the localization strings, not the keys; putting them in the latter made Sparkle unbuildable on Tiger. Thanks to Stuart Morgan for the patch. 2008-09-06 12:34:03 -05:00
Stuart Morgan 188a15a948 Fix a key in sv.lproj 2008-09-04 20:22:45 -07:00
Andy Matuschak 874660f52e Added a warning log message for bundles which don't have a CFBundleIdentifier key. 2008-09-04 10:51:46 -05:00
Stuart Morgan 29bd46d68d Don't use unicode in NSString literals 2008-09-04 07:57:17 -07:00
Andy Matuschak cb80e0ef51 No longer polluting the standard WebView preferences. Thanks to Christiaan Hofman for the patch. 2008-09-04 09:53:53 -05:00
Andy Matuschak ccef53a3d3 Fixes 259704
Fixed a memory leak in the update permission prompt.
2008-09-04 09:44:35 -05:00
Andy Matuschak d201803259 More fixes for 258060
Fixes a bug which could cause a crash when the update item is chosen by the delegate from the appcast. Thanks, Christiaan Hofman.
2008-09-03 22:34:25 -05:00
Andy Matuschak 74b206dc77 Fixes 259455
Fixes release notes stored raw in the <description> key. Thanks to Peter Speck for the patch.
2008-08-19 21:57:23 -07:00
Andy Matuschak 42cda2d2e0 Fixes 259062
Added a SUUpdater key for lastUpdateCheckDate. Thanks to Peter Speck for the patch!
2008-08-19 21:44:39 -07:00
Andy Matuschak c386b704b5 Partial fix for 245277: basic descriptions for some Sparkle classes. Thanks to Christiaan Hofman for the patch. 2008-08-19 21:24:26 -07:00
Andy Matuschak 84be00b29f Fixes 258991
The selector for the updaterWillRelaunchApplication delegate call had a typo in it, so it wasn't getting called. Oof.
2008-08-19 21:13:15 -07:00
Andy Matuschak d064b589ae Fixed the total failure of the SUProbingUpdateDriver to notify its delegate when an update is found. Sorry about that, guys! Wow. 2008-08-19 21:09:31 -07:00
Peter Speck 90edd12e43 No update-release notes displayed for when using <description> instead of <sparkle:releaseNotesLink> 2008-08-19 17:50:28 +02:00
Peter Speck c71bf3ccbe Provide getter for SULastCheckTimeKey 2008-08-18 15:11:05 +02:00
Andy Matuschak 724b4de07e Renamed SUAppcastItem's "description" key to "itemDescription" so as not to conflict with the standard Cocoa description method. 2008-08-17 15:23:50 -07:00
Andy Matuschak 444b0a928d Fixed a stupid mistake that prevented my fix for parameterized URLs from actually functioning. 2008-08-17 14:15:57 -07:00
Andy Matuschak ec8fcbc02f If an update's display version is the same as the host's display version, the internal version number will be presented in parentheticals. 2008-08-17 13:51:55 -07:00
Andy Matuschak 68e2cd67d1 Fixes 258492
Sparkle can now handle appending parameters to URLs which already have parameters (like http://foo.org/baz?bat=4)
2008-08-17 13:42:47 -07:00
Andy Matuschak c21e1aba35 Fixes 258529 and 257967
Added backwards compatibility support for Sparkle 1.1's behavior of disabling automatic updates when the check interval was 0.

Sparkle will now properly reset the update cycle when setAutomaticallyChecksForUpdates or setUpdateCheckInterval is called for non-.app bundles.
2008-08-17 13:25:49 -07:00
Andy Matuschak ec7f38d157 Fixes 258547
SUUpdater now implements two new keys: "automaticallyDownloadsUpdates" and "sendsSystemProfile".

Here's the current state of the setting keys, as documented by Christiaan Hofman:

* UserDefaults through SUUpdater accessors with default value in Info.plist:

SUFeedURL
SUScheduledCheckInterval
SUEnableAutomaticChecks
SUSendProfileInfo
SUAutomaticallyUpdate

* Info.plist only (app settings):

SUShowReleaseNotes
SUPublicDSAKey
SUPublicDSAKeyFile
SUExpectsDSASignature
SUEnableSystemProfiling

* UserDefaults only (private persistent state):

SUHasLaunchedBefore
SUSkippedVersion
SULastCheckTime
SULastProfileSubmitDate

This revision also corrects a compilation error from r285.
2008-08-17 13:06:33 -07:00
Andy Matuschak 5b38483981 Fixes 245723
Refactoring some code through new simplified "objectForKey" and "boolForKey" methods on SUHost which abstract the behavior of a user defaults preference defaulting to an info.plist setting. Thanks to Christiaan Hofman for the patch.
2008-08-17 12:35:41 -07:00
Andy Matuschak 46312a2d15 Fixes 258060
Fixed a couple memory leaks. Thanks to Christiaan Hofman for the patch.
2008-08-17 12:15:01 -07:00
Andy Matuschak 8a240f7c46 Fixes 258708
Returning the update alert's web view's default text size to 11. I swear I've done this like twice already!
2008-08-17 11:24:36 -07:00
Maarten Van Coile 17ca061cda Update Dutch to 1.5b5 2008-08-15 19:30:29 +02:00
Andy Matuschak 4da902b46c Fixes 251968
Sparkle now requires custom feed parameters to include a "displayKey" and "displayVersion" key. These will be displayed to the user in the initial permission dialog so that he knows what he's getting.
2008-08-10 23:49:30 -07:00
Andy Matuschak 7b39268171 No longer fragile-ly using class method singletons to get to the updater's delegate from within the update driver. Update drivers now have an initWithUpdater: method which I use instead. 2008-08-10 23:05:18 -07:00
Andy Matuschak 0343569cdc Fixes 256106
Sparkle will no longer break on nil XML nodes; that would occur when a node is commented out. Thanks to Christiaan Hofman for the patch.
2008-08-10 21:31:09 -07:00
Andy Matuschak 32a804e2ea Sparkle now uses Cocoa for user defaults for .apps and CF for user defaults for non-.apps. I think this is better than having .apps use both code paths. 2008-08-10 21:06:18 -07:00
Andy Matuschak 7ce078eb16 Fixes 356328
Sparkle will now clean up the hsot app's name and version before sending it as the user agent string; some non-ASCII characters were causing problems before.

Additionally, Sparkle now uses the bzr revision encoded in the framework's CFBundleVersion as the version it sends for itself in the user agent string; before this value was hardcoded, which was dumb.
2008-08-10 18:23:32 -07:00
Andy Matuschak f9dda21088 Fixes 255399
Giving clients a chance to make multiple preference changes before they take effect.
2008-08-10 17:32:40 -07:00
Andy Matuschak 00c5ae4a42 Changing localized release notes behavior slightly: release note keys which are not tagged with an xml:lang attribute are no longer assumed to be English. So if the user has a foreign language anywhere in their preferred languages list, even if English is higher, release notes keyed to "da" will be picked before release notes not keyed to any language. 2008-08-04 20:58:54 -07:00
Andy Matuschak d73d8333a1 Changing the behavior of the level of Sparkle's update window for the case of an LSUIElement. In that case, I think it's best for Sparkle to use NSFloatingWindowLevel, so that it's clear why the menu items are disabled (due to modality) when they click the menu icon again, thus focusing the update alert. We'll see how well this works. 2008-08-03 01:15:56 -07:00
Andy Matuschak 9c720fd6b7 Updated Russian localization courtesy Alexander Bykov. Thanks! 2008-08-03 00:40:28 -07:00
Andy Matuschak 7228235ce3 Fixes 253929
Fixed a workaround for using registered user defaults on Tiger that I managed to break. Go me!
2008-08-03 00:30:37 -07:00
Andy Matuschak 5684a1477e Fixes 253967
SUDSAVerifier now inherits from NSObject; missed that very important step! Oops!
2008-08-01 22:25:00 -07:00
Andy Matuschak 347dd73269 Fixes 253739
When checking to see if an app is an LSUIElement, Sparkle now checks the info dictionary of the main bundle instead of the info dictionary of the host bundle. That didn't work at all for plugins.
2008-08-01 00:12:44 -07:00
Andy Matuschak a14850458d Fixes 252986
Adds support for xml:lang to pick localized nodes in appcasts (for release notes, etc)
2008-07-31 23:59:12 -07:00
Andy Matuschak e249e3cfb6 Fixes 253187
Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
2008-07-30 23:37:56 -07:00
Andy Matuschak d1c0978ee5 As discussed in https://bugs.launchpad.net/sparkle/+bug/243884/comments/11, this patch makes it so that system profiling is only submitted to the server once per week. This will normalize clients' users: those which check daily won't count much more than those which check weekly. Thanks to David Smith for the patch. 2008-07-30 23:14:39 -07:00
David Smith e3226d3511 A cleaned up and tested version of the one-submit-per-week code 2008-07-30 01:30:11 -07:00
Andy Matuschak ae7c416f16 Actually added the Russian lprojes
Changed the fr_ca localization folder to fr_CA.
2008-07-30 00:40:36 -07:00
Andy Matuschak 1456fa0f75 Updated Russian localization (courtesy Alexander Bykov and Anton Sotkov), though it's still slightly out of date from the most recent string changes
Updated French localization (courtesy Ronald Leroux and Yann Ricquebourg)
The fr_ca localization is now linked to the French localization.
2008-07-30 00:36:45 -07:00
Andy Matuschak d6acd07d5c Fixes 252733
The status window's progress bar now animates even when indeterminate.
2008-07-29 23:58:57 -07:00
Andy Matuschak d8149e9eb0 Fixes 253145
Fixed a stupid typo in the +[SUUpdater updaterForBundle:] method.
2008-07-29 22:54:39 -07:00
Andy Matuschak d6557e21a0 Turning on SEPARATE_STRIP in hopes of fixing things for older versions of Xcode. 2008-07-29 08:31:37 -07:00
Andy Matuschak 3bccef8d22 Fixes 251963
SUAppcastItem now copies the properties dictionary it's given for safety.
2008-07-28 21:55:07 -07:00
Andy Matuschak a27e8316fe Made the aggressive stripping only apply to the framework, since some people were having trouble with relaunch with that configuration. 2008-07-28 21:14:13 -07:00
Andy Matuschak b419948c8d Forgot to tell the Sparkle-GC configuration about Sparkle.pch. 2008-07-25 08:53:57 -07:00
Andy Matuschak 211555639d Removed potentially dangerous KVO magic. 2008-07-25 08:46:46 -07:00
Andy Matuschak 46125abdeb Updated French localization courtesy Ronald Leroux
Updated German localization courtesy Sven-S. Porst
2008-07-24 21:10:22 -07:00
Andy Matuschak 69e4e7cc49 Last few bits from the rearchitecting branch... 2008-07-24 20:49:48 -07:00
Andy Matuschak fe9dedb9ad 4300+-line merge! This will probably break the world.
Merging in rearchitecting work done in lp:~andymatuschak/sparkle/rearchitecting. There are some MAJOR compatibility issues you'll notice if you do most non-default things with Sparkle, so please read the commit log. Delegate methods are changed and most API is private now, to summarize.
2008-07-24 20:44:27 -07:00
Andy Matuschak 47e6a96800 Stripping framework thoroughly after release builds. This will probably bite me in the ass when I get some crash report and its contents are totally useless. 2008-07-24 20:36:24 -07:00
Andy Matuschak f42fb51952 Made automaticallyChecksForUpdates and updateCheckInterval KVO-compliant. 2008-07-24 20:15:04 -07:00
Andy Matuschak 1aea1b699a The Sparkle preference keys are now declared private / deprecated / allowed to change without me receiving hate email. However! SUUpdater is now KVC-compliant for:
automaticallyCheckForUpdates
updateCheckInterval
feedURL
2008-07-24 20:11:09 -07:00
Andy Matuschak e769ba58cc Reordered Sparkle.h to emphasize SUUpdater.h
Removed reference to the RSS class from SUAppcast.h
2008-07-24 19:35:29 -07:00
Andy Matuschak f815eec2c0 Fixes 243884
Made Sparkle.h no longer a massive multi-headed abomination: now only SUAppcastItem, SUAppcast and SUUpdater (and SUVersionComparisonProtocol because it's part of the delegate protocol) are public.

COMPATIBILITY ISSUE:
This means there's no longer a public SUProbingUpdateDriver or a checkForUpdatesWithDriver: method. Now use checkForUpdateInformation. I may change that API before release, though. I'm thinking it might be better to give the delegate the opportunity to reject a potential update instead: then you'd just call checkForUpdatesInBackground and override that delegate method to always return NO. We'll see.
2008-07-23 23:40:01 -07:00
Andy Matuschak de9be8b481 Fixes 244428
Removed all Cocoa categories from Sparkle by integrating things into other classes or making categories on existing Sparkle classes. Whoo!
2008-07-23 22:49:47 -07:00
Andy Matuschak 7454b8f2f6 Small changes for clarity. 2008-07-23 21:42:32 -07:00
Andy Matuschak b4c7dbe478 Added a guard to the piped unarchiver to fail more gracefully for bad filenames of very short length. 2008-07-23 20:54:10 -07:00
Andy Matuschak e14727dcc3 More reliable bzr revision labeling script (shouldn't break the compilation). 2008-07-23 20:41:49 -07:00
Andy Matuschak ac4e4e405b Fixes 245991
COMPATIBILITY ISSUE:
Changed updatePreferencesChanged to resetUpdateCycle to give better semantics for bundle-ish apps which need to start the update cycle manually since applicationDidFinishLaunching: won't do the right thing.
2008-07-23 20:27:01 -07:00
Andy Matuschak 898216ac9f Final fix for 246469 (I hope). Fixed a mind-bogglingly stupid typo which Xcode let compile for some reason. 2008-07-23 12:36:59 -07:00
Andy Matuschak c42e3a3f47 Fixed 251010
Fixes from Matt Stevens:
"For background applications (menu bar, completely UI-less, etc) there are a couple of issues with Sparkle notifications:

- When prompts such as the initial prompt to enable update checking are displayed they can be hidden behind other windows since the background app is not in focus. This can cause problems, as these prompts run modally and can stop the application from functioning without the user knowing why.

- If the update notification window is displayed and the user clicks away to another application, the window disappears and there is no way to get it back since there is no other UI to cause the app to activate. In this case the update should probably operate as a standard window since it is effectively operating as the application's UI."
2008-07-22 22:36:09 -07:00
Matt Stevens cec9166956 Improved notification handling for otherwise UI-less background applications. 2008-07-22 20:24:12 -06:00
Andy Matuschak 675c66ff9d Fixes 250170
Sparkle now remembers to call the delegate's didFindValidUpdate method when using a UI-based update controller. Thanks, Stefan Schimanski!
2008-07-21 23:40:52 -07:00
Andy Matuschak 962a110b16 Merged in the branch moving Sparkle back to literal path extensions from UTIs. 2008-07-21 23:18:21 -07:00
Andy Matuschak 405410b8c8 Updates to the French localization courtesy Ronald Leroux. 2008-07-21 23:16:11 -07:00
Andy Matuschak 32e014af06 Actually added the Swedish localization to the Xcode project. Oops. 2008-07-21 21:07:06 -07:00
Andy Matuschak 0af86bbb9d Hopefully actually fixing 246469: it seems that while Cocoa documents its use of gzip as having the MIME type "application/gzip", it actually uses (what it's supposed to) "application/x-gzip". 2008-07-21 20:55:04 -07:00
Andy Matuschak a31dc3a102 Fixes BOOL user defaults lookup for registered defaults on Tiger. 2008-07-17 21:19:07 -07:00
Andy Matuschak 7b212ea7fd Fixes 247749
SULocalizedString now uses a hardcoded identifier for Sparkle instead of trying to detect it with bundleForClass:[self class]. A little more robust, a little more brittle.
2008-07-17 00:27:17 -07:00
Andy Matuschak b3f3944495 Fixes 244857
Made a first crack at redifining the SUUpdater delegate protocol. Still not sure about a couple things, so please don't change your delegate methods to conform until this gets merged into trunk.

Also made the SUUpdateDrivers not have the updater's delegate as their delegate (that was really icky). Now they're just coupled with the SUUpdater, which is icky as well, but less icky, at least.
2008-07-16 23:51:39 -07:00
Andy Matuschak 58a05e2ee7 Fixes 243533 (for real this time, I hope)
I've undone all the UTI nonsense: I don't see any reason to use it if the underlying frameworks are just going to do dumber path extension comparison that what I'm already doing. I've switched back to the tried-and-true method.

I also made SUUnarchiver* path-based instead of NSURL-based because I realized that the latter didn't make any sense given that we're only unarchiving local files.
2008-07-16 22:48:10 -07:00
Andy Matuschak 3146ffb8e1 Fixes 248929, 244738
Removed NSWorkspace+RBAdditions: we're now checking if the volume is read-only instead of specifically whether it's a disk image.

This also means the warning string changed. Sorry, localizers!
2008-07-16 22:15:29 -07:00
Andy Matuschak b815ce9db4 Making *really* sure that "checking for updates..." window gets closed in all cases. 2008-07-16 21:14:43 -07:00
Andy Matuschak b14aa16a23 Merging in Swedish localization courtesy Daniel Bergman. Thanks! 2008-07-16 20:17:04 -07:00
Andy Matuschak 4397d85727 Merging crazy refactoring branch up to trunk. 2008-07-15 23:30:37 -07:00
Andy Matuschak 98832c4914 Beginnings of insane SUHost-based refactoring to get rid of NSBundle+Sparkle. More super-unstable refactorings to come... 2008-07-15 23:26:06 -07:00
Andy Matuschak 720269b118 Fixes 248581
Now putting the license in the resources folder of the built Sparkle.framework.
2008-07-15 21:53:13 -07:00
Andy Matuschak c9bd13213b Fixes 246469
This should fix the DSA-signing-on-tar-gzs issue. Sparkle now doesn't let NSURLDownload extract .gzips for us, which was making the data being verified different from the data being signed.
2008-07-15 21:36:48 -07:00
Andy Matuschak 5fdddaeede Slight project-y tweaks: now only building the host arch for development. 2008-07-15 21:00:07 -07:00
Andy Matuschak 8570539aab Hopefully finally fixing 245744; it wasn't fixed by the previous revision that claimed it was. There was a tricksy subclassing nuance that eluded me. 2008-07-15 20:57:57 -07:00
Andy Matuschak f4c6738793 Added a comment to strings appearing in the status window noting that since the status window nib is unlocalized, localizers should be careful not to make their strings too long.
Changed a French status string to fit in the status window.
2008-07-09 19:47:58 -07:00
Andy Matuschak e018ee98d3 Added Italian localization courtesy Michele Longhi. Thanks, Michele! 2008-07-09 00:33:33 -07:00
Andy Matuschak 95aabd561b Fixed the old-style em-dash in the French localization; fixed localization handling for B/KB/MB/GB by moving the code in the NSNumber category (which wouldn't work because it couldn't find the Sparkle localization table) to SUUIBasedUpdateDriver. 2008-07-08 22:24:16 -07:00
Andy Matuschak a1b295c2c9 Center the "checking for updates..." window when summoned. 2008-07-08 19:40:26 -07:00
Andy Matuschak bc7aff3f11 If Sparkle can't parse one item, it no longer fails the entire appcast. 2008-07-08 19:39:00 -07:00
Andy Matuschak dc249c1ec5 Fixes 246805
Sparkle no longer calls it a critical failure if it can't read a file on a DMG (like for .Trashes).
2008-07-08 19:37:16 -07:00
Andy Matuschak 660228fb0e Fixes 245744
Fixed a bug where the user-initiated updater could abort through abnormal means, making the "checking for updates..." window never able to go away.
2008-07-05 14:08:31 -07:00
Andy Matuschak 57c1f3e067 Bumped version number to 1.5b4. Siiigh... 2008-07-05 12:32:00 -07:00
Andy Matuschak 6ed9ae4bb9 Fixed 245874
This was indicative of a much greater problem! A missing comma totally broke piped unarchiving, and somehow neither the compiler nor I caught it before the release. 1.5b4, here we come...
2008-07-05 12:23:58 -07:00
Andy Matuschak 752f754bb2 Removed a silly log message. 2008-07-05 11:59:45 -07:00
Andy Matuschak 44a547341d Now reporting 64-bit capability of the host system.
Showing GHz to the user instead of MHz for the clock speed reading.
2008-07-05 11:46:06 -07:00
Andy Matuschak c3f2c693a2 Bumped Sparkle version number in user agent string. 2008-07-05 11:36:32 -07:00
David Smith 918217f6d2 Detect 64 bit support and a) report that, b) use it to tell Core 2 from Core 2008-07-04 16:22:06 -07:00
Andy Matuschak bbdc432a20 More work on 243533; Sparkle should now work with bzips made by Stuffit. Thanks for the detective work, Peter Hosey! 2008-07-04 11:04:38 -07:00
Andy Matuschak 5ba9562b17 Merged in Dominik Tobschall's German localization. Thanks, Dominik! 2008-07-04 11:02:02 -07:00
Dominik fabfdcd178 merged with trunk 2008-07-04 18:56:22 +02:00
Dominik 33fac1c5af added missing Sparkle.strings 2008-07-04 10:29:08 +02:00
Andy Matuschak d60b87d98e Modified my fix to 244761 (custom version comparators) slightly to make it so that the system version requirement comparison is still performed by SUStandardVersionComparator. I don't think that's something people should be changing the behavior of. 2008-07-03 22:27:12 -07:00
Andy Matuschak c7881dec35 Fixes 244767
Simple fix to a dumb mistake which prevented Sparkle from using the default application icon for bundles which didn't have one.
2008-07-03 22:24:01 -07:00
Andy Matuschak df0178e2de Fixed 243533
This should fix the .tar.bz2 and .tar.gz cases. Basically, Launch Services isn't smart enough to see both parts of the extension. When it sees a .bz2 or a .gz, I assume it's a .tar.bz2 or a .tar.gz, because that's what makes sense. Don't use plain .bz2 or .gzs!
2008-07-03 00:14:06 -07:00
Andy Matuschak aaa60d261d Fixed 244761
Added a delegate method:
- (id <SUVersionComparison>)versionComparatorForHostBundle:(NSBundle *)hb;

Override this to specify a custom SUVersionComparison implementor to be used.
2008-07-02 23:54:05 -07:00
Andy Matuschak 88ab4b6f52 Fixes 244675
Arrrgh, Apple changed the .zip UTI between Tiger and Leopard. Now making the unarchiver recognize a UTI which both conform to.
2008-07-02 23:39:50 -07:00
Andy Matuschak f9d3dbfa61 Fixes 244692:
Sparkle crashes on Tiger due to a double-release in SUUserDefaults.
2008-07-02 23:31:20 -07:00
Andy Matuschak 41d05dd922 Fixes 236450
No longer releasing the SUUpdater delegate on dealloc. That was a silly mistake.
2008-07-02 20:34:05 -07:00
Andy Matuschak 82c2448321 Fixes 244419
Now removing the RSS class and and NSString+extras to be replaced by a much simpler implementation based on NSXMLDocument directly in SUAppcast! But this will probably break things for certain edge-case appcasts, so please file bugs if things no longer work for you.

Thanks to Christiaan Hofman for the patch!
2008-07-02 20:31:18 -07:00
Andy Matuschak a67b546a02 Fixes 244726
Fixed a typo in a respondsToSelector call which caused the shouldPromptForPermissionToCheckForUpdatesToHostBundle: method not to work in 1.5b2.
2008-07-02 20:05:29 -07:00
Dominik 842d318277 updated german localization (nibs) 2008-07-02 00:08:47 +02:00
Andy Matuschak 251706d646 Fixed a serious bug which could cause a server to DDoS'd in the case of appcast parse failure.
Sparkle now sets the "last checked at" time when it makes the appcast request instead of on successful receipt of an appcast.
2008-06-30 23:21:51 -07:00
Andy Matuschak cbaa635a89 Fixed a crash that could occur when an appcast failed to parse due to a double-release. 2008-06-30 23:18:45 -07:00
Andy Matuschak 0a4bc6576a No longer leaking the NSURLDownload of the update archive.
If the update's aborted mid-download through programmatic means, the download will now be canceled.
2008-06-30 22:19:07 -07:00
Andy Matuschak 9a266ca52e Added checkForUpdatesInBackground back to SUUpdater.h 2008-06-30 22:00:47 -07:00
Andy Matuschak 4b6fc55056 Removed unnecessary @synchronized's. 2008-06-30 21:55:15 -07:00
Andy Matuschak c9bdb6ef04 Tiny refactoring 2008-06-30 21:53:15 -07:00
Andy Matuschak bc52c0141a Made SUUpdateDriver use notifications instead of KVO to let SUUpdater know it's done. 2008-06-30 21:47:38 -07:00
Andy Matuschak b2145b6838 Killed NSURL+Parameters and moved the relevant code into SUUpdater. 2008-06-30 21:21:48 -07:00
Andy Matuschak 74337fb65a Fixed 243883:
Removed the last @try/@catch from my code. Thanks to Christiaan Hofman for the patch.
2008-06-30 20:55:29 -07:00
Andy Matuschak 4ffb7ea64a Added a new string to localize for the case of an unreported download size. 2008-06-30 20:48:14 -07:00
Andy Matuschak 3d7e8c6c95 Fixes 244214
Made Sparkle display sensible data and use an indeterminate progress bar when the server doesn't report an update's file size.
2008-06-30 20:45:54 -07:00
Andy Matuschak 50de4d78e5 Corrected a stupid commit of a test string. 2008-06-30 20:44:58 -07:00
Dominik 14358a8c37 updated german localization 2008-06-30 08:33:35 +02:00
Dominik 9afa5febc2 merged with trunk 2008-06-30 08:23:22 +02:00
Dominik 70e09246ee merged with trunk & updated german localization 2008-06-24 20:10:04 +02:00
Daniel Bergman 4e8e3b9774 Let there be nibs 2008-06-06 02:13:57 +02:00
Daniel Bergman 32129634ee Initial import, no nibs 2008-06-06 02:02:54 +02:00
463 changed files with 29205 additions and 7734 deletions

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
*.pbxuser
.DS_Store
*.perspective*
.svn
+45
View File
@@ -0,0 +1,45 @@
AccessModifierOffset: -4
AlignEscapedNewlinesLeft: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackParameters: true
BreakBeforeBinaryOperators: true
BreakBeforeBraces: Linux
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
#DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: foreach,Q_FOREACH
IndentCaseLabels: true
IndentFunctionDeclarationAfterType: true
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
#PointerAlignment: Right
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
Standard: Cpp03
TabWidth: 4
UseTab: Never
+36
View File
@@ -0,0 +1,36 @@
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.xcuserstate
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
+2
View File
@@ -0,0 +1,2 @@
language: objective-c
script: make travis
+317
View File
@@ -0,0 +1,317 @@
# 1.9.0
* Added SUUpdater delegate method for failures. (Benjamin Gordon)
* Make the error definitions public (C.W. Betts)
* Add support for lzma compressed tarballs (Kyle Fuller)
* Back to SKIP_INSTALL=YES by default (Tony Arnold)
* Properly set install names and rpaths for targets (Jake Petroules)
* Use Library/Caches rather than app support directory (Kornel Lesiński)
* Check for a modal window being onscreen before trying to put up the Sparkle prompt (Alf Watt)
* Fixed crashes on 10.7 (Chris Campbell, Ger Teunis)
* Fixed Sparkle tags parsing (Tamás Lustyik)
* SULog code cleanups (Kevin Wojniak)
* Make sure CFBundleVersion is a semantic version number. (Jake Petroules)
* Replace typedef enums with typedef NS_ENUM to make Swift happier (C.W. Betts)
* Fix warnings under Xcode 6.1 relating the SUUpdateAlert XIB (Tony Arnold)
* Prefer string constants to strings (Jake Petroules)
* Use Info.plist keys instead of macros (Jake Petroules)
* Only export public symbols. (Jake Petroules)
* BinaryDelta: avoid crash with bad paths (Jake Petroules)
* Fixing Swedish translations (Erik Vikström)
* Turkish localization fixes (Emir)
* Proofing of Ukrainian localization (Vera Tkachenko)
# 1.8.0
* New SUDSAVerifier based on up-to-date OS X APIs (Zachary Waldowski)
* Detailed error log for failed signature checks (Kornel Lesiński)
* Converted Sparkle to ARC (C.W. Betts)
* Converted ivars to properties. (Jake Petroules)
* Cocoapod support (Xhacker Liu)
* Quarantine removal on OS X 10.10 (C.W. Betts)
* Updated Japanese localization (1024jp)
* Added Greek localization
# 1.7.1
* Removed option to install unverified updates (Kornel Lesiński)
* Added detailed log when code signing verification fails (Sam Deane)
* Restored original Sparkle icon. (Jake Petroules)
* Switched SUUpdateAlert.xib to AutoLayout (Kornel Lesiński)
* Replace references to andymatuschak.org with sparkle-project.org. (Jake Petroules)
* Several code cleanups, modernizations, fixed warnings and improved code formatting (Jake Petroules)
* Make the repository significantly more organized. (Jake Petroules)
* Xcode project: set organization name and class prefix. (Jake Petroules)
* Link to Foundation and AppKit instead of Cocoa. (Jake Petroules)
* Use new operatingSystemVersion API when available. (Jake Petroules)
* Add .clang-format configuration file for source code formatting. (Jake Petroules)
* Add a target to build Sparkle API documentation using Doxygen. (Jake Petroules)
# 1.7.0
* Dropped support for OS X 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
* Removed use of deprecated functions (Zachary Waldowski)
* Switched to modern Obj-C runtime and new literals syntax
* Removed pre-10.7 code. (C.W. Betts)
* Use more Blocks/libdispatch code. (C.W. Betts)
* Cleaned up and improved security of `generate_keys`/`sign_update` scripts
# 1.6.1
* Removed archive password prompt (Kornel Lesiński)
* (Re)fixes bug where URLs are naively double escaped (Andrew Madsen)
* Fixed typo that caused crashes in BinaryDelta (Tamas Lustyik)
* SUStandardVersionComparator.h is public (Vincent CARLIER)
* Remove pre-10.6-specific code. (C.W. Betts)
* Objective C 2 getters and setters. (C.W. Betts)
* Define correct dependencies on locale scripts (Antonin Hildebrand)
# 1.6.0
* Cleaned up and deleted redundant strings files (Kornel Lesiński)
* Modern Objective C syntax, properties where possible. (C.W. Betts)
* Make SUAppcastDelegate a formal protocol. (C.W. Betts)
* Fixed default font in release notes WebView (Kornel Lesiński)
* Configurable name for finish_installation.app (Kornel Lesiński)
* Removed code for 10.4 (Kornel Lesiński)
* Convert all strings files to UTF-8 (UTF-16 must die) (Kornel Lesiński)
* Removing GC target (Matt Thomas)
* finish_installation.app and pkg files will not removed when we use *.pkg installer and restart system in the installer (Takayama Fumihiko)
* Select Korean and Slovak for Sparkle.strings localization (Shon Frazier)
* Updated the Romanian translation (Gabe)
* pt-BR localization polishing (BR Lingo)
* update zh_CN (61)
* Shut up some warnings & make build with newer Xcode (Uli Kusterer)
* Less unsafety with format strings (Uli Kusterer)
* New icon (Rick Fillion)
* fixed a 'content rectangle not entirely onscreen' warning (Simone Manganelli)
* updated sends system profile to use info.plist if user defaults key isn't present (Jamie Pinkham)
* Support for notifications on some updater events (Doug Russell)
* Allow the delegate to trigger a silent install and relaunch (Matt Stevens)
* Support silent relaunches (Matt Stevens)
* Increment the sudden termination counter if installing on quit (Matt Stevens)
* Prompts the user to update after a week (rather than a day) if he doesn't quit the app (Andy Matuschak)
* Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag (Andy Matuschak)
* We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them. (Andy Matuschak)
# 1.5.0-beta6
* Important Changes
* Sparkle now requires DSA signatures on your updates. Check the documentation for more information on how to set that up if you don't already sign your updates. You can bypass this requirement if you deliver both your appcast and your updates over SSL.
* Sparkle will no longer display release notes located at file:// URLs, since Javascript on such a page would be able to read files on your file system.
* For security reasons, Sparkle will refuse to install updates which appear to "downgrade" the app.
* SUUpdater now implements new keys: "automaticallyDownloadsUpdates", "lastUpdateCheckDate", and "sendsSystemProfile."
* Fixed a bug that could prevent SUProbingUpdateDriver from working.
* Fixed a bug that prevented the updaterWillRelaunchApplication: delegate method from getting called.
* Fixed displaying release notes transmitted "loose" in the <description> key.
* Fixed Sparkle compilation on 10.4 systems.
* Fixed a bug that could cause window confusion if an app changed its LSUIElement at runtime.
* Added support for Sparkle 1.1's behavior of disabling updates when the check interval is 0.
* Sparkle can now handle appending parameters to URLs which already have parameters.
* If an update's sparkle:shortVersionString is the same as the host's CFBundleShortVersionString, the sparkle:version and CFBundleVersion will be presented in parentheticals.
# 1.5.0-beta5
* Important Changes!
* Made every Sparkle class private except for SUUpdater, SUAppcast, SUAppcastItem, and the SUVersionComparisonProtocol.
* There is now a single SUUpdater singleton for every host bundle; instead of -[SUUpdater setHostBundle], you can use +[SUUpdater updaterForBundle].
* Redefined the (entire) delegate protocol accordingly.
* Renamed -[SUUpdater updatePreferencesChanged] to -[SUUpdater resetUpdateCycle]. This provides better semantics for non-apps, which need to start the update cycle manually.
* -[SUUpdater checkForUpdatesWithDriver] is private. If you were using SUProbingUpdateDriver, you can now use -[SUUpdater checkForUpdateInformation] for a similar effect.
* All the user defaults keys are now private; instead, SUUpdater is KVC-compliant for automaticallyChecksForUpdates, updateCheckInterval, and feedURL.
* Reduced the size of the English-only framework by 25%.
* System profiling information is now only submitted to the server once per week; this will help normalize your statistics across users with different interval preferences.
* The feedParamatersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
* Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
* Added support for xml:lang to pick localized nodes in appcasts (for release notes, etc).
* Fixed a bug which would cause the "checking for updates" window to not disappear in certain extraordinary error conditions.
* Fixed a DSA signature checking bug for .tar.gz archives.
* Sparkle now refuses to update on any read-only volume, not just dmgs.
* Sparkle will clean up the host app's name and version before sending it as the user agent string; some non-ASCII characters were causing problems.
* Added an Italian localization courtesy Michele Longhi.
* Added a Swedish localization courtesy Daniel Bergman.
* Fixes to the French localization courtesy Ronald Leroux and Yann Ricqueberg.
* Fixes to the German localization courtesy Sven-S. Porst.
* Fixes to the Russian localization courtesy Alexander Bykov and Anton Sotkov.
* Fixed a number of issues related to archive format detection: I reverted back to extensions from UTIs.
* Focus behavior fixes for LSUIElement apps.
* The status window progress bar now animates even when indeterminate.
* Major refactorings to improve functionality for non-app bundles.
# 1.5.0-beta4
* Fixed a critical bug which prevented non-.dmgs from unarchiving properly.
* Added reporting of 64-bit capability to the profiling system.
# 1.5.0-beta3
* Added a new delegate method to SUUpdater.h to allow delegates to specify custom version comparators.
* Added a German localization, courtesy the Camino localizer team: Dominik Tobschall, Tobias Stohr, and Friedemann Bochow.
* Bug fixes:
* Fixed a serious bug which could cause a server to be DDoS'd (or the host app to crash!) if an appcast fails to be parsed.
* Fixed .tbz extraction if the archive was made with Stuffit.
* Fixed support for .tar.bz2 and .tar.gz; Sparkle has to assume the archive is a tar when it sees "bz2" and "gz"; don't use those without tarring.
* Fixed a typo which caused the shouldPromptForPermissionToCheckForUpdatesToHostBundle: method to not work in 1.5b2.
* Fixed .zip extraction on Tiger (Apple changed the UTI between releases)
* Fixed a crasher on Tiger.
* Fixed display of the default app icon when the host app doesn't have an icon.
* Sparkle now displays a sensible progress string and uses an indeterminate progress bar when the server doesn't report a file size.
* Fixed some memory leaks.
# 1.5.0-beta2
* Compatibility Issues:
* Most of the delegate method selectors have changed to scale better. See SUUpdater.h for changes; you'll likely have to make changes if you implement any delegate methods.
* If you're using .tar.gz or .tar.bz2 archives, name them ".tbz" or ".tgz" instead; Sparkle now uses UTIs for archive detection, and it's not smart about double extensions.
* I'm no longer supporting 10.3. This may or may not work on Panther—probably not.
* Sparkle's no longer built for ppc64 by default. If you want to ship that, feel free to build your own, but this saves a few hundred k.
* Enhancements:
* Sparkle now detects if the preferences for automatic update checks or the time interval change mid-cycle.
* If your product is a non-.app, you need to clue Sparkle in on the change by calling [[SUUpdater sharedUpdater] updatePreferencesChanged].
* Added a cancel to the "checking for updates..." dialog.
* Sparkle now cleans up all its litter in /tmp.
* Made SUUpdater's delegate an IBOutlet so you can hook it up in IB.
* Bug fixes:
* Sparkle no longer crashes on non-GC hosts when the user cancels an update's downloads.
* Sparkle no longer gets stuck in an inconsistent state or crashes when it can't parse the appcast on scheduled updates.
* Added the sharedUpdater method to SUUpdater, as it should have been.
* Fixed a bug where the "checking for updates..." window wouldn't go away if an error occurs while checking for updates.
* Made the dual-mode build configuration actually use the .xcconfig which builds it with GC support. (oops!)
* Fixed relaunching for prefpanes.
* Sparkle no longer fails to install updates on Snow Leopard (though there's still an issue with trashing the old version of the app, but it seems to be a 10.6 bug)
* Sparkle now handles redirects correctly under Tiger.
* Fixed the installation path for non-.app bundles.
* Fixed a bug which could crash Sparkle under non-English locales.
* Fixed a weird race condition which could cause the relaunch tool to never notice that its target relaunched.
* Fixed a bug where if the host app is inactive when an update occurs, the update alert sometimes doesn't become key.
* Minor textual fixes.
* Localizations:
* Dutch: Maarten Van Coile
* French: Yann Ricquebourg
* Spanish: Ernesto Gomez Cereijo
# 1.5.0-beta1
* The most important things to know:
* The 10.3 support is untested at best; sketchy at worst. Test with it thoroughly before you use it.
* Sparkle now asks for permission to update on second launch; don't be surprised at that. You can change that behavior with a delegate method; read SUUpdater.h for more info.
* We no longer distinguish between "check on startup" and "scheduled updates"; everything is scheduled, with the default being every day.
* The test application is using the new profiling features, but that's only for demonstration: these are off by default. More on this later.
* There are no localizations yet.
* New features:
* Sparkle now supports .pkgs. Just name the .pkg the name of the app and put in the update archive.
* Sparkle now sends optional demographic profiling information; set SUEnableSystemProfiling to YES in your Info.plist and check out the GET data sent to your webserver when fetching the appcast. More on this in the documentation. The test application has this on so you can see the behavior.
* Sparkle now supports updating non-.apps. Just call -setHostBundle: on the global SUUpdater to let it know what you're trying to update.
* Sparkle now supports garbage collection in the host app. Use "Sparkle-with-GC.framework" for that, but be aware it's 10.5-only.
* Sparkle is now 64-bit compatible, compiling both ppc64 and x86_64.
* Sparkle now supports a sparkle:minimumSystemVersion key you can set on appcast items. It does what you think it does.
* Sparkle now checks to see if the host app is running from a disk image and refuses to update if it is. (10.4+ only)
* Added support for entities in enclosure paths.
* The file size output is now formatted prettily.
* Sparkle now gives visual indication that it's checking for updates when the update's user initiated. ie: it pops up a status controller saying "checking for updates..."
* Added support for an SUPublicDSAKeyFile, so people don't have to copy/paste their entire key into their Info.plist. Set this key in your Info.plist to the filename of the key in your Resources directory.
* Added an actually maintainable codebase.
* Changes:
* Sparkle version comparison is now dramatically less stupid and verified by a bunch of unit tests. If something doesn't work the way you think it should, add a test to SUVersionComparisonTest.m
* Added a minimum to the check interval so that developers don't accidentally release their apps into the wild with 60-second test check intervals and have DOS-attack-like results. It's an hour now for release mode; feel free to change it.
* The relaunching process now uses a separate helper app, which is a much more robust method.
* Changed CFBundleShortVersionString behavior: Sparkle no longer uses Apple's about box style of displaying ShortVersionString (CFBundleVersion) when the latter is available.
* No more MD5 checking. Use DSA: it's actually secure.
* The abomination that was SUStatusChecker is dead. Use SUProbingUpdateDriver instead.
* Bugfixes:
* Fixed a huge bug with fully-automatic updating: before, if the user chose to relaunch later, the app would be running from the trash for a while. Now the buttons are "install and relaunch" or "install later."
* Sparkle forces Spotlight to reindex the updated app so that it won't keep pointing to the one in the trash.
* Sparkle trims whitespace from around DSA signatures; this could cause crashes before.
* Fixed a bug where the user choosing to skip a version would inhibit future automatic updates until the next launch.
* Fixed a bug that could occur when the app has a localized CFBundleName.
* .dmgs now work on Leopard.
* The status controller's button now sizes appropriately to the localization.
* Sparkle now works correctly with LSUIElement apps: it focuses them before displaying the update alert.
* Sparkle now deletes failed partial downloads.
* The update alert no longer floats above everything in the app.
* Fixed varied and sundry memory leaks.
* A ton of other things that I've forgotten or were too small to mention!
# 1.1
* Optimized framework size: now only 1.4mb with all localizations and 384kb with only English (an English-only version is in the Extras folder).
* Added a new SUStatusChecker class for programmatically determining if a new version is available (see the docs); thanks, Evan Schoenberg!
* Added support for apps using SIGCHLD; thanks, Augie Fackler!
* Added a zh_CN update from JT Lee
* Added a Polish update from Piotr Chylinski
* Fixed DMG support for images with /Applications symlinks.
* Fixed a really stupid interval-checking bug that could cause repeated hits to the appcast.
* Fixed a bug where the check interval would be inconsistent if a value of 0 was stored in the user defaults.
# 1.0
* Additions:
* Added real version comparison courtesy Kevin Ballard: Sparkle now knows that 0.89 < 1.0a3 < 1.0.
* Added many localizations courtesy David Kocher's localization team.
* Added a much better installation mechanism courtesy Allan Odgaard.
* Added a user agent string to the RSS fetch request.
* Added support for CFBundleShortVersionString in addition to CFBundleVersion, and support for a sparkle:shortVersionString attribute on the enclosure.
* Added support for CFBundleDisplayName if available.
* Changes:
* Automatic updating is now allowed by default, but only if DSA signing is on.
* Pressing Escape or closing the update alert now reminds the user later.
* Now when there's a stored check interval, Sparkle doesn't check immediately on startup the first time the app is launched because the user hasn't consented to it yet.
* The update alert now remembers its size and floats.
* Bug Fixes:
* Fixed installation of DMGs with multiple files enclosed.
* Fixed a nasty memory leak.
* Fixed a bug wherein having no value for allowing automatic updates would display a checkbox for the updates but would not honor it.
* Fixed a bug in zip extraction that occurred in Panther.
* Fixed release notes caching.
* Fixed a bug wherein Sparkle refused to authenticate the installation if the user had cancelled authentication previously in that session.
* Fixed a weird bug that would cause a second help menu to appear on first launch.
* Fixed a bug that could occur when changing the scheduled check interval.
* Fixed a bug wherein the host app could crash if the user clicked Remind Me Later before the release notes finished loading.
* Fixed a bug wherein the behavior was undefined if the user manually initiated a check when an automatic one was already taking place.
* Fixed wrapping on the description field in the update alert.
# 1.0-beta3
* Fixed a nasty crasher that occurred often when the user was not connected to the internet.
# 1.0-beta2
* Major Improvements:
* Fully automatic updating! (see the Documentation: this is beta and off by default)
* Added support for DSA signatures (see the Documentation).
* Added support for MD5 sum verification.
* Added Security.framework-based authentication for installing to privileged directories.
* Huge refactoring of the codebase: there's now a Sparkle Xcode project, Sparkle is now a framework, and everything is modular / abstracted. And no more code-generated interface.
* Minor Improvements:
* A SUUpdaterWillRestartNotification is sent out before restarting now.
* Added key equivalents to alert panel buttons.
* Error handling is much prettier now: technical messages are not presented to the user anymore.
* There's now a test app for developers to see what Sparkle's like before using it.
* Wrote new, pretty, extremely thorough documentation.
* Bug Fixes:
* Relaunch behavior is much improved and shouldn't fail in huge apps anymore.
* Fixed a bug wherein a failing tar command could crash the host app.
* Sparkle now looks at InfoPlist.strings in addition to Info.plist.
* Fixed some stupid typos.
# 1.0-beta1
* Major New Features:
* Sparkle now supports scheduled periodic updates—read the Readme for information on how to use it.
* Sparkle now supports WebKit-based release notes (for CSS and full HTML), which it displays in the main update alert, not a separate panel. The Readme has much more information. Sparkle will, of course, fall back on NSTextView if the host app does not include WebKit.
* Minor New Features:
* Added support for .zip update archives.
* Added support for .dmg update archives.
* Implemented Remind Me Later to replace simple update cancellation.
* Implemented Skip This Version functionality.
* Added support for multiple feeds via the user defaults SUFeedURL key taking precedent over the one in Info.plist.
* Added support for Sparkle's custom XML namespace, which is optional but may prove useful. See the Readme for more information.
* Bug Fixes:
* Sparkle will no longer enter an inconsistent state if the user tries to update again while one is already in progress.
* Sparkle now uses CFBundleName to determine the application's name instead of the app's filename.
* Sparkle no longer crashes if the user cancels during extraction.
* Lots of code refactoring.
# 0.1
* Initial Release
@@ -0,0 +1,3 @@
// BinaryDelta tool only
PRODUCT_NAME = BinaryDelta
@@ -0,0 +1,2 @@
#include "ConfigBinaryDelta.xcconfig"
@@ -0,0 +1 @@
#include "ConfigBinaryDelta.xcconfig"
+65 -27
View File
@@ -1,38 +1,76 @@
// Common
PREBINDING = NO
ZERO_LINK = NO
CURRENT_PROJECT_VERSION = 1.5
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.3
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
GCC_C_LANGUAGE_STANDARD = c99
GCC_ENABLE_OBJC_EXCEPTIONS = YES
SPARKLE_BUNDLE_IDENTIFIER = org.andymatuschak.Sparkle
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
SPARKLE_APPEND_VERSION_NUMBER = 1
// Sparkle usually doesn't allow downgrades as they're usually accidental, but
// if your app has a downgrade function or URL handler, turn this on
SPARKLE_AUTOMATED_DOWNGRADES = 0
// If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it
// in place, giving you an app named 1.1b4 that is actually 1.2. Turn the
// following on to always reset the name back to "MyApp":
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
SPARKLE_VERSION_MAJOR = 1
SPARKLE_VERSION_MINOR = 9
SPARKLE_VERSION_PATCH = 0
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
ALWAYS_SEARCH_USER_PATHS = NO
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h
GCC_FAST_OBJC_DISPATCH = YES
GCC_FAST_OBJC_DISPATCH[arch=ppc] = NO // requires 10.4
GCC_PREFIX_HEADER = Sparkle/Sparkle.pch
GCC_SYMBOLS_PRIVATE_EXTERN = YES
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
ARCHS = $(ARCHS_STANDARD)
MACOSX_DEPLOYMENT_TARGET = 10.7
GCC_PREPROCESSOR_DEFINITIONS = SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\"
CLANG_ENABLE_OBJC_ARC = YES
// Enable warnings
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES
GCC_WARN_SHADOW = YES
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
CLANG_WARN_DOCUMENTATION_COMMENTS = YES
CLANG_WARN_EMPTY_BODY = YES
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES
CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES
CLANG_WARN_OBJC_RECEIVER_WEAK = YES
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_MISSING_PARENTHESES = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES
GCC_WARN_PEDANTIC = YES
GCC_WARN_SHADOW = YES
GCC_WARN_SIGN_COMPARE = YES
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
GCC_WARN_STRICT_SELECTOR_MATCH = YES
GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNKNOWN_PRAGMAS = YES
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_LABEL = YES
GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_UNUSED_VARIABLE = YES
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
WARNING_CFLAGS = -Wall
// These should be removed once the conversion to ARC is complete
WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties
// Turn on all warnings, then disable a few which are almost impossible to avoid
WARNING_CFLAGS = -Wall -Weverything -Wno-empty-translation-unit -Wno-unused-macros -Wno-gnu-statement-expression -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wno-auto-import $(WARNING_CFLAGS_EXTRA)
+5 -2
View File
@@ -1,8 +1,11 @@
#include "ConfigCommon.xcconfig"
// Debug only
GCC_OPTIMIZATION_LEVEL = 0
DEBUG_INFORMATION_FORMAT = dwarf
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
SPARKLE_EXTRA_DEBUG = -DDEBUG -fstack-protector -D_FORTIFY_SOURCE=2
SPARKLE_EXTRA_DEBUG = -DDEBUG
OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG)
ARCHS = $(NATIVE_ARCH_ACTUAL)
ONLY_ACTIVE_ARCH = YES
COPY_PHASE_STRIP = NO
+4 -3
View File
@@ -1,9 +1,10 @@
#include "ConfigCommon.xcconfig"
// Release only
GCC_OPTIMIZATION_LEVEL = s
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
GCC_GENERATE_DEBUGGING_SYMBOLS = NO
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
DEAD_CODE_STRIPPING = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
GCC_TREAT_WARNINGS_AS_ERRORS = NO
GCC_WARN_UNINITIALIZED_AUTOS = YES
ARCHS = ppc i386 x86_64
+7 -5
View File
@@ -1,10 +1,12 @@
// Framework only
INSTALL_PATH = @executable_path/../Frameworks
DYLIB_COMPATIBILITY_VERSION = 1.5
DYLIB_CURRENT_VERSION = 1.5
DYLIB_INSTALL_NAME_BASE = @rpath
DYLIB_COMPATIBILITY_VERSION = 1.6
DYLIB_CURRENT_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
PRODUCT_NAME = Sparkle
WRAPPER_EXTENSION = framework
OTHER_LDFLAGS = -lcrypto
FRAMEWORK_VERSION = A
INFOPLIST_FILE = Info.plist
INFOPLIST_FILE = Sparkle/Sparkle-Info.plist
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BUILDING_SPARKLE=1
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
SKIP_INSTALL = YES
@@ -1,5 +1,2 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonDebug.xcconfig"
#include "ConfigFramework.xcconfig"
OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
@@ -1,3 +1,2 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonRelease.xcconfig"
#include "ConfigFramework.xcconfig"
@@ -1,3 +0,0 @@
#include "ConfigFrameworkRelease.xcconfig"
GCC_ENABLE_OBJC_GC = supported
+5 -1
View File
@@ -1,3 +1,7 @@
// Relaunch Tool only
PRODUCT_NAME = relaunch
INFOPLIST_FILE = Sparkle/Autoupdate/Autoupdate-Info.plist
PRODUCT_NAME = $(SPARKLE_RELAUNCH_TOOL_NAME)
SKIP_INSTALL = YES
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
@@ -1,5 +1 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonDebug.xcconfig"
#include "ConfigRelaunch.xcconfig"
OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
@@ -1,3 +1 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonRelease.xcconfig"
#include "ConfigRelaunch.xcconfig"
+4 -1
View File
@@ -1,5 +1,8 @@
// Test Application only
INFOPLIST_FILE = Test Application/Test Application-Info.plist
INFOPLIST_FILE = TestApplication/TestApplication-Info.plist
PRODUCT_NAME = Sparkle Test App
WRAPPER_EXTENSION = app
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
CLANG_ENABLE_OBJC_ARC = NO
LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks
@@ -1,5 +1,2 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonDebug.xcconfig"
#include "ConfigTestApp.xcconfig"
OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
@@ -1,3 +1 @@
#include "ConfigCommon.xcconfig"
#include "ConfigCommonRelease.xcconfig"
#include "ConfigTestApp.xcconfig"
+10
View File
@@ -0,0 +1,10 @@
// Unit Test only
INFOPLIST_FILE = Tests/SparkleTests-Info.plist
PRODUCT_NAME = Sparkle Unit Tests
WRAPPER_EXTENSION = xctest
OTHER_CFLAGS = $(inherited) -iframework"$(DEVELOPER_FRAMEWORKS_DIR)" -iframework"$(PLATFORM_DIR)/Developer/Library/Frameworks"
GCC_SYMBOLS_PRIVATE_EXTERN = NO
WARNING_CFLAGS = $(inherited) -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments
FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)
LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks
@@ -0,0 +1 @@
#include "ConfigUnitTest.xcconfig"
@@ -0,0 +1 @@
#include "ConfigUnitTest.xcconfig"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
set -e
if [ "$ACTION" = "" ] ; then
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
rm -f "Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
# Only copy dSYMs for Release builds, but don't check for the presence of the actual files
# because missing dSYMs in a release build SHOULD trigger a build failure
if [ "$CONFIGURATION" = "Release" ] ; then
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
fi
cd "$CONFIGURATION_BUILD_DIR/staging"
# Sorted file list groups similar files together, which improves tar compression
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$CURRENT_PROJECT_VERSION.tar.bz2" --files-from=-
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
fi
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
set -e
if ! which -s git ; then
exit 0
fi
if [ -z "$SRCROOT" ] || \
[ -z "$BUILT_PRODUCTS_DIR" ] || \
[ -z "$INFOPLIST_PATH" ] || \
[ -z "$CURRENT_PROJECT_VERSION" ]; then
echo "$0: Must be run from Xcode!" 1>&2
exit 1
fi
# Get the current Git master hash
version=$(cd "$SRCROOT" ; git show-ref --abbrev heads/master | awk '{print $1}')
if [ -z "$version" ] ; then
echo "$0: Can't find a Git hash!" 1>&2
exit 0
fi
version="$CURRENT_PROJECT_VERSION git-$version"
# and use it to set the CFBundleShortVersionString value
export PATH="$PATH:/usr/libexec"
PlistBuddy -c "Set :CFBundleShortVersionString '$version'" \
"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
+1
View File
@@ -0,0 +1 @@
html
+20
View File
@@ -0,0 +1,20 @@
PROJECT_NAME = Sparkle
PROJECT_NUMBER = 1.7.1
PROJECT_BRIEF = "A software update framework for OS X"
PROJECT_LOGO = Resources/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png
RECURSIVE = YES
INPUT = Sparkle
OUTPUT_DIRECTORY = Documentation
GENERATE_HTML = YES
GENERATE_LATEX = NO
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST = YES
GENERATE_TODOLIST = YES
ALPHABETICAL_INDEX = YES
QT_AUTOBRIEF = YES
WARN_IF_UNDOCUMENTED = NO
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
if [ "$ACTION" = "" ] ; then
if which -s doxygen ; then
doxygen Documentation/Doxyfile
else
echo "warning: Doxygen not found in PATH"
fi
elif [ "$ACTION" = "clean" ] ; then
rm -rf "$SRCROOT/Documentation/html"
fi
+57
View File
@@ -0,0 +1,57 @@
Copyright (c) 2006-2013 Andy Matuschak.
Copyright (c) 2009-2013 Elgato Systems GmbH.
Copyright (c) 2011-2014 Kornel Lesiński.
Copyright (c) 2014 C.W. Betts.
Copyright (c) 2014 Petroules Corporation.
Copyright (c) 2014 Big Nerd Ranch.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=================
EXTERNAL LICENSES
=================
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
Copyright (c) 2003-2005 Colin Percival.
SUDSAVerifier.m:
Copyright (c) 2011 Mark Hamlin.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-7
View File
@@ -1,7 +0,0 @@
Copyright (c) 2006 Andy Matuschak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18 -4
View File
@@ -1,7 +1,21 @@
.PHONY: all localizable-strings
.PHONY: all localizable-strings release build test travis
BUILDDIR := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")
localizable-strings:
rm en.lproj/Sparkle.strings || TRUE
genstrings -o en.lproj -s SULocalizedString *.m *.h
mv en.lproj/Localizable.strings en.lproj/Sparkle.strings
rm -f Sparkle/en.lproj/Sparkle.strings
genstrings -o Sparkle/en.lproj -s SULocalizedString Sparkle/*.m Sparkle/*.h
iconv -f UTF-16 -t UTF-8 < Sparkle/en.lproj/Localizable.strings > Sparkle/en.lproj/Sparkle.strings
rm Sparkle/en.lproj/Localizable.strings
release:
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
open -R "$(BUILDDIR)/Build/Products/Release/Sparkle-"*.tar.bz2
build:
xcodebuild clean build
test:
xcodebuild -scheme Distribution -configuration Debug test
travis: test
-59
View File
@@ -1,59 +0,0 @@
//
// NSBundle+SUAdditions.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef NSBUNDLE_PLUS_ADDITIONS_H
#define NSBUNDLE_PLUS_ADDITIONS_H
#import <Cocoa/Cocoa.h>
@interface NSBundle (SUAdditions)
/*!
@method
@abstract Returns a name for the bundle suitable for display to the user.
@discussion This is performed by asking NSFileManager for the display name of the bundle.
*/
- (NSString *)name;
/*!
@method
@abstract Returns the current internal version of the bundle.
@discussion This uses the CFBundleVersion info value. This string is not appropriate for display to users: use -displayVersion instead.
*/
- (NSString *)version;
/*!
@method
@abstract Returns the bundle's version, suitable for display to the user.
@discussion If the CFBundleShortVersionString is available and different from the CFBundleVersion, this looks like CFBundleShortVersionString (CFBundleVersion). If the version strings are the same or CFBundleShortVersionString is not defined, this is equivalent to -version.
*/
- (NSString *)displayVersion;
/*!
@method
@abstract Returns a suitable icon for this bundle.
@discussion Uses the CFBundleIconFile icon if defined; otherwise, uses the default application icon.
*/
- (NSImage *)icon;
/*!
@method
@abstract Returns whether the application is running from a disk image.
*/
- (BOOL)isRunningFromDiskImage;
/*!
@method
@abstract Returns a profile of the users system useful for statistical purposes.
@discussion Returns an array of dictionaries; each dictionary represents a piece of data and has keys "key", "visibleKey", "value", and "visibleValue".
*/
- (NSArray *)systemProfile;
- (NSString *)publicDSAKey;
@end
#endif
-89
View File
@@ -1,89 +0,0 @@
//
// NSBundle+SUAdditions.m
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "NSBundle+SUAdditions.h"
#ifndef NSAppKitVersionNumber10_4
#define NSAppKitVersionNumber10_4 824
#endif
@implementation NSBundle (SUAdditions)
- (NSString *)name
{
NSString *name = [self objectForInfoDictionaryKey:@"CFBundleDisplayName"];
if (name) return name;
name = [self objectForInfoDictionaryKey:@"CFBundleName"];
if (name) return name;
return [[[NSFileManager defaultManager] displayNameAtPath:[self bundlePath]] stringByDeletingPathExtension];
}
- (NSString *)version
{
return [self objectForInfoDictionaryKey:@"CFBundleVersion"];
}
- (NSString *)displayVersion
{
NSString *shortVersionString = [self objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
if (shortVersionString)
return shortVersionString;
else
return [self version]; // Fall back on the normal version string.
}
- (NSImage *)icon
{
// Cache the application icon.
NSString *iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"];
// According to the OS X docs, "CFBundleIconFile - This key identifies the file containing
// the icon for the bundle. The filename you specify does not need to include the .icns
// extension, although it may."
//
// However, if it *does* include the '.icns' the above method fails (tested on OS X 10.3.9) so we'll also try:
if (!iconPath)
iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType: nil];
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
// Use a default icon if none is defined.
if (!icon) { [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)]; }
return icon;
}
- (BOOL)isRunningFromDiskImage
{
// This check causes crashes on 10.3; for now, we'll just skip it.
if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_4)
return NO;
NSDictionary *pathProperties = [[NSWorkspace sharedWorkspace] propertiesForPath:[self bundlePath]];
BOOL isDiskImage = [pathProperties objectForKey:NSWorkspace_RBimagefilepath] != nil;
BOOL isFileVault = [[pathProperties objectForKey:NSWorkspace_RBmntonname] hasPrefix:@"/Users/"];
return isDiskImage && !isFileVault;
}
- (NSString *)publicDSAKey
{
// Maybe the key is just a string in the Info.plist.
NSString *key = [self objectForInfoDictionaryKey:SUPublicDSAKeyKey];
if (key) { return key; }
// More likely, we've got a reference to a Resources file by filename:
NSString *keyFilename = [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
if (!keyFilename) { return nil; }
return [NSString stringWithContentsOfFile:[self pathForResource:keyFilename ofType:nil]];
}
- (NSArray *)systemProfile
{
return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHostBundle:self];
}
@end
-18
View File
@@ -1,18 +0,0 @@
//
// NSFileManager+Aliases.h
// Sparkle
//
// Created by Andy Matuschak on 2/4/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_ALIASES_H
#define NSFILEMANAGER_PLUS_ALIASES_H
#import <Cocoa/Cocoa.h>
@interface NSFileManager (SUAliases)
- (BOOL)isAliasFolderAtPath:(NSString *)path;
@end
#endif
-33
View File
@@ -1,33 +0,0 @@
//
// NSFileManager+Aliases.m
// Sparkle
//
// Created by Andy Matuschak on 2/4/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "NSFileManager+Aliases.h"
@implementation NSFileManager (SUAliases)
- (BOOL)isAliasFolderAtPath:(NSString *)path
{
FSRef fileRef;
OSStatus err = noErr;
Boolean aliasFileFlag, folderFlag;
NSURL *fileURL = [NSURL fileURLWithPath:path];
if (FALSE == CFURLGetFSRef((CFURLRef)fileURL, &fileRef))
err = coreFoundationUnknownErr;
if (noErr == err)
err = FSIsAliasFile(&fileRef, &aliasFileFlag, &folderFlag);
if (noErr == err)
return (BOOL)(aliasFileFlag && folderFlag);
else
return NO;
}
@end
-16
View File
@@ -1,16 +0,0 @@
//
// NSFileManager+Authentication.m
// Sparkle
//
// Created by Andy Matuschak on 3/9/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_AUTHENTICATION_H
#define NSFILEMANAGER_PLUS_AUTHENTICATION_H
@interface NSFileManager (SUAuthenticationAdditions)
- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error;
@end
#endif
-249
View File
@@ -1,249 +0,0 @@
//
// NSFileManager+Authentication.m
// Sparkle
//
// Created by Andy Matuschak on 3/9/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
// This code based on generous contribution from Allan Odgaard. Thanks, Allan!
#import "Sparkle.h"
#import "NSFileManager+Authentication.h"
#import <Security/Security.h>
#import <sys/stat.h>
#import <sys/wait.h>
#import <dirent.h>
#import <unistd.h>
#import "NSFileManager+ExtendedAttributes.h"
static BOOL AuthorizationExecuteWithPrivilegesAndWait(AuthorizationRef authorization, const char* executablePath, AuthorizationFlags options, const char* const* arguments)
{
sig_t oldSigChildHandler = signal(SIGCHLD, SIG_DFL);
BOOL returnValue = YES;
if (AuthorizationExecuteWithPrivileges(authorization, executablePath, options, (char* const*)arguments, NULL) == errAuthorizationSuccess)
{
int status;
pid_t pid = wait(&status);
if (pid == -1 || !WIFEXITED(status) || WEXITSTATUS(status) != 0)
returnValue = NO;
}
else
returnValue = NO;
signal(SIGCHLD, oldSigChildHandler);
return returnValue;
}
@implementation NSFileManager (SUAuthenticationAdditions)
- (BOOL)currentUserOwnsPath:(NSString *)oPath
{
const char *path = [oPath fileSystemRepresentation];
uid_t uid = getuid();
bool res = false;
struct stat sb;
if(stat(path, &sb) == 0)
{
if(sb.st_uid == uid)
{
res = true;
if(sb.st_mode & S_IFDIR)
{
DIR* dir = opendir(path);
struct dirent* entry = NULL;
while(res && (entry = readdir(dir)))
{
if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
continue;
size_t len = strlen(path) + 1 + entry->d_namlen + 1;
char descend[len];
strlcpy(descend, path, len);
strlcat(descend, "/", len);
strlcat(descend, entry->d_name, len);
NSString* newPath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:descend length:strlen(descend)];
res = [self currentUserOwnsPath:newPath];
}
closedir(dir);
}
}
}
return res;
}
- (NSString *)_temporaryCopyNameForPath:(NSString *)path
{
// Let's try to read the version number so the filename will be more meaningful.
NSString *postFix;
NSBundle *bundle;
if ((bundle = [NSBundle bundleWithPath:path]))
{
// We'll clean it up a little for safety.
// The cast is necessary because of a bug in the headers in pre-10.5 SDKs
NSMutableCharacterSet *validCharacters = (id)[NSMutableCharacterSet alphanumericCharacterSet];
[validCharacters formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@".-()"]];
postFix = [[bundle objectForInfoDictionaryKey:@"CFBundleVersion"] stringByTrimmingCharactersInSet:[validCharacters invertedSet]];
}
else
postFix = @"old";
NSString *prefix = [[path stringByDeletingPathExtension] stringByAppendingFormat:@" (%@)", postFix];
NSString *tempDir = [prefix stringByAppendingPathExtension:[path pathExtension]];
// Now let's make sure we get a unique path.
int cnt=2;
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999999)
tempDir = [NSString stringWithFormat:@"%@ %d.%@", prefix, cnt++, [path pathExtension]];
return tempDir;
}
- (BOOL)_copyPathWithForcedAuthentication:(NSString *)src toPath:(NSString *)dst error:(NSError **)error
{
NSString *tmp = [self _temporaryCopyNameForPath:dst];
const char* srcPath = [src fileSystemRepresentation];
const char* tmpPath = [tmp fileSystemRepresentation];
const char* dstPath = [dst fileSystemRepresentation];
struct stat dstSB;
stat(dstPath, &dstSB);
AuthorizationRef auth = NULL;
OSStatus authStat = errAuthorizationDenied;
while (authStat == errAuthorizationDenied) {
authStat = AuthorizationCreate(NULL,
kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults,
&auth);
}
BOOL res = NO;
if (authStat == errAuthorizationSuccess) {
res = YES;
char uidgid[42];
snprintf(uidgid, sizeof(uidgid), "%d:%d",
dstSB.st_uid, dstSB.st_gid);
const char* executables[] = {
"/bin/rm",
"/bin/mv",
"/bin/mv",
"/bin/rm",
NULL, // pause here and do some housekeeping before
// continuing
"/usr/sbin/chown",
NULL // stop here for real
};
// 4 is the maximum number of arguments to any command,
// including the NULL that signals the end of an argument
// list.
const char* const argumentLists[][4] = {
{ "-rf", tmpPath, NULL }, // make room for the temporary file... this is kinda unsafe; should probably do something better.
{ "-f", dstPath, tmpPath, NULL }, // mv
{ "-f", srcPath, dstPath, NULL }, // mv
{ "-rf", tmpPath, NULL }, // rm
{ NULL }, // pause
{ "-R", uidgid, dstPath, NULL }, // chown
{ NULL } // stop
};
// Process the commands up until the first NULL
int commandIndex = 0;
for (; executables[commandIndex] != NULL; ++commandIndex) {
if (res)
res = AuthorizationExecuteWithPrivilegesAndWait(auth, executables[commandIndex], kAuthorizationFlagDefaults, argumentLists[commandIndex]);
}
// If the currently-running application is trusted, the new
// version should be trusted as well. Remove it from the
// quarantine to avoid a delay at launch, and to avoid
// presenting the user with a confusing trust dialog.
//
// This needs to be done after the application is moved to its
// new home with "mv" in case it's moved across filesystems: if
// that happens, "mv" actually performs a copy and may result
// in the application being quarantined. It also needs to be
// done before "chown" changes ownership, because the ownership
// change will almost certainly make it impossible to change
// attributes to release the files from the quarantine.
if (res) {
[self releaseFromQuarantine:dst];
}
// Now move past the NULL we found and continue executing
// commands from the list.
++commandIndex;
for (; executables[commandIndex] != NULL; ++commandIndex) {
if (res)
res = AuthorizationExecuteWithPrivilegesAndWait(auth, executables[commandIndex], kAuthorizationFlagDefaults, argumentLists[commandIndex]);
}
AuthorizationFree(auth, 0);
if (!res)
{
// Something went wrong somewhere along the way, but we're not sure exactly where.
NSString *errorMessage = [NSString stringWithFormat:@"Authenticated file copy from %@ to %@ failed.", src, dst];
if (error != NULL)
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
}
}
else
{
if (error != NULL)
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAuthenticationFailure userInfo:[NSDictionary dictionaryWithObject:@"Couldn't get permission to authenticate." forKey:NSLocalizedDescriptionKey]];
}
return res;
}
- (BOOL)copyPathWithAuthentication:(NSString *)src overPath:(NSString *)dst error:(NSError **)error
{
if (![[NSFileManager defaultManager] fileExistsAtPath:dst])
{
NSString *errorMessage = [NSString stringWithFormat:@"Couldn't copy %@ over %@ because there is no file at %@.", src, dst, dst];
if (error != NULL)
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]];
return NO;
}
if (![[NSFileManager defaultManager] isWritableFileAtPath:dst] || ![[NSFileManager defaultManager] isWritableFileAtPath:[dst stringByDeletingLastPathComponent]])
return [self _copyPathWithForcedAuthentication:src toPath:dst error:error];
NSString *tmpPath = [self _temporaryCopyNameForPath:dst];
if (![[NSFileManager defaultManager] movePath:dst toPath:tmpPath handler:self])
{
if (error != NULL)
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't move %@ to %@.", dst, tmpPath] forKey:NSLocalizedDescriptionKey]];
return NO;
}
if (![[NSFileManager defaultManager] copyPath:src toPath:dst handler:self])
{
if (error != NULL)
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUFileCopyFailure userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Couldn't copy %@ to %@.", src, dst] forKey:NSLocalizedDescriptionKey]];
return NO;
}
// Trash the old copy of the app.
NSInteger tag = 0;
if (![[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tmpPath stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tmpPath lastPathComponent]] tag:&tag])
NSLog(@"Sparkle error: couldn't move %@ to the trash. This is often a sign of a permissions error.", tmpPath);
// If the currently-running application is trusted, the new
// version should be trusted as well. Remove it from the
// quarantine to avoid a delay at launch, and to avoid
// presenting the user with a confusing trust dialog.
//
// This needs to be done after the application is moved to its
// new home in case it's moved across filesystems: if that
// happens, the move is actually a copy, and it may result
// in the application being quarantined.
[self releaseFromQuarantine:dst];
return YES;
}
@end
-53
View File
@@ -1,53 +0,0 @@
//
// NSFileManager+ExtendedAttributes.h
// Sparkle
//
// Created by Mark Mentovai on 2008-01-22.
// Copyright 2008 Mark Mentovai. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
#define NSFILEMANAGER_PLUS_EXTENDEDATTRIBUTES
#import <Cocoa/Cocoa.h>
@interface NSFileManager (MMExtendedAttributes)
// Wraps the removexattr system call, allowing an AppKit-style NSString* to
// be used for the pathname argument. Note that the order of the arguments
// has changed from what removexattr accepts, so that code reads more
// naturally.
//
// removexattr is only available on Mac OS X 10.4 ("Tiger") and later. If
// built with an SDK that includes removexattr, this method will link against
// removexattr directly. When using earlier SDKs, this method will dynamically
// look up the removexattr symbol at runtime. If the symbol is not present,
// as will be the case when running on 10.3, this method returns -1 and sets
// errno to ENOSYS.
- (int)removeXAttr:(const char*)name
fromFile:(NSString*)file
options:(int)options;
// Removes the directory tree rooted at |root| from the file quarantine.
// The quarantine was introduced on Mac OS X 10.5 and is described at:
//
// http://developer.apple.com/releasenotes/Carbon/RN-LaunchServices/index.html
//#apple_ref/doc/uid/TP40001369-DontLinkElementID_2
//
// If |root| is not a directory, then it alone is removed from the quarantine.
// Symbolic links, including |root| if it is a symbolic link, will not be
// traversed.
//
// Ordinarily, the quarantine is managed by calling LSSetItemAttribute
// to set the kLSItemQuarantineProperties attribute to a dictionary specifying
// the quarantine properties to be applied. However, it does not appear to be
// possible to remove an item from the quarantine directly through any public
// Launch Services calls. Instead, this method takes advantage of the fact
// that the quarantine is implemented in part by setting an extended attribute,
// "com.apple.quarantine", on affected files. Removing this attribute is
// sufficient to remove files from the quarantine.
- (void)releaseFromQuarantine:(NSString*)root;
@end
#endif
-98
View File
@@ -1,98 +0,0 @@
//
// NSFileManager+ExtendedAttributes.m
// Sparkle
//
// Created by Mark Mentovai on 2008-01-22.
// Copyright 2008 Mark Mentovai. All rights reserved.
//
#import "NSFileManager+ExtendedAttributes.h"
#include <dlfcn.h>
#include <errno.h>
// Extended attribute support was introduced in Mac OS X 10.4 ("Tiger").
// If building with an earlier SDK, provide definitions needed to handle
// extended attributes at runtime.
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4
#include <sys/xattr.h>
#else // SDK >= 10.4
#define XATTR_NOFOLLOW 1
#endif // SDK >= 10.4
@implementation NSFileManager (MMExtendedAttributes)
- (int)removeXAttr:(const char*)name
fromFile:(NSString*)file
options:(int)options
{
typedef int (*removexattr_type)(const char*, const char*, int);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // SDK >= 10.4
// Reference removexattr directly, it's in the SDK.
static removexattr_type removexattr_func = removexattr;
#else // SDK >= 10.4
// removexattr isn't in this SDK, look it up at runtime.
static removexattr_type removexattr_func = NULL;
static BOOL didSymbolLookup = NO;
if (!didSymbolLookup) {
didSymbolLookup = YES;
removexattr_func = dlsym(RTLD_NEXT, "removexattr");
}
#endif // SDK >= 10.4
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4 // DT < 10.4
// Make sure that the symbol is present. This checks the deployment
// target instead of the SDK so that it's able to catch dlsym failures
// as well as the null symbol that would result from building with the
// 10.4 SDK and a lower deployment target, and running on 10.3.
if (!removexattr_func) {
errno = ENOSYS;
return -1;
}
#endif // DT < 10.4
const char* path = NULL;
@try {
path = [file fileSystemRepresentation];
}
@catch (id exception) {
// -[NSString fileSystemRepresentation] throws an exception if it's
// unable to convert the string to something suitable. Map that to
// EDOM, "argument out of domain", which sort of conveys that there
// was a conversion failure.
errno = EDOM;
return -1;
}
return removexattr_func(path, name, options);
}
- (void)releaseFromQuarantine:(NSString*)root
{
const char* quarantineAttribute = "com.apple.quarantine";
const int removeXAttrOptions = XATTR_NOFOLLOW;
[self removeXAttr:quarantineAttribute
fromFile:root
options:removeXAttrOptions];
// Only recurse if it's actually a directory. Don't recurse into a
// root-level symbolic link.
NSDictionary* rootAttributes =
[self fileAttributesAtPath:root traverseLink:NO];
NSString* rootType = [rootAttributes objectForKey:NSFileType];
if (rootType == NSFileTypeDirectory) {
// The NSDirectoryEnumerator will avoid recursing into any contained
// symbolic links, so no further type checks are needed.
NSDirectoryEnumerator* directoryEnumerator = [self enumeratorAtPath:root];
NSString* file = nil;
while ((file = [directoryEnumerator nextObject])) {
[self removeXAttr:quarantineAttribute
fromFile:[root stringByAppendingPathComponent:file]
options:removeXAttrOptions];
}
}
}
@end
-17
View File
@@ -1,17 +0,0 @@
//
// NSFileManager+Verification.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef NSFILEMANAGER_PLUS_VERIFICATION_H
#define NSFILEMANAGER_PLUS_VERIFICATION_H
// For the paranoid folks!
@interface NSFileManager (SUVerification)
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString;
@end
#endif
-151
View File
@@ -1,151 +0,0 @@
//
// NSFileManager+Verification.m
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
// DSA stuff adapted from code provided by Allan Odgaard. Thanks, Allan!
#import "Sparkle.h"
#import "NSFileManager+Verification.h"
#import <stdio.h>
#import <openssl/evp.h>
#import <openssl/bio.h>
#import <openssl/pem.h>
#import <openssl/rsa.h>
#import <openssl/sha.h>
long b64decode(unsigned char* str)
{
unsigned char *cur, *start;
int d, dlast, phase;
unsigned char c;
static int table[256] = {
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 00-0F */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 10-1F */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63, /* 20-2F */
52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1, /* 30-3F */
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14, /* 40-4F */
15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1, /* 50-5F */
-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40, /* 60-6F */
41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1, /* 70-7F */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 80-8F */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* 90-9F */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* A0-AF */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* B0-BF */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* C0-CF */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* D0-DF */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* E0-EF */
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 /* F0-FF */
};
d = dlast = phase = 0;
start = str;
for (cur = str; *cur != '\0'; ++cur )
{
if(*cur == '\n' || *cur == '\r'){phase = dlast = 0; continue;}
d = table[(int)*cur];
if(d != -1)
{
switch(phase)
{
case 0:
++phase;
break;
case 1:
c = ((dlast << 2) | ((d & 0x30) >> 4));
*str++ = c;
++phase;
break;
case 2:
c = (((dlast & 0xf) << 4) | ((d & 0x3c) >> 2));
*str++ = c;
++phase;
break;
case 3:
c = (((dlast & 0x03 ) << 6) | d);
*str++ = c;
phase = 0;
break;
}
dlast = d;
}
}
*str = '\0';
return str - start;
}
EVP_PKEY* load_dsa_key(char *key)
{
EVP_PKEY* pkey = NULL;
BIO *bio;
if((bio = BIO_new_mem_buf(key, (int)strlen(key))))
{
DSA* dsa_key = 0;
if(PEM_read_bio_DSA_PUBKEY(bio, &dsa_key, NULL, NULL))
{
if((pkey = EVP_PKEY_new()))
{
if(EVP_PKEY_assign_DSA(pkey, dsa_key) != 1)
{
DSA_free(dsa_key);
EVP_PKEY_free(pkey);
pkey = NULL;
}
}
}
BIO_free(bio);
}
return pkey;
}
@implementation NSFileManager (SUVerification)
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature withPublicDSAKey:(NSString *)pkeyString
{
BOOL result = NO;
if (!encodedSignature) { return NO; }
if (!pkeyString) { return NO; }
// Remove whitespace around each line of the key.
NSMutableArray *pkeyTrimmedLines = [NSMutableArray array];
NSEnumerator *pkeyLinesEnumerator = [[pkeyString componentsSeparatedByString:@"\n"] objectEnumerator];
NSString *pkeyLine;
while ((pkeyLine = [pkeyLinesEnumerator nextObject]) != nil)
{
[pkeyTrimmedLines addObject:[pkeyLine stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]];
}
pkeyString = [pkeyTrimmedLines componentsJoinedByString:@"\n"]; // Put them back together.
EVP_PKEY* pkey = NULL;
pkey = load_dsa_key((char *)[pkeyString UTF8String]);
if (!pkey) { return NO; }
// Now, the signature is in base64; we have to decode it into a binary stream.
unsigned char *signature = (unsigned char *)[encodedSignature UTF8String];
long length = b64decode(signature); // Decode the signature in-place and get the new length of the signature string.
// We've got the signature, now get the file data.
NSData *pathData = [NSData dataWithContentsOfFile:path];
if (!pathData) { return NO; }
// Hash the file with SHA-1.
unsigned char md[SHA_DIGEST_LENGTH];
SHA1([pathData bytes], [pathData length], md);
// Actually verify the signature on the file.
EVP_MD_CTX ctx;
if(EVP_VerifyInit(&ctx, EVP_dss1()) == 1) // We're using DSA keys.
{
EVP_VerifyUpdate(&ctx, md, SHA_DIGEST_LENGTH);
result = (EVP_VerifyFinal(&ctx, signature, (unsigned int)length, pkey) == 1);
}
EVP_PKEY_free(pkey);
return result;
}
@end
-16
View File
@@ -1,16 +0,0 @@
//
// NSNumber+Units.h
// Sparkle
//
// Created by Jonas Witt on 5/18/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSNumber (JWUnits)
+ (NSString *)humanReadableSizeFromDouble:(double)value;
@end
-28
View File
@@ -1,28 +0,0 @@
//
// NSNumber+Units.m
// Sparkle
//
// Created by Jonas Witt on 5/18/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "NSNumber+Units.h"
#import "Sparkle.h"
@implementation NSNumber (JWUnits)
+ (NSString *)humanReadableSizeFromDouble:(double)value
{
if (value < 1024)
return [NSString stringWithFormat:@"%.0lf %@", value, SULocalizedString(@"B", @"the unit for bytes")];
if (value < 1024 * 1024)
return [NSString stringWithFormat:@"%.0lf %@", value / 1024.0, SULocalizedString(@"KB", @"the unit for kilobytes")];
if (value < 1024 * 1024 * 1024)
return [NSString stringWithFormat:@"%.1lf %@", value / 1024.0 / 1024.0, SULocalizedString(@"MB", @"the unit for megabytes")];
return [NSString stringWithFormat:@"%.2lf %@", value / 1024.0 / 1024.0 / 1024.0, SULocalizedString(@"GB", @"the unit for gigabytes")];
}
@end
-66
View File
@@ -1,66 +0,0 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NSSTRING_PLUS_EXTRAS_H
#define NSSTRING_PLUS_EXTRAS_H
/*
NSString+extras.h
NetNewsWire
Created by Brent Simmons on Fri Jun 14 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import "SUConstants.h" // for NSInteger
@interface NSString (BSextras)
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set;
- (NSString *) trimWhiteSpace;
- (NSString *) stripHTML;
- (NSString *) ellipsizeAfterNWords: (NSInteger) n;
+ (BOOL) stringIsEmpty: (NSString *) s;
@end
#endif
-136
View File
@@ -1,136 +0,0 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
NSString+extras.m
NetNewsWire
Created by Brent Simmons on Fri Jun 14 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/
#import "Sparkle.h"
#import "NSString+extras.h"
@implementation NSString (BSextras)
- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set
{
NSRange r = [self rangeOfCharacterFromSet:set];
if (r.location == NSNotFound) return self;
NSMutableString *newString = [self mutableCopy];
do
{
[newString replaceCharactersInRange:r withString:subs];
r = [newString rangeOfCharacterFromSet:set];
}
while (r.location != NSNotFound);
return [newString autorelease];
}
- (NSString *) trimWhiteSpace {
NSMutableString *s = [[self mutableCopy] autorelease];
CFStringTrimWhitespace ((CFMutableStringRef) s);
return (NSString *) [[s copy] autorelease];
} /*trimWhiteSpace*/
- (NSString *) ellipsizeAfterNWords: (NSInteger) n {
NSArray *stringComponents = [self componentsSeparatedByString: @" "];
NSMutableArray *componentsCopy = [stringComponents mutableCopy];
NSInteger ix = n;
NSInteger len = [componentsCopy count];
if (len < n)
ix = len;
[componentsCopy removeObjectsInRange: NSMakeRange (ix, len - ix)];
return [componentsCopy componentsJoinedByString: @" "];
} /*ellipsizeAfterNWords*/
- (NSString *) stripHTML {
NSUInteger len = [self length];
NSMutableString *s = [NSMutableString stringWithCapacity: len];
NSUInteger i = 0, level = 0;
for (i = 0; i < len; i++) {
NSString *ch = [self substringWithRange: NSMakeRange (i, 1)];
if ([ch isEqualTo: @"<"])
level++;
else if ([ch isEqualTo: @">"]) {
level--;
if (level == 0)
[s appendString: @" "];
} /*else if*/
else if (level == 0)
[s appendString: ch];
} /*for*/
return (NSString *) [[s copy] autorelease];
} /*stripHTML*/
+ (BOOL) stringIsEmpty: (NSString *) s {
NSString *copy;
if (s == nil)
return (YES);
if ([s isEqualTo: @""])
return (YES);
copy = [[s copy] autorelease];
if ([[copy trimWhiteSpace] isEqualTo: @""])
return (YES);
return (NO);
} /*stringIsEmpty*/
@end
-18
View File
@@ -1,18 +0,0 @@
//
// NSURL+Parameters.h
// Sparkle
//
// Created by Andy Matuschak on 5/6/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef NSURL_PLUS_PARAMETERS_H
#define NSURL_PLUS_PARAMETERS_H
#import <Cocoa/Cocoa.h>
@interface NSURL (SUParameterAdditions)
- (NSURL *)URLWithParameters:(NSArray *)parameters;
@end
#endif
-27
View File
@@ -1,27 +0,0 @@
//
// NSURL+Parameters.m
// Sparkle
//
// Created by Andy Matuschak on 5/6/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "NSURL+Parameters.h"
@implementation NSURL (SUParameterAdditions)
- (NSURL *)URLWithParameters:(NSArray *)parameters;
{
if (parameters == nil || [parameters count] == 0) { return self; }
NSMutableArray *profileInfo = [NSMutableArray array];
NSEnumerator *profileInfoEnumerator = [parameters objectEnumerator];
NSDictionary *currentProfileInfo;
while ((currentProfileInfo = [profileInfoEnumerator nextObject])) {
[profileInfo addObject:[NSString stringWithFormat:@"%@=%@", [currentProfileInfo objectForKey:@"key"], [currentProfileInfo objectForKey:@"value"]]];
}
NSString *appcastStringWithProfile = [NSString stringWithFormat:@"%@?%@", [self absoluteString], [profileInfo componentsJoinedByString:@"&"]];
// Clean it up so it's a valid URL
return [NSURL URLWithString:[appcastStringWithProfile stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
}
@end
-18
View File
@@ -1,18 +0,0 @@
//
// NSWorkspace+SystemVersion.h
// Sparkle
//
// Created by Andy Matuschak on 5/7/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef NSWORKSPACE_PLUS_SYSTEMVERSION_H
#define NSWORKSPACE_PLUS_SYSTEMVERSION_H
#import <Cocoa/Cocoa.h>
@interface NSWorkspace (SUSystemVersion)
+ (NSString *)systemVersionString;
@end
#endif
-36
View File
@@ -1,36 +0,0 @@
//
// NSWorkspace+SystemVersion.m
// Sparkle
//
// Created by Andy Matuschak on 5/7/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "NSWorkspace+SystemVersion.h"
@implementation NSWorkspace (SUSystemVersion)
+ (NSString *)systemVersionString
{
// This returns a version string of the form X.Y.Z
// There may be a better way to deal with the problem that gestaltSystemVersionMajor
// et al. are not defined in 10.3, but this is probably good enough.
NSString* verStr = nil;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
SInt32 major, minor, bugfix;
OSErr err1 = Gestalt(gestaltSystemVersionMajor, &major);
OSErr err2 = Gestalt(gestaltSystemVersionMinor, &minor);
OSErr err3 = Gestalt(gestaltSystemVersionBugFix, &bugfix);
if (!err1 && !err2 && !err3)
{
verStr = [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
}
else
#endif
{
NSString *versionPlistPath = @"/System/Library/CoreServices/SystemVersion.plist";
verStr = [[[NSDictionary dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"] retain];
}
return verStr;
}
@end
-41
View File
@@ -1,41 +0,0 @@
//
// NSWorkspace_RBAdditions.h
// PathProps
//
// Created by Rainer Brockerhoff on 10/04/2007.
// Copyright 2007 Rainer Brockerhoff. All rights reserved.
//
#ifndef NSWORKSPACE_RBADDITIONS_H
#define NSWORKSPACE_RBADDITIONS_H
extern NSString* NSWorkspace_RBfstypename;
extern NSString* NSWorkspace_RBmntonname;
extern NSString* NSWorkspace_RBmntfromname;
extern NSString* NSWorkspace_RBdeviceinfo;
extern NSString* NSWorkspace_RBimagefilepath;
extern NSString* NSWorkspace_RBconnectiontype;
extern NSString* NSWorkspace_RBpartitionscheme;
extern NSString* NSWorkspace_RBserverURL;
@interface NSWorkspace (NSWorkspace_RBAdditions)
// This method will return nil if the input path is invalid. Otherwise, the returned NSDictionary may contain
// the following keys:
//- NSWorkspace_RBfstypename: will always be present.Shows the filesystem type (usually "hfs"), from statfs.
//- NSWorkspace_RBmntonname: will always be present. Shows the volume mount point.
//- NSWorkspace_RBmntfromname: will always be present. Shows the BSD device path for local volumes; info for
// remote volumes depends on the filesystem type.
//- NSWorkspace_RBconnectiontype: should always be present for local volumes. Shows the connection type ("SATA", "USB", etc.).
//- NSWorkspace_RBpartitionscheme: should always be present for local volumes. Shows the partition scheme.
//- NSWorkspace_RBdeviceinfo: should always be present for local volumes. Shows some information about the
// physical device; varies widely.
//- NSWorkspace_RBimagefilepath: should be present for disk images only. Shows the path of the disk image file.
//- NSWorkspace_RBserverURL: should be present for remote volumes only. Shows the server URL.
- (NSDictionary*)propertiesForPath:(NSString*)path;
@end
#endif
-177
View File
@@ -1,177 +0,0 @@
//
// NSWorkspace_RBAdditions.m
// PathProps
//
// Created by Rainer Brockerhoff on 10/04/2007.
// Copyright 2007 Rainer Brockerhoff. All rights reserved.
//
#import "Sparkle.h"
#import "NSWorkspace_RBAdditions.h"
#include <IOKit/IOKitLib.h>
#include <sys/mount.h>
#include <mach/mach.h>
NSString* NSWorkspace_RBfstypename = @"NSWorkspace_RBfstypename";
NSString* NSWorkspace_RBmntonname = @"NSWorkspace_RBmntonname";
NSString* NSWorkspace_RBmntfromname = @"NSWorkspace_RBmntfromname";
NSString* NSWorkspace_RBdeviceinfo = @"NSWorkspace_RBdeviceinfo";
NSString* NSWorkspace_RBimagefilepath = @"NSWorkspace_RBimagefilepath";
NSString* NSWorkspace_RBconnectiontype = @"NSWorkspace_RBconnectiontype";
NSString* NSWorkspace_RBpartitionscheme = @"NSWorkspace_RBpartitionscheme";
NSString* NSWorkspace_RBserverURL = @"NSWorkspace_RBserverURL";
// This static funtion concatenates two strings, but first checks several possibilities...
// like one or the other nil, or one containing the other already.
static NSString* AddPart(NSString* first,NSString* second) {
if (!second) {
return first;
}
second = [second stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (first) {
if ([first rangeOfString:second options:NSCaseInsensitiveSearch].location==NSNotFound) {
if ([second rangeOfString:first options:NSCaseInsensitiveSearch].location==NSNotFound) {
return [NSString stringWithFormat:@"%@; %@",first,second];
}
return second;
}
return first;
}
return second;
}
// This static functions recurses "upwards" over the IO registry. Returns strings that are concatenated
// and ultimately end up under the NSWorkspace_RBdeviceinfo key.
// This isn't too robust in that it assumes that objects returned by the objectForKey methods are
// either strings or dictionaries. A "standard" implementations would use either only CoreFoundation and
// IOKit calls for this, or do more robust type checking on the returned objects.
//
// Also notice that this works as determined experimentally in 10.4.9, there's no official docs I could find.
// YMMV, and it may stop working in any new version of Mac OS X.
static NSString* CheckParents(io_object_t thing,NSString* part,NSMutableDictionary* dict) {
NSString* result = part;
io_iterator_t parentsIterator = 0;
kern_return_t kernResult = IORegistryEntryGetParentIterator(thing,kIOServicePlane,&parentsIterator);
if ((kernResult==KERN_SUCCESS)&&parentsIterator) {
io_object_t nextParent = 0;
while ((nextParent = IOIteratorNext(parentsIterator))) {
NSDictionary* props = nil;
NSString* image = nil;
NSString* partition = nil;
NSString* connection = nil;
kernResult = IORegistryEntryCreateCFProperties(nextParent,(CFMutableDictionaryRef*)&props,kCFAllocatorDefault,0);
if (IOObjectConformsTo(nextParent,"IOApplePartitionScheme")) {
partition = [props objectForKey:@"Content Mask"];
} else if (IOObjectConformsTo(nextParent,"IOMedia")) {
partition = [props objectForKey:@"Content"];
} else if (IOObjectConformsTo(nextParent,"IODiskImageBlockStorageDeviceOutKernel")) {
NSData* data = nil;
if ((data = [[props objectForKey:@"Protocol Characteristics"] objectForKey:@"Virtual Interface Location Path"])) {
image = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding] autorelease];
}
} else if (IOObjectConformsTo(nextParent,"IOHDIXHDDriveInKernel")) {
image = [props objectForKey:@"KDIURLPath"];
}
NSDictionary* subdict;
if ((subdict = [props objectForKey:@"Protocol Characteristics"])) {
connection = [subdict objectForKey:@"Physical Interconnect"];
} else {
connection = [props objectForKey:@"Physical Interconnect"];
}
if (connection) {
[dict setObject:AddPart([dict objectForKey:NSWorkspace_RBconnectiontype],connection) forKey:NSWorkspace_RBconnectiontype];
}
if (partition) {
[dict setObject:partition forKey:NSWorkspace_RBpartitionscheme];
}
if (image) {
[dict setObject:image forKey:NSWorkspace_RBimagefilepath];
}
NSString* value;
if ((subdict = [props objectForKey:@"Device Characteristics"])) {
if ((value = [subdict objectForKey:@"Product Name"])) {
result = AddPart(result,value);
}
if ((value = [subdict objectForKey:@"Product Revision Level"])) {
result = AddPart(result,value);
}
if ((value = [subdict objectForKey:@"Vendor Name"])) {
result = AddPart(result,value);
}
}
if ((value = [props objectForKey:@"USB Serial Number"])) {
result = AddPart(result,value);
}
if ((value = [props objectForKey:@"USB Vendor Name"])) {
result = AddPart(result,value);
}
io_name_t ts; // char[128]
NSString* cls = ( IOObjectGetClass (nextParent, ts) == KERN_SUCCESS ) ? [NSString stringWithUTF8String:ts ] : nil;
if (![cls isEqualToString:@"IOPCIDevice"]) {
// Uncomment the following line to have the device tree dumped to the console.
// NSLog(@"=================================> %@:%@\n",cls,props);
result = CheckParents(nextParent,result,dict);
}
if (props) { CFRelease(props); }
IOObjectRelease(nextParent);
}
}
if (parentsIterator) {
IOObjectRelease(parentsIterator);
}
return result;
}
@implementation NSWorkspace (NSWorkspace_RBAdditions)
// Returns a NSDictionary with properties for the path. See details in the .h file.
// This assumes that the length of path is less than PATH_MAX (currently 1024 characters).
- (NSDictionary*)propertiesForPath:(NSString*)path {
const char* ccpath = [path fileSystemRepresentation];
NSMutableDictionary* result = nil;
struct statfs fs = {};
if (!statfs(ccpath,&fs)) {
NSString* from = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:fs.f_mntfromname length:strlen(fs.f_mntfromname)];
result = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSString stringWithUTF8String:fs.f_fstypename], NSWorkspace_RBfstypename, [[NSFileManager defaultManager] stringWithFileSystemRepresentation:fs.f_mntonname length:strlen(fs.f_mntonname)], NSWorkspace_RBmntonname, nil];
const char* devstring = "/dev/";
size_t devstringlen = 5;
if (strncmp(fs.f_mntfromname,devstring,devstringlen)==0) {
// For a local volume,get the IO registry tree and search it for further info.
mach_port_t masterPort = 0;
io_iterator_t mediaIterator = 0;
kern_return_t kernResult = IOMasterPort(bootstrap_port,&masterPort);
if (kernResult==KERN_SUCCESS) {
CFMutableDictionaryRef classesToMatch = IOBSDNameMatching(masterPort,0,&fs.f_mntfromname[devstringlen]);
if (classesToMatch) {
kernResult = IOServiceGetMatchingServices(masterPort,classesToMatch,&mediaIterator);
if ((kernResult==KERN_SUCCESS)&&mediaIterator) {
io_object_t firstMedia = 0;
while ((firstMedia = IOIteratorNext(mediaIterator))) {
NSString* stuff = CheckParents(firstMedia,nil,result);
if (stuff) {
[result setObject:stuff forKey:NSWorkspace_RBdeviceinfo];
}
IOObjectRelease(firstMedia);
}
}
}
}
if (mediaIterator) {
IOObjectRelease(mediaIterator);
}
if (masterPort) {
mach_port_deallocate(mach_task_self(),masterPort);
}
}
[result setObject:from forKey:NSWorkspace_RBmntfromname];
}
return result;
}
@end
-29
View File
@@ -1,29 +0,0 @@
//
// NTSynchronousTask.h
// CocoatechCore
//
// Created by Steve Gehrman on 9/29/05.
// Copyright 2005 Steve Gehrman. All rights reserved.
//
#ifndef NTSYNCHRONOUSTASK_H
#define NTSYNCHRONOUSTASK_H
@interface NTSynchronousTask : NSObject
{
NSTask *mv_task;
NSPipe *mv_outputPipe;
NSPipe *mv_inputPipe;
NSData* mv_output;
BOOL mv_done;
int mv_result;
}
// pass nil for directory if not needed
// returns the result
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
@end
#endif
-262
View File
@@ -1,262 +0,0 @@
//
// NTSynchronousTask.m
// CocoatechCore
//
// Created by Steve Gehrman on 9/29/05.
// Copyright 2005 Steve Gehrman. All rights reserved.
//
#import "Sparkle.h"
#import "NTSynchronousTask.h"
@interface NTSynchronousTask (Private)
- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
- (NSTask *)task;
- (void)setTask:(NSTask *)theTask;
- (NSPipe *)outputPipe;
- (void)setOutputPipe:(NSPipe *)theOutputPipe;
- (NSPipe *)inputPipe;
- (void)setInputPipe:(NSPipe *)theInputPipe;
- (NSData *)output;
- (void)setOutput:(NSData *)theOutput;
- (BOOL)done;
- (void)setDone:(BOOL)flag;
- (int)result;
- (void)setResult:(int)theResult;
@end
@implementation NTSynchronousTask
- (id)init;
{
self = [super init];
if (self)
{
[self setTask:[[[NSTask alloc] init] autorelease]];
[self setOutputPipe:[[[NSPipe alloc] init] autorelease]];
[self setInputPipe:[[[NSPipe alloc] init] autorelease]];
[[self task] setStandardInput:[self inputPipe]];
[[self task] setStandardOutput:[self outputPipe]];
}
return self;
}
//----------------------------------------------------------
// dealloc
//----------------------------------------------------------
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self setTask:nil];
[self setOutputPipe:nil];
[self setInputPipe:nil];
[self setOutput:nil];
[super dealloc];
}
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
{
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSData* result=nil;
NS_DURING
{
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
[task run:toolPath directory:currentDirectory withArgs:args input:input];
if ([task result] == 0)
result = [[task output] retain];
[task release];
}
NS_HANDLER;
NS_ENDHANDLER;
[pool drain];
// retained above
[result autorelease];
return result;
}
@end
@implementation NTSynchronousTask (Private)
- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
{
BOOL success = NO;
if (currentDirectory)
[[self task] setCurrentDirectoryPath: currentDirectory];
[[self task] setLaunchPath:toolPath];
[[self task] setArguments:args];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(taskOutputAvailable:)
name:NSFileHandleReadToEndOfFileCompletionNotification
object:[[self outputPipe] fileHandleForReading]];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(taskDidTerminate:)
name:NSTaskDidTerminateNotification
object:[self task]];
[[[self outputPipe] fileHandleForReading] readToEndOfFileInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]];
NS_DURING
[[self task] launch];
success = YES;
NS_HANDLER
;
NS_ENDHANDLER
if (success)
{
if (input)
{
// feed the running task our input
[[[self inputPipe] fileHandleForWriting] writeData:input];
[[[self inputPipe] fileHandleForWriting] closeFile];
}
// loop until we are done receiving the data
if (![self done])
{
double resolution = 1;
BOOL isRunning;
NSDate* next;
do {
next = [NSDate dateWithTimeIntervalSinceNow:resolution];
isRunning = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
beforeDate:next];
} while (isRunning && ![self done]);
}
}
}
//----------------------------------------------------------
// task
//----------------------------------------------------------
- (NSTask *)task
{
return mv_task;
}
- (void)setTask:(NSTask *)theTask
{
if (mv_task != theTask) {
[mv_task release];
mv_task = [theTask retain];
}
}
//----------------------------------------------------------
// outputPipe
//----------------------------------------------------------
- (NSPipe *)outputPipe
{
return mv_outputPipe;
}
- (void)setOutputPipe:(NSPipe *)theOutputPipe
{
if (mv_outputPipe != theOutputPipe) {
[mv_outputPipe release];
mv_outputPipe = [theOutputPipe retain];
}
}
//----------------------------------------------------------
// inputPipe
//----------------------------------------------------------
- (NSPipe *)inputPipe
{
return mv_inputPipe;
}
- (void)setInputPipe:(NSPipe *)theInputPipe
{
if (mv_inputPipe != theInputPipe) {
[mv_inputPipe release];
mv_inputPipe = [theInputPipe retain];
}
}
//----------------------------------------------------------
// output
//----------------------------------------------------------
- (NSData *)output
{
return mv_output;
}
- (void)setOutput:(NSData *)theOutput
{
if (mv_output != theOutput) {
[mv_output release];
mv_output = [theOutput retain];
}
}
//----------------------------------------------------------
// done
//----------------------------------------------------------
- (BOOL)done
{
return mv_done;
}
- (void)setDone:(BOOL)flag
{
mv_done = flag;
}
//----------------------------------------------------------
// result
//----------------------------------------------------------
- (int)result
{
return mv_result;
}
- (void)setResult:(int)theResult
{
mv_result = theResult;
}
@end
@implementation NTSynchronousTask (Notifications)
- (void)taskOutputAvailable:(NSNotification*)note
{
[self setOutput:[[note userInfo] objectForKey:NSFileHandleNotificationDataItem]];
[self setDone:YES];
}
- (void)taskDidTerminate:(NSNotification*)note
{
[self setResult:[[self task] terminationStatus]];
}
@end
+46
View File
@@ -0,0 +1,46 @@
# Sparkle [![Build Status](https://travis-ci.org/sparkle-project/Sparkle.svg?branch=master)](https://travis-ci.org/sparkle-project/Sparkle)
An easy-to-use software update framework for Cocoa developers.
![Screenshot](Resources/Screenshot.png)
## Changes since 1.5b
* Up-to-date with 10.10 SDK and Xcode 6. Supports OS X 10.7+.
* Cleaned up and modernized code, using ARC and Autolayout.
* Merged bugfixes, security fixes and some features from multiple Sparkle forks.
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
* Ability to mark updates as critical.
* Progress and status notifications for the host app.
* Name of finish_installation.app can be configured to match your app's name.
## Features
* True self-updating—the user can choose to automatically download and install all updates.
* Displays a detailed progress window to the user.
* Supports authentication for installing in secure locations.
* Supports Apple code signing and DSA signatures for ultra-secure updates.
* Easy to install. Sparkle requires no code in your app, so it's trivial to upgrade or remove the framework.
* Uses appcasts for release information. Appcasts are supported by 3rd party update-tracking programs and websites.
* Displays release notes to the user via WebKit.
* Sparkle doesn't bug the user until second launch for better first impressions.
* Seamless integration—there's no mention of Sparkle; your icons and app name are used.
* Deep delegate support to make Sparkle work exactly as you need.
* Optionally sends system information to the server when checking for updates.
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
* Supports branches due to minimum OS version requirements.
## Developers
Building Sparkle requires Xcode 5 or above.
### API
Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default.
If you are adding a symbol to the public API you must decorate the declaration with the `SU_EXPORT` macro (grep the source code for examples).
### Building the distribution package
`cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.bz2 will be created in a temporary directory and revealed in Finder after the build has completed.
Alternatively, build the Distribution scheme in the Xcode UI.
-77
View File
@@ -1,77 +0,0 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef RSS_H
#define RSS_H
/*
RSS.h
A class for reading RSS feeds.
Created by Brent Simmons on Wed Apr 17 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/
#import <Cocoa/Cocoa.h>
#import <CoreFoundation/CoreFoundation.h>
#import "NSString+extras.h"
@interface RSS : NSObject {
NSMutableData *incrementalData;
id delegate;
NSDictionary *headerItems;
NSMutableArray *newsItems;
NSString *version;
BOOL flRdf;
BOOL normalize;
}
- (RSS *)initWithURL:(NSURL *) url userAgent:(NSString*)userAgent delegate:delegate;
- (BOOL)loadData:(NSData *)rssData normalize:(BOOL)fl;
- (NSMutableArray *)newsItems;
- (NSDictionary *)newestItem;
@end
@interface NSObject (RSSDelegateProtocol)
- (void)feedDidFinishLoading:(RSS *)feed;
- (void)feed:(RSS *)feed didFailWithError:(NSError *)error;
@end
#endif
-727
View File
@@ -1,727 +0,0 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
RSS.m
A class for reading RSS feeds.
Created by Brent Simmons on Wed Apr 17 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/
#import "Sparkle.h"
#import "RSS.h"
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
@interface NSError (TigerPlusMethods)
- (NSString *)localizedFailureReason;
@end
#endif
@interface RSS (Private)
- (void) createheaderdictionary: (CFXMLTreeRef) tree;
- (void) createitemsarray: (CFXMLTreeRef) tree;
- (void) setversionstring: (CFXMLTreeRef) tree;
- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary;
- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary;
- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree;
- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name;
- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem;
- (NSString *) getelementvalue: (CFXMLTreeRef) tree;
@end
// This comparator function is used to sort the RSS items by their published date.
NSComparisonResult compareNewsItems(id item1, id item2, void *context)
{
// We compare item2 with item1 instead of the other way 'round because we want descending, not ascending. Bit of a hack.
return [(NSDate *)[NSDate dateWithNaturalLanguageString:[item2 objectForKey:@"pubDate"]] compare:(NSDate *)[NSDate dateWithNaturalLanguageString:[item1 objectForKey:@"pubDate"]]];
}
@implementation RSS
#define titleKey @"title"
#define linkKey @"link"
#define descriptionKey @"description"
/*Public interface*/
- (NSDictionary *)newestItem
{
// The news items are already sorted by published date, descending.
return [[self newsItems] objectAtIndex:0];
}
- (RSS *) initWithTitle: (NSString *) title andDescription: (NSString *) description {
/*
Create an empty feed. Useful for synthetic feeds.
*/
NSMutableDictionary *header;
flRdf = NO;
header = [NSMutableDictionary dictionaryWithCapacity: 2];
[header setObject: title forKey: titleKey];
[header setObject: description forKey: descriptionKey];
headerItems = (NSDictionary *) [header copy];
newsItems = [[NSMutableArray alloc] initWithCapacity: 0];
version = [[NSString alloc] initWithString: @"synthetic"];
return (self);
} /*initWithTitle*/
- (BOOL)loadData:(NSData *)rssData normalize:(BOOL)fl
{
CFXMLTreeRef tree;
flRdf = NO;
normalize = fl;
NS_DURING
tree = CFXMLTreeCreateFromData (kCFAllocatorDefault, (CFDataRef) rssData,
NULL, kCFXMLParserSkipWhitespace, kCFXMLNodeCurrentVersion);
NS_HANDLER
tree = nil;
NS_ENDHANDLER
if (tree == nil)
return NO;
[self createheaderdictionary: tree];
[self createitemsarray: tree];
[self setversionstring: tree];
return YES;
}
- (RSS *)initWithURL:(NSURL *)url userAgent:(NSString*)userAgent delegate:del
{
self = [super init];
if (self)
{
delegate = del;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: url cachePolicy: NSURLRequestReloadIgnoringCacheData
timeoutInterval: 30.0];
if (userAgent)
[request setValue: userAgent forHTTPHeaderField: @"User-Agent"];
incrementalData = [[NSMutableData data] retain];
NSURLConnection *connection = [NSURLConnection connectionWithRequest:request delegate:self];
CFRetain(connection);
}
return self;
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[incrementalData appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
CFRelease(connection);
NSError *error = nil;
@try
{
if (![self loadData:incrementalData normalize:YES])
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while parsing the update feed.", nil) forKey:NSLocalizedDescriptionKey]];
}
@catch (NSException *parseException)
{
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"An error occurred while parsing the update feed: %@", nil), [parseException reason]] forKey:NSLocalizedFailureReasonErrorKey]];
}
if (error)
[delegate feed:self didFailWithError:error];
else
[delegate feedDidFinishLoading:self];
}
- (void)connection:(NSURLConnection*) connection didFailWithError:(NSError *)error
{
CFRelease(connection);
[delegate feed:self didFailWithError:error];
}
- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
{
return request;
}
- (NSDictionary *) headerItems {
return (headerItems);
} /*headerItems*/
- (NSMutableArray *) newsItems {
return (newsItems);
} /*newsItems*/
- (NSString *) version {
return (version);
} /*version*/
- (void) dealloc {
[incrementalData release];
[headerItems release];
[newsItems release];
[version release];
[super dealloc];
} /*dealloc*/
/*Private methods. Don't call these: they may change.*/
- (void) createheaderdictionary: (CFXMLTreeRef) tree {
CFXMLTreeRef channelTree, childTree;
CFXMLNodeRef childNode;
CFIndex childCount, i;
NSString *childName;
NSMutableDictionary *headerItemsMutable;
channelTree = [self getchanneltree: tree];
if (channelTree == nil) {
NSException *exception = [NSException exceptionWithName: @"RSSCreateHeaderDictionaryFailed"
reason: @"Couldn't find the channel tree." userInfo: nil];
[exception raise];
} /*if*/
childCount = CFTreeGetChildCount (channelTree);
headerItemsMutable = [NSMutableDictionary dictionaryWithCapacity: childCount];
for (i = 0; i < childCount; i++) {
childTree = CFTreeGetChildAtIndex (channelTree, i);
childNode = CFXMLTreeGetNode (childTree);
childName = (NSString *) CFXMLNodeGetString (childNode);
if ([childName hasPrefix: @"rss:"])
childName = [childName substringFromIndex: 4];
if ([childName isEqualToString: @"item"])
break;
if ([childName isEqualTo: @"image"])
[self flattenimagechildren: childTree into: headerItemsMutable];
[headerItemsMutable setObject: [self getelementvalue: childTree] forKey: childName];
} /*for*/
headerItems = [headerItemsMutable copy];
} /*initheaderdictionary*/
- (void) createitemsarray: (CFXMLTreeRef) tree {
CFXMLTreeRef channelTree, childTree, itemTree;
CFXMLNodeRef childNode, itemNode;
NSString *childName;
NSString *itemName, *itemValue;
CFIndex childCount, itemChildCount, i, j;
NSMutableDictionary *itemDictionaryMutable;
NSMutableArray *itemsArrayMutable;
if (flRdf)
channelTree = [self getnamedtree: tree name: @"rdf:RDF"];
else
channelTree = [self getchanneltree: tree];
if (channelTree == nil) {
NSException *exception = [NSException exceptionWithName: @"RSSCreateItemsArrayFailed"
reason: @"Couldn't find the news items." userInfo: nil];
[exception raise];
} /*if*/
childCount = CFTreeGetChildCount (channelTree);
itemsArrayMutable = [NSMutableArray arrayWithCapacity: childCount];
for (i = 0; i < childCount; i++) {
childTree = CFTreeGetChildAtIndex (channelTree, i);
childNode = CFXMLTreeGetNode (childTree);
childName = (NSString *) CFXMLNodeGetString (childNode);
if ([childName hasPrefix: @"rss:"])
childName = [childName substringFromIndex: 4];
if (![childName isEqualToString: @"item"])
continue;
itemChildCount = CFTreeGetChildCount (childTree);
itemDictionaryMutable = [NSMutableDictionary dictionaryWithCapacity: itemChildCount];
for (j = 0; j < itemChildCount; j++) {
itemTree = CFTreeGetChildAtIndex (childTree, j);
itemNode = CFXMLTreeGetNode (itemTree);
itemName = (NSString *) CFXMLNodeGetString (itemNode);
if ([itemName hasPrefix: @"rss:"])
itemName = [itemName substringFromIndex: 4];
if ([itemName isEqualTo:@"enclosure"])
{
// Hack to add attributes to the dictionary in addition to children. (AMM)
const CFXMLElementInfo *websiteInfo = CFXMLNodeGetInfoPtr(itemNode);
NSMutableDictionary *enclosureDictionary = [NSMutableDictionary dictionary];
id keyEnumerator = [(NSDictionary *)websiteInfo->attributes keyEnumerator], current;
while ((current = [keyEnumerator nextObject]))
{
NSString *escapedAttributeValue = [(NSDictionary *)websiteInfo->attributes objectForKey:current];
CFStringRef attributeValue = CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (CFStringRef)escapedAttributeValue, NULL);
if (attributeValue)
{
// Do a stringWithString dance rather than just casting so that it's GC safe without using the 10.4+ CFMakeCollectable.
[enclosureDictionary setObject:[NSString stringWithString:(NSString *)attributeValue] forKey:current];
CFRelease(attributeValue);
}
}
[itemDictionaryMutable setObject: enclosureDictionary forKey: itemName];
continue;
}
itemValue = [self getelementvalue: itemTree];
if ([itemName isEqualTo: @"source"])
[self flattensourceattributes: itemNode into: itemDictionaryMutable];
[itemDictionaryMutable setObject: itemValue forKey: itemName];
} /*for*/
if (normalize)
[self normalizeRSSItem: itemDictionaryMutable];
[itemsArrayMutable addObject: itemDictionaryMutable];
} /*for*/
// Sort the news items by published date, descending.
newsItems = [[itemsArrayMutable sortedArrayUsingFunction:compareNewsItems context:NULL] retain];
} /*createitemsarray*/
- (void) setversionstring: (CFXMLTreeRef) tree {
CFXMLTreeRef rssTree;
const CFXMLElementInfo *elementInfo;
CFXMLNodeRef node;
if (flRdf) {
version = [[NSString alloc] initWithString: @"rdf"];
return;
} /*if*/
rssTree = [self getnamedtree: tree name: @"rss"];
node = CFXMLTreeGetNode (rssTree);
elementInfo = CFXMLNodeGetInfoPtr (node);
version = [[NSString alloc] initWithString: [(NSDictionary *) (*elementInfo).attributes objectForKey: @"version"]];
} /*setversionstring*/
- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary {
CFIndex childCount = CFTreeGetChildCount (tree);
CFIndex i = 0;
CFXMLTreeRef childTree;
CFXMLNodeRef childNode;
NSString *childName, *childValue, *keyName;
if (childCount < 1)
return;
for (i = 0; i < childCount; i++) {
childTree = CFTreeGetChildAtIndex (tree, i);
childNode = CFXMLTreeGetNode (childTree);
childName = (NSString *) CFXMLNodeGetString (childNode);
if ([childName hasPrefix: @"rss:"])
childName = [childName substringFromIndex: 4];
childValue = [self getelementvalue: childTree];
keyName = [NSString stringWithFormat: @"image%@", childName];
[dictionary setObject: childValue forKey: keyName];
} /*for*/
} /*flattenimagechildren*/
- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary {
const CFXMLElementInfo *elementInfo;
NSString *sourceHomeUrl, *sourceRssUrl;
elementInfo = CFXMLNodeGetInfoPtr (node);
sourceHomeUrl = [(NSDictionary *) (*elementInfo).attributes objectForKey: @"homeUrl"];
sourceRssUrl = [(NSDictionary *) (*elementInfo).attributes objectForKey: @"url"];
if (sourceHomeUrl != nil)
[dictionary setObject: sourceHomeUrl forKey: @"sourceHomeUrl"];
if (sourceRssUrl != nil)
[dictionary setObject: sourceRssUrl forKey: @"sourceRssUrl"];
} /*flattensourceattributes*/
- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree {
CFXMLTreeRef rssTree, channelTree;
rssTree = [self getnamedtree: tree name: @"rss"];
if (rssTree == nil) { /*It might be "rdf:RDF" instead, a 1.0 or greater feed.*/
rssTree = [self getnamedtree: tree name: @"rdf:RDF"];
if (rssTree != nil)
flRdf = YES; /*This info will be needed later when creating the items array.*/
} /*if*/
if (rssTree == nil)
return (nil);
channelTree = [self getnamedtree: rssTree name: @"channel"];
if (channelTree == nil)
channelTree = [self getnamedtree: rssTree name: @"rss:channel"];
return (channelTree);
} /*getchanneltree*/
- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name {
CFIndex childCount, i;
CFXMLNodeRef xmlNode;
CFXMLTreeRef xmlTreeNode;
NSString *itemName;
childCount = CFTreeGetChildCount (currentTree);
for (i = childCount - 1; i >= 0; i--) {
xmlTreeNode = CFTreeGetChildAtIndex (currentTree, i);
xmlNode = CFXMLTreeGetNode (xmlTreeNode);
itemName = (NSString *) CFXMLNodeGetString (xmlNode);
if ([itemName isEqualToString: name])
return (xmlTreeNode);
} /*for*/
return (nil);
} /*getnamedtree*/
- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem {
/*
Make sure item, link, and description are present and have
reasonable values. Description and link may be "".
Also trim white space, remove HTML when appropriate.
*/
NSString *description, *normalizedLink, *title;
BOOL nilDescription = NO;
/*Description*/
description = [rssItem objectForKey: descriptionKey];
if (description == nil) {
description = @"";
nilDescription = YES;
} /*if*/
description = [description trimWhiteSpace];
if ([description isEqualTo: @""])
nilDescription = YES;
[rssItem setObject: description forKey: descriptionKey];
/*Link*/
normalizedLink = [rssItem objectForKey: linkKey];
if ([NSString stringIsEmpty: normalizedLink]) {
/*Try to get a URL from the description.*/
if (!nilDescription) {
NSArray *stringComponents = [description componentsSeparatedByString: @"href=\""];
if ([stringComponents count] > 1) {
normalizedLink = [stringComponents objectAtIndex: 1];
stringComponents = [normalizedLink componentsSeparatedByString: @"\""];
normalizedLink = [stringComponents objectAtIndex: 0];
} /*if*/
} /*if*/
} /*if*/
if (normalizedLink == nil)
normalizedLink = @"";
normalizedLink = [normalizedLink trimWhiteSpace];
[rssItem setObject: normalizedLink forKey: linkKey];
/*Title*/
title = [rssItem objectForKey: titleKey];
if (title != nil) {
title = [title stripHTML];
title = [title trimWhiteSpace];
} /*if*/
if ([NSString stringIsEmpty: title]) {
/*Grab a title from the description.*/
if (!nilDescription) {
NSArray *stringComponents = [description componentsSeparatedByString: @">"];
if ([stringComponents count] > 1) {
title = [stringComponents objectAtIndex: 1];
stringComponents = [title componentsSeparatedByString: @"<"];
title = [stringComponents objectAtIndex: 0];
title = [title stripHTML];
title = [title trimWhiteSpace];
} /*if*/
if ([NSString stringIsEmpty: title]) { /*use first part of description*/
NSString *shortTitle = [[[description stripHTML] trimWhiteSpace] ellipsizeAfterNWords: 5];
shortTitle = [shortTitle trimWhiteSpace];
title = [NSString stringWithFormat: @"%@\u2026", shortTitle];
} /*else*/
} /*if*/
title = [title stripHTML];
title = [title trimWhiteSpace];
if ([NSString stringIsEmpty: title])
title = @"Untitled";
} /*if*/
[rssItem setObject: title forKey: titleKey];
/*dangerousmeta case: super-long title with no description*/
if ((nilDescription) && ([title length] > 50)) {
NSString *shortTitle = [[[title stripHTML] trimWhiteSpace] ellipsizeAfterNWords: 7];
description = [[title copy] autorelease];
[rssItem setObject: description forKey: descriptionKey];
title = [NSString stringWithFormat: @"%@\u2026", shortTitle];
[rssItem setObject: title forKey: titleKey];
} /*if*/
{ /*deal with entities*/
const char *tempcstring;
NSAttributedString *s = nil;
NSString *convertedTitle = nil;
NSArray *stringComponents;
stringComponents = [title componentsSeparatedByString: @"&"];
if ([stringComponents count] > 1) {
stringComponents = [title componentsSeparatedByString: @";"];
if ([stringComponents count] > 1) {
size_t len;
tempcstring = [title UTF8String];
len = strlen (tempcstring);
if (len > 0) {
s = [[NSAttributedString alloc]
initWithHTML: [NSData dataWithBytes: tempcstring length: strlen (tempcstring)]
documentAttributes: (NSDictionary **) NULL];
convertedTitle = [s string];
[s autorelease];
convertedTitle = [convertedTitle stripHTML];
convertedTitle = [convertedTitle trimWhiteSpace];
} /*if*/
if ([NSString stringIsEmpty: convertedTitle])
convertedTitle = @"Untitled";
[rssItem setObject: convertedTitle forKey: @"convertedTitle"];
} /*if*/
} /*if*/
} /*deal with entities*/
} /*normalizeRSSItem*/
- (NSString *) getelementvalue: (CFXMLTreeRef) tree {
CFXMLNodeRef node;
CFXMLTreeRef itemTree;
CFIndex childCount, ix;
NSMutableString *valueMutable;
NSString *value;
NSString *name;
childCount = CFTreeGetChildCount (tree);
valueMutable = [[NSMutableString alloc] init];
for (ix = 0; ix < childCount; ix++) {
itemTree = CFTreeGetChildAtIndex (tree, ix);
node = CFXMLTreeGetNode (itemTree);
name = (NSString *) CFXMLNodeGetString (node);
if (name != nil) {
if (CFXMLNodeGetTypeCode (node) == kCFXMLNodeTypeEntityReference) {
if ([name isEqualTo: @"lt"])
name = @"<";
else if ([name isEqualTo: @"gt"])
name = @">";
else if ([name isEqualTo: @"quot"])
name = @"\"";
else if ([name isEqualTo: @"amp"])
name = @"&";
else if ([name isEqualTo: @"rsquo"]) {
char rsquo[4] = { 0xe2, 0x80, 0x99, 0x0 };
name = [NSString stringWithUTF8String: rsquo];
}
else if ([name isEqualTo: @"lsquo"]) {
char lsquo[4] = { 0xe2, 0x80, 0x98, 0x0 };
name = [NSString stringWithUTF8String: lsquo];
}
else if ([name isEqualTo: @"apos"])
name = @"'";
else
name = [NSString stringWithFormat: @"&%@;", name];
} /*if*/
[valueMutable appendString: name];
} /*if*/
} /*for*/
value = [[valueMutable trimWhiteSpace] retain];
[valueMutable autorelease];
return ([value autorelease]);
} /*getelementvalue*/
@end
@@ -0,0 +1,65 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "icon_16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "icon_32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256x256.png",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@@ -4,14 +4,78 @@
<dict>
<key>ADP2,1</key>
<string>Developer Transition Kit</string>
<key>iMac1,1</key>
<string>iMac G3 (Rev A-D)</string>
<key>iMac4,1</key>
<string>iMac (Core Duo)</string>
<key>iMac4,2</key>
<string>iMac for Education (17 inch, Core Duo)</string>
<key>iMac5,1</key>
<string>iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)</string>
<key>iMac5,2</key>
<string>iMac (Core 2 Duo, 17 inch, Combo Drive)</string>
<key>iMac6,1</key>
<string>iMac (Core 2 Duo, 24 inch, SuperDrive)</string>
<key>iMac8,1</key>
<string>iMac (Core 2 Duo, 20 or 24 inch, Early 2008 )</string>
<key>iMac9,1</key>
<string>iMac (Core 2 Duo, 20 or 24 inch, Early or Mid 2009 )</string>
<key>iMac10,1</key>
<string>iMac (Core 2 Duo, 21.5 or 27 inch, Late 2009 )</string>
<key>iMac11,1</key>
<string>iMac (Core i5 or i7, 27 inch Late 2009)</string>
<key>iMac11,2</key>
<string>iMac (Core i3 or i5, 27 inch Mid 2010)</string>
<key>iMac11,3</key>
<string>iMac (Core i5 or i7, 27 inch Mid 2010)</string>
<key>iMac12,1</key>
<string>iMac (Core i3 or i5 or i7, 21.5 inch Mid 2010 or Late 2011)</string>
<key>iMac12,2</key>
<string>iMac (Core i5 or i7, 27 inch Mid 2011)</string>
<key>iMac13,1</key>
<string>iMac (Core i3 or i5 or i7, 21.5 inch Late 2012 or Early 2013)</string>
<key>iMac13,2</key>
<string>iMac (Core i5 or i7, 27 inch Late 2012)</string>
<key>iMac14,1</key>
<string>iMac (Core i5, 21.5 inch Late 2013)</string>
<key>iMac14,2</key>
<string>iMac (Core i5 or i7, 27 inch Late 2013)</string>
<key>iMac14,3</key>
<string>iMac (Core i5 or i7, 21.5 inch Late 2013)</string>
<key>MacBook1,1</key>
<string>MacBook (Core Duo)</string>
<key>MacBook2,1</key>
<string>MacBook (Core 2 Duo)</string>
<key>MacBook4,1</key>
<string>MacBook (Core 2 Duo Feb 2008)</string>
<key>MacBook5,1</key>
<string>MacBook (Core 2 Duo, Late 2008, Unibody)</string>
<key>MacBook5,2</key>
<string>MacBook (Core 2 Duo, Early 2009, White)</string>
<key>MacBook6,1</key>
<string>MacBook (Core 2 Duo, Late 2009, Unibody)</string>
<key>MacBook7,1</key>
<string>MacBook (Core 2 Duo, Mid 2010, White)</string>
<key>MacBookAir1,1</key>
<string>MacBook Air (January 2008)</string>
<string>MacBook Air (Core 2 Duo, 13 inch, Early 2008)</string>
<key>MacBookAir2,1</key>
<string>MacBook Air (Core 2 Duo, 13 inch, Mid 2009)</string>
<key>MacBookAir3,1</key>
<string>MacBook Air (Core 2 Duo, 11 inch, Late 2010)</string>
<key>MacBookAir3,2</key>
<string>MacBook Air (Core 2 Duo, 13 inch, Late 2010)</string>
<key>MacBookAir4,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2011)</string>
<key>MacBookAir4,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2011)</string>
<key>MacBookAir5,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2012)</string>
<key>MacBookAir5,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2012)</string>
<key>MacBookAir6,1</key>
<string>MacBook Air (Core i5 or i7, 11 inch, Mid 2013 or Early 2014)</string>
<key>MacBookAir6,2</key>
<string>MacBook Air (Core i5 or i7, 13 inch, Mid 2013 or Early 2014)</string>
<key>MacBookPro1,1</key>
<string>MacBook Pro Core Duo (15-inch)</string>
<key>MacBookPro1,2</key>
@@ -26,14 +90,18 @@
<string>MacBook Pro Core 2 Duo (17-inch HD, Core 2 Duo)</string>
<key>MacBookPro4,1</key>
<string>MacBook Pro (Core 2 Duo Feb 2008)</string>
<key>Macmini1,1</key>
<string>Mac Mini (Core Solo/Duo)</string>
<key>MacPro1,1</key>
<string>Mac Pro (four-core)</string>
<key>MacPro2,1</key>
<string>Mac Pro (eight-core)</string>
<key>MacPro3,1</key>
<string>Mac Pro (January 2008 4- or 8- core "Harpertown")</string>
<key>Macmini1,1</key>
<string>Mac Mini (Core Solo/Duo)</string>
<string>Mac Pro (January 2008 4- or 8- core &quot;Harpertown&quot;)</string>
<key>MacPro4,1</key>
<string>Mac Pro (March 2009)</string>
<key>MacPro5,1</key>
<string>Mac Pro (August 2010)</string>
<key>PowerBook1,1</key>
<string>PowerBook G3</string>
<key>PowerBook2,1</key>
@@ -156,19 +224,5 @@
<string>Xserve (Intel Xeon)</string>
<key>Xserve2,1</key>
<string>Xserve (January 2008 quad-core)</string>
<key>iMac1,1</key>
<string>iMac G3 (Rev A-D)</string>
<key>iMac4,1</key>
<string>iMac (Core Duo)</string>
<key>iMac4,2</key>
<string>iMac for Education (17-inch, Core Duo)</string>
<key>iMac5,1</key>
<string>iMac (Core 2 Duo, 17 or 20 inch, SuperDrive)</string>
<key>iMac5,2</key>
<string>iMac (Core 2 Duo, 17 inch, Combo Drive)</string>
<key>iMac6,1</key>
<string>iMac (Core 2 Duo, 24 inch, SuperDrive)</string>
<key>iMac8,1</key>
<string>iMac (April 2008)</string>
</dict>
</plist>
+39
View File
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Your Great App's Changelog</title>
<link>http://you.com/app/appcast.xml</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/2.0.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your%20Great%20App%202.0.zip" sparkle:version="2.0" length="1623481" type="application/octet-stream" sparkle:dsaSignature="BAFJW4B6B1K1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
<item>
<title>Version 1.5 (8 bugs fixed; 2 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/1.5.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your%20Great%20App%201.5.zip" sparkle:version="1.5" length="1472893" type="application/octet-stream" sparkle:dsaSignature="234818feCa1JyW30nbkBwainOzrN6EQuAh" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
<item>
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
<sparkle:releaseNotesLink>
http://you.com/app/1.4.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
<enclosure url="http://you.com/app/Your%20Great%20App%201.4.zip" sparkle:version="241" sparkle:shortVersionString="1.4" sparkle:dsaSignature="MC0CFBfeCa1JyW30nbkBwainOzrN6EQuAh=" length="1472349" type="application/octet-stream" />
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
</item>
</channel>
</rss>
Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

-85
View File
@@ -1,85 +0,0 @@
//
// SUAppcast.m
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUAppcast.h"
@interface SUAppcast (Private)
- (void)reportError:(NSError *)error;
@end
@implementation SUAppcast
- (void)dealloc
{
[items release];
[super dealloc];
}
- (NSArray *)items
{
return items;
}
- (void)fetchAppcastFromURL:(NSURL *)url
{
RSS *feed = [[RSS alloc] initWithURL:url userAgent:userAgentString delegate:self];
CFRetain(feed); // Manage the RSS feed's memory manually.
}
- (void)feedDidFinishLoading:(RSS *)feed
{
// Set up all the appcast items:
NSArray *tempItems = [NSMutableArray array];
id enumerator = [[feed newsItems] objectEnumerator], current;
@try
{
while ((current = [enumerator nextObject]))
{
[(NSMutableArray *)tempItems addObject:[[[SUAppcastItem alloc] initWithDictionary:current] autorelease]];
}
items = [[NSArray arrayWithArray:tempItems] retain]; // Make the items list immutable.
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
[delegate performSelectorOnMainThread:@selector(appcastDidFinishLoading:) withObject:self waitUntilDone:NO];
}
@catch (NSException *parseException)
{
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, [parseException reason], SUTechnicalErrorInformationKey, nil]]];
}
CFRelease(feed);
}
- (void)feed:(RSS *)feed didFailWithError:(NSError *)error
{
[self reportError:error];
}
- (void)reportError:(NSError *)error
{
if ([delegate respondsToSelector:@selector(appcast:failedToLoadWithError:)])
{
[delegate appcast:self failedToLoadWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred in retrieving update information. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
}
}
- (void)setUserAgentString:(NSString *)uas
{
if (uas != userAgentString)
{
[userAgentString release];
userAgentString = [uas copy];
}
}
- (void)setDelegate:del
{
delegate = del;
}
@end
-48
View File
@@ -1,48 +0,0 @@
//
// SUAppcastItem.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H
@interface SUAppcastItem : NSObject {
NSString *title;
NSDate *date;
NSString *description;
NSURL *releaseNotesURL;
NSString *DSASignature;
NSString *minimumSystemVersion;
NSURL *fileURL;
NSString *versionString;
NSString *displayVersionString;
NSDictionary *propertiesDictionary;
}
// Initializes with data from a dictionary provided by the RSS class.
- initWithDictionary:(NSDictionary *)dict;
- (NSString *)title;
- (NSString *)versionString;
- (NSString *)displayVersionString;
- (NSDate *)date;
- (NSString *)description;
- (NSURL *)releaseNotesURL;
- (NSURL *)fileURL;
- (NSString *)DSASignature;
- (NSString *)minimumSystemVersion;
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
- (NSDictionary *)propertiesDictionary;
@end
#endif
-178
View File
@@ -1,178 +0,0 @@
//
// SUAppcastItem.m
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUAppcastItem.h"
@implementation SUAppcastItem
// Attack of accessors!
- (NSString *)title { return [[title retain] autorelease]; }
- (void)setTitle:(NSString *)aTitle
{
if (title == aTitle) return;
[title release];
title = [aTitle copy];
}
- (NSDate *)date { return [[date retain] autorelease]; }
- (void)setDate:(NSDate *)aDate
{
if (date == aDate) return;
[date release];
date = [aDate copy];
}
- (NSString *)description { return [[description retain] autorelease]; }
- (void)setDescription:(NSString *)aDescription
{
if (description == aDescription) return;
[description release];
description = [aDescription copy];
}
- (NSURL *)releaseNotesURL { return [[releaseNotesURL retain] autorelease]; }
- (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL
{
if (releaseNotesURL == aReleaseNotesURL) return;
[releaseNotesURL release];
releaseNotesURL = [aReleaseNotesURL copy];
}
- (NSString *)DSASignature { return [[DSASignature retain] autorelease]; }
- (void)setDSASignature:(NSString *)aDSASignature
{
if (DSASignature == aDSASignature) return;
[DSASignature release];
DSASignature = [aDSASignature copy];
}
- (NSURL *)fileURL { return [[fileURL retain] autorelease]; }
- (void)setFileURL:(NSURL *)aFileURL
{
if (fileURL == aFileURL) return;
[fileURL release];
fileURL = [aFileURL copy];
}
- (NSString *)versionString { return [[versionString retain] autorelease]; }
- (void)setVersionString:(NSString *)s
{
if (versionString == s) return;
[versionString release];
versionString = [s copy];
}
- (NSString *)displayVersionString { return [[displayVersionString retain] autorelease]; }
- (void)setDisplayVersionString:(NSString *)s
{
if (displayVersionString == s) return;
[displayVersionString release];
displayVersionString = [s copy];
}
- (NSString *)minimumSystemVersion { return [[minimumSystemVersion retain] autorelease]; }
- (void)setMinimumSystemVersion:(NSString *)systemVersionString
{
if (minimumSystemVersion == systemVersionString) return;
[minimumSystemVersion release];
minimumSystemVersion = [systemVersionString copy];
}
- initWithDictionary:(NSDictionary *)dict
{
self = [super init];
if (self)
{
propertiesDictionary = [dict retain];
[self setTitle:[dict objectForKey:@"title"]];
[self setDate:[dict objectForKey:@"pubDate"]];
[self setDescription:[dict objectForKey:@"description"]];
id enclosure = [dict objectForKey:@"enclosure"];
if (enclosure == nil || [enclosure objectForKey:@"url"] == nil)
[NSException raise:@"SUAppcastException" format:@"Couldn't find an download URL for feed entry %@!", [self title]];
[self setFileURL:[NSURL URLWithString:[[enclosure objectForKey:@"url"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
[self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
// Try to find a version string.
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
// 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec.
// 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting
// that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last
// underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension.
// The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle.
// Feel free to change the separator string to a hyphen or something more suited to your needs if you like.
NSString *newVersion = [enclosure objectForKey:@"sparkle:version"];
if (!newVersion) // no sparkle:version attribute
{
// Separate the url by underscores and take the last component, as that'll be closest to the end,
// then we remove the extension. Hopefully, this will be the version.
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
if ([fileComponents count] > 1)
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
else
[NSException raise:@"SUAppcastException" format:@"Couldn't find a version string for %@! You need a sparkle:version attribute.", [enclosure objectForKey:@"url"]];
}
[self setVersionString:newVersion];
[self setMinimumSystemVersion:[dict objectForKey:@"sparkle:minimumSystemVersion"]];
NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
if (shortVersionString)
[self setDisplayVersionString:shortVersionString];
else
[self setDisplayVersionString:[self versionString]];
// Find the appropriate release notes URL.
if ([dict objectForKey:@"sparkle:releaseNotesLink"])
[self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
else if ([[self description] hasPrefix:@"http://"]) // if the description starts with http://, use that.
[self setReleaseNotesURL:[NSURL URLWithString:[self description]]];
else
[self setReleaseNotesURL:nil];
}
return self;
}
- (void)dealloc
{
[self setTitle:nil];
[self setDate:nil];
[self setDescription:nil];
[self setReleaseNotesURL:nil];
[self setDSASignature:nil];
[self setFileURL:nil];
[self setVersionString:nil];
[self setDisplayVersionString:nil];
[propertiesDictionary release];
[super dealloc];
}
- (NSDictionary *)propertiesDictionary
{
return propertiesDictionary;
}
@end
-69
View File
@@ -1,69 +0,0 @@
//
// SUAutomaticUpdateAlert.m
// Sparkle
//
// Created by Andy Matuschak on 3/18/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUAutomaticUpdateAlert.h"
@implementation SUAutomaticUpdateAlert
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb delegate:del;
{
self = [super initWithHostBundle:hb windowNibName:@"SUAutomaticUpdateAlert"];
if (self)
{
updateItem = [item retain];
delegate = del;
hostBundle = [hb retain];
[self setShouldCascadeWindows:NO];
[[self window] center];
}
return self;
}
- (void)dealloc
{
[hostBundle release];
[updateItem release];
[super dealloc];
}
- (IBAction)installNow:sender
{
[self close];
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallNowChoice];
}
- (IBAction)installLater:sender
{
[self close];
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallLaterChoice];
}
- (IBAction)doNotInstall:sender
{
[self close];
[delegate automaticUpdateAlert:self finishedWithChoice:SUDoNotInstallChoice];
}
- (NSImage *)applicationIcon
{
return [hostBundle icon];
}
- (NSString *)titleText
{
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [hostBundle name]];
}
- (NSString *)descriptionText
{
return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [hostBundle name], [hostBundle displayVersion]];
}
@end
-77
View File
@@ -1,77 +0,0 @@
//
// SUAutomaticUpdateDriver.m
// Sparkle
//
// Created by Andy Matuschak on 5/6/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUAutomaticUpdateDriver.h"
#import "Sparkle.h"
@implementation SUAutomaticUpdateDriver
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem hostBundle:hostBundle delegate:self];
if ([NSApp isActive])
[[alert window] makeKeyAndOrderFront:self];
else
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
}
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
[[alert window] makeKeyAndOrderFront:self];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSApplicationDidBecomeActiveNotification" object:NSApp];
}
- (void)automaticUpdateAlert:(SUAutomaticUpdateAlert *)aua finishedWithChoice:(SUAutomaticInstallationChoice)choice;
{
switch (choice)
{
case SUInstallNowChoice:
[self installUpdate];
break;
case SUInstallLaterChoice:
postponingInstallation = YES;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
break;
case SUDoNotInstallChoice:
[[SUUserDefaults standardUserDefaults] setObject:[updateItem versionString] forKey:SUSkippedVersionKey];
[self abortUpdate];
break;
}
}
- (BOOL)shouldInstallSynchronously { return postponingInstallation; }
- (void)installUpdate
{
showErrors = YES;
[super installUpdate];
}
- (void)applicationWillTerminate:(NSNotification *)note
{
[self installUpdate];
}
- (void)installerFinishedForHostBundle:(NSBundle *)hb
{
if (hb != hostBundle) { return; }
if (!postponingInstallation)
[self relaunchHostApp];
}
- (void)abortUpdateWithError:(NSError *)error
{
if (showErrors)
[super abortUpdateWithError:error];
else
[self abortUpdate];
}
@end
-282
View File
@@ -1,282 +0,0 @@
//
// SUBasicUpdateDriver.m
// Sparkle
//
// Created by Andy Matuschak on 4/23/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUBasicUpdateDriver.h"
#import "Sparkle.h"
@implementation SUBasicUpdateDriver
- (void)checkForUpdatesAtURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hb
{
hostBundle = [hb retain];
if ([hostBundle isRunningFromDiskImage])
{
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a disk image. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
return;
}
SUAppcast *appcast = [[SUAppcast alloc] init];
CFRetain(appcast); // We'll manage the appcast's memory ourselves so we don't have to make it an IV to support GC.
[appcast release];
[appcast setDelegate:self];
[appcast setUserAgentString:[NSString stringWithFormat: @"%@/%@ Sparkle/1.5b2", [hostBundle name], [hostBundle displayVersion]]];
[appcast fetchAppcastFromURL:appcastURL];
}
- (BOOL)isItemNewer:(SUAppcastItem *)ui
{
return [[SUStandardVersionComparator defaultComparator] compareVersion:[hostBundle version]
toVersion:[ui versionString]] == NSOrderedAscending;
}
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
{
if ([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) { return YES; }
return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion]
toVersion:[NSWorkspace systemVersionString]] != NSOrderedDescending;
}
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
{
NSString *skippedVersion = [[SUUserDefaults standardUserDefaults] objectForKey:SUSkippedVersionKey];
if (skippedVersion == nil) { return NO; }
return [[SUStandardVersionComparator defaultComparator] compareVersion:[ui versionString]
toVersion:skippedVersion] != NSOrderedDescending;
}
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
{
return [self hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
}
- (void)appcastDidFinishLoading:(SUAppcast *)ac
{
if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:forHostBundle:)])
[delegate appcastDidFinishLoading:ac forHostBundle:hostBundle];
NSArray* updates = [ac items];
if ([updates count] > 0)
[[SUUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SULastCheckTimeKey];
// Now we have to find the best valid update in the appcast.
if ([delegate respondsToSelector:@selector(bestValidUpdateInAppcast:forHostBundle:)]) // Does the delegate want to handle it?
{
updateItem = [delegate bestValidUpdateInAppcast:ac forHostBundle:hostBundle];
}
else // If not, we'll take care of it ourselves.
{
// Find the first update we can actually use.
NSEnumerator *updateEnumerator = [updates objectEnumerator];
do {
updateItem = [updateEnumerator nextObject];
} while (updateItem && ![self hostSupportsItem:updateItem]);
[updateItem retain];
}
CFRelease(ac); // Remember that we're explicitly managing the memory of the appcast.
if (updateItem == nil) { [self didNotFindUpdate]; return; }
if ([self itemContainsValidUpdate:updateItem])
[self didFindValidUpdate];
else
[self didNotFindUpdate];
}
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
{
CFRelease(ac); // Remember that we're explicitly managing the memory of the appcast.
[self abortUpdateWithError:error];
}
- (void)didFindValidUpdate
{
if ([delegate respondsToSelector:@selector(didFindValidUpdate:toHostBundle:)])
[delegate didFindValidUpdate:updateItem toHostBundle:hostBundle];
[self downloadUpdate];
}
- (void)didNotFindUpdate
{
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
[delegate didNotFindUpdateToHostBundle:hostBundle];
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [hostBundle name]] forKey:NSLocalizedDescriptionKey]]];
}
- (void)downloadUpdate
{
download = [[NSURLDownload alloc] initWithRequest:[NSURLRequest requestWithURL:[updateItem fileURL]] delegate:self];
}
- (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSString *)name
{
// If name ends in .txt, the server probably has a stupid MIME configuration. We'll give the developer the benefit of the doubt and chop that off.
if ([[name pathExtension] isEqualToString:@"txt"])
name = [name stringByDeletingPathExtension];
// We create a temporary directory in /tmp and stick the file there.
// Not using a GUID here because hdiutil for some reason chokes on GUIDs. Too long? I really have no idea.
NSString *prefix = [NSString stringWithFormat:@"%@ %@ Update", [hostBundle name], [hostBundle version]];
NSString *tempDir = [NSTemporaryDirectory() stringByAppendingPathComponent:prefix];
int cnt=1;
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999999)
tempDir = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %d", prefix, cnt++]];
BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:tempDir attributes:nil];
if (!success)
{
// Okay, something's really broken with /tmp
[download cancel];
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir] forKey:NSLocalizedDescriptionKey]]];
}
downloadPath = [[tempDir stringByAppendingPathComponent:name] retain];
[download setDestination:downloadPath allowOverwrite:YES];
}
- (void)downloadDidFinish:(NSURLDownload *)d
{
[self extractUpdate];
}
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
{
// Get rid of what we've downloaded so far, if anything.
if (downloadPath != nil)
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[downloadPath stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[downloadPath lastPathComponent]] tag:NULL];
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
}
- (void)extractUpdate
{
// DSA verification, if activated by the developer
if ([[hostBundle objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue])
{
if (![[NSFileManager defaultManager] validatePath:downloadPath withEncodedDSASignature:[updateItem DSASignature] withPublicDSAKey:[hostBundle publicDSAKey]])
{
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObject:@"The update is improperly signed." forKey:NSLocalizedDescriptionKey]]];
return;
}
}
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForURL:[[[NSURL alloc] initFileURLWithPath:downloadPath] autorelease]];
if (!unarchiver)
{
NSLog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
[self unarchiverDidFail:nil];
return;
}
CFRetain(unarchiver); // Manage this memory manually so we don't have to make it an IV.
[unarchiver setDelegate:self];
[unarchiver start];
}
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
if (ua) { CFRelease(ua); }
[self installUpdate];
}
- (void)unarchiverDidFail:(SUUnarchiver *)ua
{
if (ua) { CFRelease(ua); }
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) forKey:NSLocalizedDescriptionKey]]];
}
- (BOOL)shouldInstallSynchronously { return NO; }
- (void)installUpdate
{
if ([delegate respondsToSelector:@selector(updateWillInstall:toHostBundle:)])
[delegate updateWillInstall:updateItem toHostBundle:hostBundle];
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
NSString *relaunchPathToCopy = [[NSBundle bundleForClass:[self class]] pathForResource:@"relaunch" ofType:@""];
NSString *targetPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems
[[NSFileManager defaultManager] removeFileAtPath:targetPath handler:nil];
if ([[NSFileManager defaultManager] copyPath:relaunchPathToCopy toPath:targetPath handler:nil])
relaunchPath = [targetPath retain];
[SUInstaller installFromUpdateFolder:[downloadPath stringByDeletingLastPathComponent] overHostBundle:hostBundle delegate:self synchronously:[self shouldInstallSynchronously]];
}
- (void)installerFinishedForHostBundle:(NSBundle *)hb
{
if (hb != hostBundle) { return; }
[self relaunchHostApp];
}
- (void)relaunchHostApp
{
// Give the host app an opportunity to postpone the relaunch.
static BOOL postponedOnce = NO;
if (!postponedOnce && [delegate respondsToSelector:@selector(shouldPostponeRelaunchForUpdate:toHostBundle:untilInvoking:)])
{
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[[self class] instanceMethodSignatureForSelector:@selector(relaunchHostApp)] retain]];
[invocation setSelector:@selector(relaunchHostApp)];
[invocation setTarget:self];
postponedOnce = YES;
if ([delegate shouldPostponeRelaunchForUpdate:updateItem toHostBundle:hostBundle untilInvoking:invocation])
return;
}
[self cleanUp]; // Clean up the download and extracted files.
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
if ([delegate respondsToSelector:@selector(updaterWillRelaunchApplication)])
[delegate updaterWillRelaunchApplication];
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
{
// Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin.
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [[NSBundle mainBundle] name]], NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath], NSLocalizedFailureReasonErrorKey, nil]]];
// We intentionally don't abandon the update here so that the host won't initiate another.
return;
}
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[hostBundle bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
[NSApp terminate:self];
}
- (void)cleanUp
{
[[NSFileManager defaultManager] removeFileAtPath:[downloadPath stringByDeletingLastPathComponent] handler:nil];
}
- (void)installerForHostBundle:(NSBundle *)hb failedWithError:(NSError *)error
{
if (hb != hostBundle) { return; }
[[NSFileManager defaultManager] removeFileAtPath:relaunchPath handler:NULL]; // Clean up the copied relauncher.
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while installing the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
}
- (void)abortUpdate
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super abortUpdate];
}
- (void)abortUpdateWithError:(NSError *)error
{
if ([error code] != SUNoUpdateError) // Let's not bother logging this.
NSLog(@"Sparkle Error: %@", [error localizedDescription]);
if ([error localizedFailureReason])
NSLog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
[self abortUpdate];
}
- (void)dealloc
{
[hostBundle release];
[downloadPath release];
[relaunchPath release];
[super dealloc];
}
@end
-72
View File
@@ -1,72 +0,0 @@
//
// SUConstants.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUCONSTANTS_H
#define SUCONSTANTS_H
extern NSString *SUUpdaterWillRestartNotification;
extern NSString *SUTechnicalErrorInformationKey;
extern NSString *SUFeedURLKey;
extern NSString *SUHasLaunchedBeforeKey;
extern NSString *SUShowReleaseNotesKey;
extern NSString *SUSkippedVersionKey;
extern NSString *SUScheduledCheckIntervalKey;
extern NSString *SULastCheckTimeKey;
extern NSString *SUExpectsDSASignatureKey;
extern NSString *SUPublicDSAKeyKey;
extern NSString *SUPublicDSAKeyFileKey;
extern NSString *SUAutomaticallyUpdateKey;
extern NSString *SUAllowsAutomaticUpdatesKey;
extern NSString *SUEnableAutomaticChecksKey;
extern NSString *SUEnableAutomaticChecksKeyOld;
extern NSString *SUEnableSystemProfilingKey;
extern NSString *SUSendProfileInfoKey;
extern NSString *SUSparkleErrorDomain;
// Appcast phase errors.
extern OSStatus SUAppcastParseError;
extern OSStatus SUNoUpdateError;
extern OSStatus SUAppcastError;
extern OSStatus SURunningFromDiskImageError;
// Downlaod phase errors.
extern OSStatus SUTemporaryDirectoryError;
// Extraction phase errors.
extern OSStatus SUUnarchivingError;
extern OSStatus SUSignatureError;
// Installation phase errors.
extern OSStatus SUFileCopyFailure;
extern OSStatus SUAuthenticationFailure;
extern OSStatus SUMissingUpdateError;
extern OSStatus SUMissingInstallerToolError;
extern OSStatus SURelaunchError;
extern OSStatus SUInstallationError;
// NSInteger is a type that was added to Leopard.
// Here is some glue to ensure that NSInteger will work with pre-10.5 SDKs:
#ifndef NSINTEGER_DEFINED
#ifdef NS_BUILD_32_LIKE_64
typedef long NSInteger;
typedef unsigned long NSUInteger;
#else
typedef int NSInteger;
typedef unsigned int NSUInteger;
#endif
#define NSIntegerMax LONG_MAX
#define NSIntegerMin LONG_MIN
#define NSUIntegerMax ULONG_MAX
#define NSINTEGER_DEFINED 1
#endif
#endif
-47
View File
@@ -1,47 +0,0 @@
//
// SUConstants.m
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUConstants.h"
NSString *SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotificationName";
NSString *SUTechnicalErrorInformationKey = @"SUTechnicalErrorInformation";
NSString *SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore";
NSString *SUFeedURLKey = @"SUFeedURL";
NSString *SUShowReleaseNotesKey = @"SUShowReleaseNotes";
NSString *SUSkippedVersionKey = @"SUSkippedVersion";
NSString *SUScheduledCheckIntervalKey = @"SUScheduledCheckInterval";
NSString *SULastCheckTimeKey = @"SULastCheckTime";
NSString *SUExpectsDSASignatureKey = @"SUExpectsDSASignature";
NSString *SUPublicDSAKeyKey = @"SUPublicDSAKey";
NSString *SUPublicDSAKeyFileKey = @"SUPublicDSAKeyFile";
NSString *SUAutomaticallyUpdateKey = @"SUAutomaticallyUpdate";
NSString *SUAllowsAutomaticUpdatesKey = @"SUAllowsAutomaticUpdates";
NSString *SUEnableSystemProfilingKey = @"SUEnableSystemProfiling";
NSString *SUEnableAutomaticChecksKey = @"SUEnableAutomaticChecks";
NSString *SUEnableAutomaticChecksKeyOld = @"SUCheckAtStartup";
NSString *SUSendProfileInfoKey = @"SUSendProfileInfo";
NSString *SUSparkleErrorDomain = @"SUSparkleErrorDomain";
OSStatus SUAppcastParseError = 1000;
OSStatus SUNoUpdateError = 1001;
OSStatus SUAppcastError = 1002;
OSStatus SURunningFromDiskImageError = 1003;
OSStatus SUTemporaryDirectoryError = 2000;
OSStatus SUUnarchivingError = 3000;
OSStatus SUSignatureError = 3001;
OSStatus SUFileCopyFailure = 4000;
OSStatus SUAuthenticationFailure = 4001;
OSStatus SUMissingUpdateError = 4002;
OSStatus SUMissingInstallerToolError = 4003;
OSStatus SURelaunchError = 4004;
OSStatus SUInstallationError = 4005;
-79
View File
@@ -1,79 +0,0 @@
//
// SUDiskImageUnarchiver.m
// Sparkle
//
// Created by Andy Matuschak on 6/16/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUDiskImageUnarchiver.h"
#import "SUUnarchiver_Private.h"
#import "NTSynchronousTask.h"
@implementation SUDiskImageUnarchiver
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
{
return [URL conformsToType:@"public.disk-image"];
}
- (void)start
{
[NSThread detachNewThreadSelector:@selector(_extractDMG) toTarget:self withObject:nil];
}
- (void)_extractDMG
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *archivePath = [archiveURL path];
BOOL mountedSuccessfully = NO;
// get a unique mount point path
NSString *mountPrefix = [@"/Volumes" stringByAppendingPathComponent:[[archivePath lastPathComponent] stringByDeletingPathExtension]];
NSString *mountPoint = [mountPrefix stringByAppendingString:[[NSProcessInfo processInfo] globallyUniqueString]];
if ([[NSFileManager defaultManager] fileExistsAtPath:mountPoint]) goto reportError;
// create mount point folder
[[NSFileManager defaultManager] createDirectoryAtPath:mountPoint attributes:nil];
if (![[NSFileManager defaultManager] fileExistsAtPath:mountPoint]) goto reportError;
NSArray* arguments = [NSArray arrayWithObjects:@"attach", archivePath, @"-mountpoint", mountPoint, @"-noverify", @"-nobrowse", @"-noautoopen", nil];
// set up a pipe and push "yes" (y works too), this will accept any license agreement crap
// not every .dmg needs this, but this will make sure it works with everyone
NSData* yesData = [[[NSData alloc] initWithBytes:"yes\n" length:4] autorelease];
NSData *result = [NTSynchronousTask task:@"/usr/bin/hdiutil" directory:@"/" withArgs:arguments input:yesData];
if (!result) goto reportError;
mountedSuccessfully = YES;
// Now that we've mounted it, we need to copy out its contents.
NSString *targetPath = [[archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[mountPoint lastPathComponent]];
if (![[NSFileManager defaultManager] createDirectoryAtPath:targetPath attributes:nil]) goto reportError;
// We can't just copyPath: from the volume root because that always fails. Seems to be a bug.
id subpathEnumerator = [[[NSFileManager defaultManager] directoryContentsAtPath:mountPoint] objectEnumerator], currentSubpath;
while ((currentSubpath = [subpathEnumerator nextObject]))
{
if (![[NSFileManager defaultManager] copyPath:[mountPoint stringByAppendingPathComponent:currentSubpath] toPath:[targetPath stringByAppendingPathComponent:currentSubpath] handler:nil])
goto reportError;
}
[self performSelectorOnMainThread:@selector(_notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
goto finally;
reportError:
[self performSelectorOnMainThread:@selector(_notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
finally:
if (mountedSuccessfully)
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:[NSArray arrayWithObjects:@"detach", mountPoint, @"-force", nil]];
[pool drain];
}
+ (void)load
{
[self _registerImplementation:self];
}
@end
-24
View File
@@ -1,24 +0,0 @@
//
// SUInstaller.h
// Sparkle
//
// Created by Andy Matuschak on 4/10/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef SUINSTALLER_H
#define SUINSTALLER_H
#import <Cocoa/Cocoa.h>
@interface SUInstaller : NSObject { }
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
+ (void)_finishInstallationWithResult:(BOOL)result hostBundle:(NSBundle *)hostBundle error:(NSError *)error delegate:delegate;
@end
@interface NSObject (SUInstallerDelegateInformalProtocol)
- (void)installerFinishedForHostBundle:(NSBundle *)hostBundle;
- (void)installerForHostBundle:(NSBundle *)hostBundle failedWithError:(NSError *)error;
@end
#endif
-86
View File
@@ -1,86 +0,0 @@
//
// SUInstaller.m
// Sparkle
//
// Created by Andy Matuschak on 4/10/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUInstaller.h"
#import "SUPlainInstaller.h"
#import "SUPackageInstaller.h"
NSString *SUInstallerPathKey = @"SUInstallerPath";
NSString *SUInstallerHostBundleKey = @"SUInstallerHostBundle";
NSString *SUInstallerDelegateKey = @"SUInstallerDelegate";
@implementation SUInstaller
+ (void)installFromUpdateFolder:(NSString *)updateFolder overHostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously
{
// Search subdirectories for the application
NSString *currentFile, *newAppDownloadPath = nil, *bundleFileName = [[hostBundle bundlePath] lastPathComponent], *alternateBundleFileName = [[hostBundle name] stringByAppendingPathExtension:[[hostBundle bundlePath] pathExtension]];
BOOL isPackage = NO;
NSDirectoryEnumerator *dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:updateFolder];
while ((currentFile = [dirEnum nextObject]))
{
NSString *currentPath = [updateFolder stringByAppendingPathComponent:currentFile];
if ([[currentFile lastPathComponent] isEqualToString:bundleFileName] ||
[[currentFile lastPathComponent] isEqualToString:alternateBundleFileName]) // We found one!
{
isPackage = NO;
newAppDownloadPath = currentPath;
break;
}
else if (([[currentFile pathExtension] isEqualToString:@"pkg"] || [[currentFile pathExtension] isEqualToString:@"mpkg"]) &&
[[[currentFile lastPathComponent] stringByDeletingPathExtension] isEqualToString:[bundleFileName stringByDeletingPathExtension]])
{
isPackage = YES;
newAppDownloadPath = currentPath;
break;
}
// Some DMGs have symlinks into /Applications! That's no good! And there's no point in looking in bundles.
if ([[NSFileManager defaultManager] isAliasFolderAtPath:currentPath] ||
[[currentFile pathExtension] isEqualToString:[[hostBundle bundlePath] pathExtension]] ||
[[currentFile pathExtension] isEqualToString:@"pkg"] ||
[[currentFile pathExtension] isEqualToString:@"mpkg"])
{
[dirEnum skipDescendents];
}
}
if (newAppDownloadPath == nil)
{
[self _finishInstallationWithResult:NO hostBundle:hostBundle error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find an appropriate update in the downloaded package." forKey:NSLocalizedDescriptionKey]] delegate:delegate];
}
else
{
[(isPackage ? [SUPackageInstaller class] : [SUPlainInstaller class]) performInstallationWithPath:newAppDownloadPath hostBundle:hostBundle delegate:delegate synchronously:synchronously];
}
}
+ (void)_mdimportBundle:(NSBundle *)bundle
{
NSTask *mdimport = [[[NSTask alloc] init] autorelease];
[mdimport setLaunchPath:@"/usr/bin/mdimport"];
[mdimport setArguments:[NSArray arrayWithObject:[bundle bundlePath]]];
[mdimport launch];
}
+ (void)_finishInstallationWithResult:(BOOL)result hostBundle:(NSBundle *)hostBundle error:(NSError *)error delegate:delegate
{
if (result == YES)
{
[self _mdimportBundle:hostBundle];
if ([delegate respondsToSelector:@selector(installerFinishedForHostBundle:)])
[delegate installerFinishedForHostBundle:hostBundle];
}
else
{
if ([delegate respondsToSelector:@selector(installerForHostBundle:failedWithError:)])
[delegate installerForHostBundle:hostBundle failedWithError:error];
}
}
@end
-32
View File
@@ -1,32 +0,0 @@
//
// SUPackageInstaller.m
// Sparkle
//
// Created by Andy Matuschak on 4/10/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUPackageInstaller.h"
@implementation SUPackageInstaller
+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate
{
NSError *error = nil;
BOOL result = YES;
NSString *installerPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.apple.installer"];
installerPath = [installerPath stringByAppendingString:@"/Contents/MacOS/Installer"];
if (![[NSFileManager defaultManager] fileExistsAtPath:installerPath])
{
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:[NSDictionary dictionaryWithObject:@"Couldn't find Apple's installer tool!" forKey:NSLocalizedDescriptionKey]];
result = NO;
}
NSTask *installer = [NSTask launchedTaskWithLaunchPath:installerPath arguments:[NSArray arrayWithObjects:path, nil]];
[installer waitUntilExit];
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
[self _finishInstallationWithResult:result hostBundle:bundle error:error delegate:delegate];
}
@end
-106
View File
@@ -1,106 +0,0 @@
//
// SUPipedUnarchiver.m
// Sparkle
//
// Created by Andy Matuschak on 6/16/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUPipedUnarchiver.h"
#import "SUUnarchiver_Private.h"
@implementation SUPipedUnarchiver
+ (SEL)_selectorConformingToTypeOfURL:(NSURL *)URL
{
static NSDictionary *typeSelectorDictionary;
if (!typeSelectorDictionary)
typeSelectorDictionary = [[NSDictionary dictionaryWithObjectsAndKeys:@"_extractZIP", @"public.zip-archive", @"_extractTGZ", @"org.gnu.gnu-zip-tar-archive", @"_extractTBZ", @"org.bzip.bzip2-tar-archive", @"_extractTAR", @"public.tar-archive", nil] retain];
NSEnumerator *typeEnumerator = [typeSelectorDictionary keyEnumerator];
id currentType;
while ((currentType = [typeEnumerator nextObject]))
{
if ([URL conformsToType:currentType])
return NSSelectorFromString([typeSelectorDictionary objectForKey:currentType]);
}
return NULL;
}
- (void)start
{
[NSThread detachNewThreadSelector:[[self class] _selectorConformingToTypeOfURL:archiveURL] toTarget:self withObject:nil];
}
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
{
return ([self _selectorConformingToTypeOfURL:URL] != nil);
}
// This method abstracts the types that use a command line tool piping data from stdin.
- (void)_extractArchivePipingDataToCommand:(NSString *)command
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *archivePath = [archiveURL path];
FILE *fp = NULL, *cmdFP = NULL;
// Get the file size.
NSNumber *fs = [[[NSFileManager defaultManager] fileAttributesAtPath:archivePath traverseLink:NO] objectForKey:NSFileSize];
if (fs == nil) goto reportError;
// Thank you, Allan Odgaard!
// (who wrote the following extraction alg.)
fp = fopen([archivePath fileSystemRepresentation], "r");
if (!fp) goto reportError;
setenv("DESTINATION", [[archivePath stringByDeletingLastPathComponent] fileSystemRepresentation], 1);
cmdFP = popen([command fileSystemRepresentation], "w");
if (!cmdFP) goto reportError;
char buf[32*1024];
long len;
while((len = fread(buf, 1, 32*1024, fp)))
{
fwrite(buf, 1, len, cmdFP);
[self performSelectorOnMainThread:@selector(_notifyDelegateOfExtractedLength:) withObject:[NSNumber numberWithLong:len] waitUntilDone:NO];
}
pclose(cmdFP);
[self performSelectorOnMainThread:@selector(_notifyDelegateOfSuccess) withObject:nil waitUntilDone:NO];
goto finally;
reportError:
[self performSelectorOnMainThread:@selector(_notifyDelegateOfFailure) withObject:nil waitUntilDone:NO];
finally:
if (fp)
fclose(fp);
[pool drain];
}
- (void)_extractTAR
{
return [self _extractArchivePipingDataToCommand:@"tar -xC \"$DESTINATION\""];
}
- (void)_extractTGZ
{
return [self _extractArchivePipingDataToCommand:@"tar -zxC \"$DESTINATION\""];
}
- (void)_extractTBZ
{
return [self _extractArchivePipingDataToCommand:@"tar -jxC \"$DESTINATION\""];
}
- (void)_extractZIP
{
return [self _extractArchivePipingDataToCommand:@"ditto -x -k - \"$DESTINATION\""];
}
+ (void)load
{
[self _registerImplementation:self];
}
@end
-18
View File
@@ -1,18 +0,0 @@
//
// SUPlainInstaller.h
// Sparkle
//
// Created by Andy Matuschak on 4/10/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef SUPLAININSTALLER_H
#define SUPLAININSTALLER_H
#import "Sparkle.h"
@interface SUPlainInstaller : SUInstaller { }
+ (void)performInstallationWithPath:(NSString *)path hostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
@end
#endif
-42
View File
@@ -1,42 +0,0 @@
//
// SUPlainInstaller.m
// Sparkle
//
// Created by Andy Matuschak on 4/10/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUPlainInstaller.h"
extern NSString *SUInstallerPathKey;
extern NSString *SUInstallerHostBundleKey;
extern NSString *SUInstallerDelegateKey;
@implementation SUPlainInstaller
+ (void)installPath:(NSString *)path overHostBundle:(NSBundle *)bundle delegate:delegate
{
NSError *error;
BOOL result = [[NSFileManager defaultManager] copyPathWithAuthentication:path overPath:[bundle bundlePath] error:&error];
[self _finishInstallationWithResult:result hostBundle:bundle error:error delegate:delegate];
}
+ (void)_performInstallationWithInfo:(NSDictionary *)info
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[self installPath:[info objectForKey:SUInstallerPathKey] overHostBundle:[info objectForKey:SUInstallerHostBundleKey] delegate:[info objectForKey:SUInstallerDelegateKey]];
[pool drain];
}
+ (void)performInstallationWithPath:(NSString *)path hostBundle:(NSBundle *)hostBundle delegate:delegate synchronously:(BOOL)synchronously;
{
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:path, SUInstallerPathKey, hostBundle, SUInstallerHostBundleKey, delegate, SUInstallerDelegateKey, nil];
if (synchronously)
[self _performInstallationWithInfo:info];
else
[NSThread detachNewThreadSelector:@selector(_performInstallationWithInfo:) toTarget:self withObject:info];
}
@end
-26
View File
@@ -1,26 +0,0 @@
//
// SUProbingUpdateDriver.m
// Sparkle
//
// Created by Andy Matuschak on 5/7/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUProbingUpdateDriver.h"
@implementation SUProbingUpdateDriver
// Stop as soon as we have an answer! The superclasses will already have taken care of notifying the delegate.
- (void)didFindValidUpdate
{
[self abortUpdate];
}
- (void)didNotFindUpdate
{
[self abortUpdate];
}
@end
-33
View File
@@ -1,33 +0,0 @@
//
// SUScheduledUpdateDriver.m
// Sparkle
//
// Created by Andy Matuschak on 5/6/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUScheduledUpdateDriver.h"
#import "Sparkle.h"
@implementation SUScheduledUpdateDriver
- (void)didFindValidUpdate
{
showErrors = YES; // We only start showing errors after we present the UI for the first time.
[super didFindValidUpdate];
}
- (void)didNotFindUpdate
{
[self abortUpdate]; // Don't tell the user that no update was found; this was a scheduled update.
}
- (void)abortUpdateWithError:(NSError *)error
{
if (showErrors)
[super abortUpdateWithError:error];
else
[self abortUpdate];
}
@end
-36
View File
@@ -1,36 +0,0 @@
//
// SUStandardVersionComparator.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
#define SUSTANDARDVERSIONCOMPARATOR_H
#import "SUVersionComparisonProtocol.h"
/*!
@class
@abstract Sparkle's default version comparator.
@discussion This comparator is adapted from MacPAD, by Kevin Ballard. It's "dumb" in that it does essentially string comparison, in components split by character type.
*/
@interface SUStandardVersionComparator : NSObject <SUVersionComparison> { }
/*!
@method
@abstract Returns a singleton instance of the comparator.
*/
+ (SUStandardVersionComparator *)defaultComparator;
/*!
@method
@abstract Compares version strings through textual analysis.
@discussion See the implementation for more details.
*/
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
@end
#endif
-48
View File
@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBClasses</key>
<array>
<dict>
<key>CLASS</key>
<string>NSApplication</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSResponder</string>
</dict>
<dict>
<key>CLASS</key>
<string>FirstResponder</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>SUPERCLASS</key>
<string>NSObject</string>
</dict>
<dict>
<key>CLASS</key>
<string>NSObject</string>
<key>LANGUAGE</key>
<string>ObjC</string>
</dict>
<dict>
<key>CLASS</key>
<string>SUStatusController</string>
<key>LANGUAGE</key>
<string>ObjC</string>
<key>OUTLETS</key>
<dict>
<key>actionButton</key>
<string>NSButton</string>
<key>progressBar</key>
<string>NSProgressIndicator</string>
</dict>
<key>SUPERCLASS</key>
<string>NSWindowController</string>
</dict>
</array>
<key>IBVersion</key>
<string>1</string>
</dict>
</plist>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBFramework Version</key>
<string>629</string>
<key>IBLastKnownRelativeProjectPath</key>
<string>../Sparkle.xcodeproj</string>
<key>IBOldestOS</key>
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>9C31</string>
<key>targetFramework</key>
<string>IBCocoaFramework</string>
</dict>
</plist>
BIN
View File
Binary file not shown.
-41
View File
@@ -1,41 +0,0 @@
//
// SUStatusController.h
// Sparkle
//
// Created by Andy Matuschak on 3/14/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUSTATUSCONTROLLER_H
#define SUSTATUSCONTROLLER_H
#import "SUWindowController.h"
@interface SUStatusController : SUWindowController {
double progressValue, maxProgressValue;
NSString *title, *statusText, *buttonTitle;
IBOutlet NSButton *actionButton;
IBOutlet NSProgressIndicator* progressBar;
NSBundle *hostBundle;
}
- (id)initWithHostBundle:(NSBundle *)hostBundle;
// Pass 0 for the max progress value to get an indeterminate progress bar.
// Pass nil for the status text to not show it.
- (void)beginActionWithTitle:(NSString *)title maxProgressValue:(double)maxProgressValue statusText:(NSString *)statusText;
// If isDefault is YES, the button's key equivalent will be \r.
- (void)setButtonTitle:(NSString *)buttonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault;
- (void)setButtonEnabled:(BOOL)enabled;
- (double)progressValue;
- (void)setProgressValue:(double)value;
- (double)maxProgressValue;
- (void)setMaxProgressValue:(double)value;
- (void)setStatusText:(NSString *)statusText;
@end
#endif
-121
View File
@@ -1,121 +0,0 @@
//
// SUStatusController.m
// Sparkle
//
// Created by Andy Matuschak on 3/14/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUStatusController.h"
@implementation SUStatusController
- (id)initWithHostBundle:(NSBundle *)hb
{
self = [super initWithHostBundle:hb windowNibName:@"SUStatus"];
if (self)
{
hostBundle = [hb retain];
[self setShouldCascadeWindows:NO];
}
return self;
}
- (void)dealloc
{
[hostBundle release];
[title release];
[statusText release];
[buttonTitle release];
[super dealloc];
}
- (void)awakeFromNib
{
[[self window] center];
[[self window] setFrameAutosaveName:@"SUStatusFrame"];
[progressBar setUsesThreadedAnimation:YES];
}
- (NSString *)windowTitle
{
return [NSString stringWithFormat:SULocalizedString(@"Updating %@", nil), [hostBundle name]];
}
- (NSImage *)applicationIcon
{
return [hostBundle icon];
}
- (void)beginActionWithTitle:(NSString *)aTitle maxProgressValue:(double)aMaxProgressValue statusText:(NSString *)aStatusText
{
[self willChangeValueForKey:@"title"];
title = [aTitle copy];
[self didChangeValueForKey:@"title"];
[self setMaxProgressValue:aMaxProgressValue];
[self setStatusText:aStatusText];
}
- (void)setButtonTitle:(NSString *)aButtonTitle target:target action:(SEL)action isDefault:(BOOL)isDefault
{
[self willChangeValueForKey:@"buttonTitle"];
if (buttonTitle != aButtonTitle)
{
[buttonTitle release];
buttonTitle = [aButtonTitle copy];
}
[self didChangeValueForKey:@"buttonTitle"];
[self window];
[actionButton sizeToFit];
// Except we're going to add 15 px for padding.
[actionButton setFrameSize:NSMakeSize([actionButton frame].size.width + 15, [actionButton frame].size.height)];
// Now we have to move it over so that it's always 15px from the side of the window.
[actionButton setFrameOrigin:NSMakePoint([[self window] frame].size.width - 15 - [actionButton frame].size.width, [actionButton frame].origin.y)];
// Redisplay superview to clean up artifacts
[[actionButton superview] display];
[actionButton setTarget:target];
[actionButton setAction:action];
[actionButton setKeyEquivalent:isDefault ? @"\r" : @""];
}
- (void)setButtonEnabled:(BOOL)enabled
{
[actionButton setEnabled:enabled];
}
- (double)progressValue
{
return progressValue;
}
- (void)setProgressValue:(double)value
{
progressValue = value;
}
- (double)maxProgressValue
{
return maxProgressValue;
}
- (void)setMaxProgressValue:(double)value
{
maxProgressValue = value;
[self setProgressValue:0];
[progressBar setIndeterminate:(value == 0)];
}
- (void)setStatusText:(NSString *)aStatusText
{
if (statusText != aStatusText)
{
[statusText release];
statusText = [aStatusText copy];
}
}
@end
-129
View File
@@ -1,129 +0,0 @@
//
// SUSystemProfiler.m
// Sparkle
//
// Created by Andy Matuschak on 12/22/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
// Adapted from Sparkle+, by Tom Harrington.
//
#import "Sparkle.h"
#import "SUSystemProfiler.h"
#import <sys/sysctl.h>
@implementation SUSystemProfiler
+ (SUSystemProfiler *)sharedSystemProfiler
{
static SUSystemProfiler *sharedSystemProfiler = nil;
if (!sharedSystemProfiler)
sharedSystemProfiler = [[self alloc] init];
return sharedSystemProfiler;
}
- (NSDictionary *)modelTranslationTable
{
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"SUModelTranslation" ofType:@"plist"];
return [[[NSDictionary alloc] initWithContentsOfFile:path] autorelease];
}
- (NSMutableArray *)systemProfileArrayForHostBundle:(NSBundle *)hostBundle
{
NSDictionary *modelTranslation = [self modelTranslationTable];
// Gather profile information and append it to the URL.
NSMutableArray *profileArray = [NSMutableArray array];
NSArray *profileDictKeys = [NSArray arrayWithObjects:@"key", @"visibleKey", @"value", @"visibleValue", nil];
int error = 0 ;
int value = 0 ;
unsigned long length = sizeof(value) ;
// OS version
NSString *currentSystemVersion = [NSWorkspace systemVersionString];
if (currentSystemVersion != nil)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"osVersion",@"OS Version",currentSystemVersion,currentSystemVersion,nil] forKeys:profileDictKeys]];
// CPU type (decoder info for values found here is in mach/machine.h)
error = sysctlbyname("hw.cputype", &value, &length, NULL, 0);
int cpuType = -1;
if (error == 0) {
cpuType = value;
NSString *visibleCPUType;
switch(value) {
case 7: visibleCPUType=@"Intel"; break;
case 18: visibleCPUType=@"PowerPC"; break;
default: visibleCPUType=@"Unknown"; break;
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cputype",@"CPU Type", [NSNumber numberWithInt:value], visibleCPUType,nil] forKeys:profileDictKeys]];
}
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
if (error == 0) {
NSString *visibleCPUSubType;
if (cpuType == 7) {
// Intel
visibleCPUSubType = @"Intel"; // If anyone knows how to tell a Core Duo from a Core Solo, please email tph@atomicbird.com
} else if (cpuType == 18) {
// PowerPC
switch(value) {
case 9: visibleCPUSubType=@"G3"; break;
case 10: case 11: visibleCPUSubType=@"G4"; break;
case 100: visibleCPUSubType=@"G5"; break;
default: visibleCPUSubType=@"Other"; break;
}
} else {
visibleCPUSubType = @"Other";
}
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpusubtype",@"CPU Subtype", [NSNumber numberWithInt:value], visibleCPUSubType,nil] forKeys:profileDictKeys]];
}
error = sysctlbyname("hw.model", NULL, &length, NULL, 0);
if (error == 0) {
char *cpuModel;
cpuModel = (char *)malloc(sizeof(char) * length);
error = sysctlbyname("hw.model", cpuModel, &length, NULL, 0);
if (error == 0) {
NSString *rawModelName = [NSString stringWithUTF8String:cpuModel];
NSString *visibleModelName = [modelTranslation objectForKey:rawModelName];
if (visibleModelName == nil)
visibleModelName = rawModelName;
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"model",@"Mac Model", rawModelName, visibleModelName, nil] forKeys:profileDictKeys]];
}
if (cpuModel != NULL)
free(cpuModel);
}
// Number of CPUs
error = sysctlbyname("hw.ncpu", &value, &length, NULL, 0);
if (error == 0)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"ncpu",@"Number of CPUs", [NSNumber numberWithInt:value], [NSNumber numberWithInt:value],nil] forKeys:profileDictKeys]];
// User preferred language
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defs objectForKey:@"AppleLanguages"];
if (languages && ([languages count] > 0))
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"lang",@"Preferred Language", [languages objectAtIndex:0], [languages objectAtIndex:0],nil] forKeys:profileDictKeys]];
// Application sending the request
NSString *appName = [hostBundle name];
if (appName)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appName",@"Application Name", appName, appName,nil] forKeys:profileDictKeys]];
NSString *appVersion = [hostBundle version];
if (appVersion)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"appVersion",@"Application Version", appVersion, appVersion,nil] forKeys:profileDictKeys]];
// Number of displays?
// CPU speed
OSErr err;
SInt32 gestaltInfo;
err = Gestalt(gestaltProcClkSpeedMHz,&gestaltInfo);
if (err == noErr)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"cpuFreqMHz",@"CPU Speed (MHz)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
// amount of RAM
err = Gestalt(gestaltPhysicalRAMSizeInMegabytes,&gestaltInfo);
if (err == noErr)
[profileArray addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"ramMB",@"Memory (MB)", [NSNumber numberWithInt:gestaltInfo], [NSNumber numberWithInt:gestaltInfo],nil] forKeys:profileDictKeys]];
return profileArray;
}
@end
-140
View File
@@ -1,140 +0,0 @@
//
// SUUIBasedUpdateDriver.m
// Sparkle
//
// Created by Andy Matuschak on 5/5/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUUIBasedUpdateDriver.h"
#import "Sparkle.h"
#import "NSNumber+Units.h"
@implementation SUUIBasedUpdateDriver
- (void)didFindValidUpdate
{
updateAlert = [[SUUpdateAlert alloc] initWithAppcastItem:updateItem hostBundle:hostBundle];
[updateAlert setDelegate:self];
// If the app is a menubar app or the like, we need to focus it first:
if ([[hostBundle objectForInfoDictionaryKey:@"LSUIElement"] doubleValue]) { [NSApp activateIgnoringOtherApps:YES]; }
// Only show the update alert if the app is active; otherwise, we'll wait until it is.
if ([NSApp isActive])
[[updateAlert window] makeKeyAndOrderFront:self];
else
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
}
- (void)didNotFindUpdate
{
if ([delegate respondsToSelector:@selector(didNotFindUpdateToHostBundle:)])
[delegate didNotFindUpdateToHostBundle:hostBundle];
NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"You're up to date!", nil) defaultButton:SULocalizedString(@"OK", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:SULocalizedString(@"%@ %@ is currently the newest version available.", nil), [hostBundle name], [hostBundle displayVersion]];
[alert setIcon:[hostBundle icon]];
[alert runModal];
[self abortUpdate];
}
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
[[updateAlert window] makeKeyAndOrderFront:self];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSApplicationDidBecomeActiveNotification" object:NSApp];
}
- (void)updateAlert:(SUUpdateAlert *)alert finishedWithChoice:(SUUpdateAlertChoice)choice
{
[updateAlert release]; updateAlert = nil;
if ([delegate respondsToSelector:@selector(userChoseAction:forUpdate:toHostBundle:)])
[delegate userChoseAction:choice forUpdate:updateItem toHostBundle:hostBundle];
[[SUUserDefaults standardUserDefaults] setObject:nil forKey:SUSkippedVersionKey];
switch (choice)
{
case SUInstallUpdateChoice:
statusController = [[SUStatusController alloc] initWithHostBundle:hostBundle];
[statusController beginActionWithTitle:SULocalizedString(@"Downloading update\u2026", nil) maxProgressValue:0 statusText:nil];
[statusController setButtonTitle:SULocalizedString(@"Cancel", nil) target:self action:@selector(cancelDownload:) isDefault:NO];
[statusController showWindow:self];
[self downloadUpdate];
break;
case SUSkipThisVersionChoice:
[[SUUserDefaults standardUserDefaults] setObject:[updateItem versionString] forKey:SUSkippedVersionKey];
case SURemindMeLaterChoice:
[self abortUpdate];
break;
}
}
- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response
{
[statusController setMaxProgressValue:[response expectedContentLength]];
}
- (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length
{
[statusController setProgressValue:[statusController progressValue] + length];
[statusController setStatusText:[NSString stringWithFormat:SULocalizedString(@"%@ of %@", nil), [NSNumber humanReadableSizeFromDouble:[statusController progressValue]], [NSNumber humanReadableSizeFromDouble:[statusController maxProgressValue]]]];
}
- (IBAction)cancelDownload:sender
{
if (download)
[download cancel];
[self abortUpdate];
}
- (void)extractUpdate
{
// Now we have to extract the downloaded archive.
[statusController beginActionWithTitle:SULocalizedString(@"Extracting update\u2026", nil) maxProgressValue:0 statusText:nil];
[statusController setButtonEnabled:NO];
[super extractUpdate];
}
- (void)unarchiver:(SUUnarchiver *)ua extractedLength:(long)length
{
// We do this here instead of in extractUpdate so that we only have a determinate progress bar for archives with progress.
if ([statusController maxProgressValue] == 0)
[statusController setMaxProgressValue:[[[[NSFileManager defaultManager] fileAttributesAtPath:downloadPath traverseLink:NO] objectForKey:NSFileSize] doubleValue]];
[statusController setProgressValue:[statusController progressValue] + length];
}
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
[statusController beginActionWithTitle:SULocalizedString(@"Ready to Install", nil) maxProgressValue:1 statusText:nil];
[statusController setProgressValue:1]; // Fill the bar.
[statusController setButtonEnabled:YES];
[statusController setButtonTitle:SULocalizedString(@"Install and Relaunch", nil) target:self action:@selector(installAndRestart:) isDefault:YES];
[NSApp requestUserAttention:NSInformationalRequest];
}
- (void)installAndRestart:sender { [self installUpdate]; }
- (void)installUpdate
{
[statusController beginActionWithTitle:SULocalizedString(@"Installing update\u2026", nil) maxProgressValue:0 statusText:nil];
[statusController setButtonEnabled:NO];
[super installUpdate];
}
- (void)abortUpdateWithError:(NSError *)error
{
NSAlert *alert = [NSAlert alertWithMessageText:SULocalizedString(@"Update Error!", nil) defaultButton:SULocalizedString(@"Cancel Update", nil) alternateButton:nil otherButton:nil informativeTextWithFormat:[error localizedDescription]];
[alert setIcon:[hostBundle icon]];
[alert runModal];
[super abortUpdateWithError:error];
}
- (void)abortUpdate
{
if (statusController)
{
[statusController close];
[statusController autorelease];
}
[super abortUpdate];
}
@end
-30
View File
@@ -1,30 +0,0 @@
//
// SUUnarchiver.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUUNARCHIVER_H
#define SUUNARCHIVER_H
@interface SUUnarchiver : NSObject {
id delegate;
NSURL *archiveURL;
}
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL;
- (void)setDelegate:delegate;
- (void)start;
@end
@interface NSObject (SUUnarchiverDelegate)
- (void)unarchiver:(SUUnarchiver *)unarchiver extractedLength:(long)length;
- (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver;
- (void)unarchiverDidFail:(SUUnarchiver *)unarchiver;
@end
#endif
-40
View File
@@ -1,40 +0,0 @@
//
// SUUnarchiver.m
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUUnarchiver.h"
#import "SUUnarchiver_Private.h"
@implementation SUUnarchiver
extern NSMutableArray *__unarchiverImplementations;
+ (SUUnarchiver *)unarchiverForURL:(NSURL *)URL
{
NSEnumerator *implementationEnumerator = [[self _unarchiverImplementations] objectEnumerator];
id current;
while ((current = [implementationEnumerator nextObject]))
{
if ([current _canUnarchiveURL:URL])
return [[[current alloc] _initWithURL:URL] autorelease];
}
return nil;
}
- (void)setDelegate:del
{
delegate = del;
}
- (void)start
{
// No-op
}
@end
-30
View File
@@ -1,30 +0,0 @@
//
// SUUnarchiver_Private.h
// Sparkle
//
// Created by Andy Matuschak on 6/17/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#ifndef SUUNARCHIVER_PRIVATE_H
#define SUUNARCHIVER_PRIVATE_H
#import <Cocoa/Cocoa.h>
#import "SUUnarchiver.h"
@interface SUUnarchiver (Private)
+ (void)_registerImplementation:(Class)implementation;
+ (NSArray *)_unarchiverImplementations;
+ (BOOL)_canUnarchiveURL:(NSURL *)URL;
- _initWithURL:(NSURL *)URL;
- (void)_notifyDelegateOfExtractedLength:(long)length;
- (void)_notifyDelegateOfSuccess;
- (void)_notifyDelegateOfFailure;
@end
@interface NSURL (SUTypeDetection)
- (BOOL)conformsToType:(NSString *)type;
@end
#endif
-80
View File
@@ -1,80 +0,0 @@
//
// SUUnarchiver_Private.m
// Sparkle
//
// Created by Andy Matuschak on 6/17/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUUnarchiver_Private.h"
@implementation SUUnarchiver (Private)
- _initWithURL:(NSURL *)URL
{
if ((self = [super init]))
archiveURL = [URL copy];
return self;
}
- (void)dealloc
{
[archiveURL release];
[super dealloc];
}
+ (BOOL)_canUnarchiveURL:(NSURL *)URL
{
return NO;
}
- (void)_notifyDelegateOfExtractedLength:(long)length
{
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)])
[delegate unarchiver:self extractedLength:length];
}
- (void)_notifyDelegateOfSuccess
{
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)])
[delegate performSelector:@selector(unarchiverDidFinish:) withObject:self];
}
- (void)_notifyDelegateOfFailure
{
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)])
[delegate performSelector:@selector(unarchiverDidFail:) withObject:self];
}
static NSMutableArray *__unarchiverImplementations;
+ (void)_registerImplementation:(Class)implementation
{
if (!__unarchiverImplementations)
__unarchiverImplementations = [[NSMutableArray alloc] init];
[__unarchiverImplementations addObject:implementation];
}
+ (NSArray *)_unarchiverImplementations
{
return [NSArray arrayWithArray:__unarchiverImplementations];
}
@end
@implementation NSURL (SUTypeDetection)
- (NSString *)__UTI
{
FSRef fsRefToItem;
FSPathMakeRef((UInt8 *)[[self path] fileSystemRepresentation], &fsRefToItem, NULL );
NSString *UTI = nil;
LSCopyItemAttribute(&fsRefToItem, kLSRolesAll, kLSItemContentType, (CFTypeRef *)(&UTI));
return [UTI autorelease];
}
- (BOOL)conformsToType:(NSString *)type
{
return UTTypeConformsTo((CFStringRef)[self __UTI], (CFStringRef)type);
}
@end
-46
View File
@@ -1,46 +0,0 @@
//
// SUUpdateAlert.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUUPDATEALERT_H
#define SUUPDATEALERT_H
#import "SUWindowController.h"
typedef enum
{
SUInstallUpdateChoice,
SURemindMeLaterChoice,
SUSkipThisVersionChoice
} SUUpdateAlertChoice;
@class WebView, SUAppcastItem;
@interface SUUpdateAlert : SUWindowController {
SUAppcastItem *updateItem;
NSBundle *hostBundle;
id delegate;
IBOutlet WebView *releaseNotesView;
IBOutlet NSTextField *description;
NSProgressIndicator *releaseNotesSpinner;
BOOL webViewFinishedLoading;
}
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hostBundle;
- (void)setDelegate:delegate;
- (IBAction)installUpdate:sender;
- (IBAction)skipThisVersion:sender;
- (IBAction)remindMeLater:sender;
@end
@interface NSObject (SUUpdateAlertDelegate)
- (void)updateAlert:(SUUpdateAlert *)updateAlert finishedWithChoice:(SUUpdateAlertChoice)updateChoice;
@end
#endif
-182
View File
@@ -1,182 +0,0 @@
//
// SUUpdateAlert.m
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import "Sparkle.h"
#import "SUUpdateAlert.h"
#import <WebKit/WebKit.h>
@implementation SUUpdateAlert
- (id)initWithAppcastItem:(SUAppcastItem *)item hostBundle:(NSBundle *)hb
{
self = [super initWithHostBundle:hb windowNibName:@"SUUpdateAlert"];
if (self)
{
hostBundle = [hb retain];
updateItem = [item retain];
[self setShouldCascadeWindows:NO];
}
return self;
}
- (void)dealloc
{
[updateItem release];
[hostBundle release];
[super dealloc];
}
- (void)endWithSelection:(SUUpdateAlertChoice)choice
{
[releaseNotesView stopLoading:self];
[releaseNotesView setFrameLoadDelegate:nil];
[releaseNotesView setPolicyDelegate:nil];
[self close];
if ([delegate respondsToSelector:@selector(updateAlert:finishedWithChoice:)])
[delegate updateAlert:self finishedWithChoice:choice];
}
- (IBAction)installUpdate:sender
{
[self endWithSelection:SUInstallUpdateChoice];
}
- (IBAction)skipThisVersion:sender
{
[self endWithSelection:SUSkipThisVersionChoice];
}
- (IBAction)remindMeLater:sender
{
[self endWithSelection:SURemindMeLaterChoice];
}
- (void)displayReleaseNotes
{
[[WebPreferences standardPreferences] setStandardFontFamily:[[NSFont systemFontOfSize:8] familyName]];
[releaseNotesView setPreferences:[WebPreferences standardPreferences]];
[releaseNotesView setFrameLoadDelegate:self];
[releaseNotesView setPolicyDelegate:self];
// Stick a nice big spinner in the middle of the web view until the page is loaded.
NSRect frame = [[releaseNotesView superview] frame];
releaseNotesSpinner = [[[NSProgressIndicator alloc] initWithFrame:NSMakeRect(NSMidX(frame)-16, NSMidY(frame)-16, 32, 32)] autorelease];
[releaseNotesSpinner setStyle:NSProgressIndicatorSpinningStyle];
[releaseNotesSpinner startAnimation:self];
webViewFinishedLoading = NO;
[[releaseNotesView superview] addSubview:releaseNotesSpinner];
// If there's a release notes URL, load it; otherwise, just stick the contents of the description into the web view.
if ([updateItem releaseNotesURL])
{
[[releaseNotesView mainFrame] loadRequest:[NSURLRequest requestWithURL:[updateItem releaseNotesURL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30]];
}
else
{
[[releaseNotesView mainFrame] loadHTMLString:[updateItem description] baseURL:nil];
}
}
- (BOOL)showsReleaseNotes
{
NSNumber *shouldShowReleaseNotes = [hostBundle objectForInfoDictionaryKey:SUShowReleaseNotesKey];
if (shouldShowReleaseNotes == nil)
return YES; // defaults to YES
else
return [shouldShowReleaseNotes boolValue];
}
- (BOOL)allowsAutomaticUpdates
{
if (![[hostBundle objectForInfoDictionaryKey:SUExpectsDSASignatureKey] boolValue])
return NO; // Automatic updating requires DSA-signed updates
if (![hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey])
return YES; // defaults to YES
return [[hostBundle objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey] boolValue];
}
- (void)awakeFromNib
{
[[self window] setLevel:NSFloatingWindowLevel];
// We're gonna do some frame magic to match the window's size to the description field and the presence of the release notes view.
NSRect frame = [[self window] frame];
if (![self showsReleaseNotes])
{
// Resize the window to be appropriate for not having a huge release notes view.
frame.size.height -= [releaseNotesView frame].size.height + 40; // Extra 40 is for the release notes label and margin.
[[self window] setShowsResizeIndicator:NO];
}
if (![self allowsAutomaticUpdates])
{
NSRect boxFrame = [[[releaseNotesView superview] superview] frame];
boxFrame.origin.y -= 20;
boxFrame.size.height += 20;
[[[releaseNotesView superview] superview] setFrame:boxFrame];
}
[[self window] setFrame:frame display:NO];
[[self window] center];
if ([self showsReleaseNotes])
{
[self displayReleaseNotes];
}
}
- (BOOL)windowShouldClose:note
{
[self endWithSelection:SURemindMeLaterChoice];
return YES;
}
- (NSImage *)applicationIcon
{
return [hostBundle icon];
}
- (NSString *)titleText
{
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is available!", nil), [hostBundle name]];
}
- (NSString *)descriptionText
{
return [NSString stringWithFormat:SULocalizedString(@"%@ %@ is now available\u2014you have %@. Would you like to download it now?", nil), [hostBundle name], [updateItem displayVersionString], [hostBundle displayVersion]];
}
- (void)webView:(WebView *)sender didFinishLoadForFrame:frame
{
if ([frame parentFrame] == nil) {
webViewFinishedLoading = YES;
[releaseNotesSpinner setHidden:YES];
[sender display]; // necessary to prevent weird scroll bar artifacting
}
}
- (void)webView:sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:frame decisionListener:listener
{
if (webViewFinishedLoading == YES) {
[[NSWorkspace sharedWorkspace] openURL:[request URL]];
[listener ignore];
}
else {
[listener use];
}
}
- (void)setDelegate:del
{
delegate = del;
}
@end
Loaded 100 of 463 files, more files were not shown because too many files have changed in this diff. Show more