mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7ae7d5330 | ||
|
|
daaadf1c44 | ||
|
|
87064c9304 | ||
|
|
0af392f808 | ||
|
|
fb8ad9f75d | ||
|
|
b4210a85b9 | ||
|
|
091986b12f | ||
|
|
1ecb620986 | ||
|
|
21f3c8a157 | ||
|
|
468bcb9640 | ||
|
|
d38b29c858 | ||
|
|
e2b9fc7ffd | ||
|
|
f016cd8086 | ||
|
|
796967cf24 | ||
|
|
578e78876c | ||
|
|
2f438186d6 | ||
|
|
2c1820f2a9 | ||
|
|
a30eff3680 | ||
|
|
1a09baf0ed | ||
|
|
a1095ff29c | ||
|
|
51b3931485 | ||
|
|
1e3f5482d0 | ||
|
|
0a45be54c4 | ||
|
|
b5bc2a7374 | ||
|
|
3666b89add | ||
|
|
23f9e747c1 | ||
|
|
c77895066a | ||
|
|
c98017dbe2 | ||
|
|
657e3d47d0 | ||
|
|
4d34e4358a | ||
|
|
6fcd6beb84 | ||
|
|
98b3a9828a | ||
|
|
137b73af4e | ||
|
|
dd1bda5066 | ||
|
|
7bc7a90a09 | ||
|
|
91d13c7239 | ||
|
|
fd6ba1820a | ||
|
|
fb61777024 | ||
|
|
2519eb573f | ||
|
|
8a3338b078 | ||
|
|
b03ae0d765 | ||
|
|
97c652e3b0 | ||
|
|
301af71228 | ||
|
|
60d4f05743 | ||
|
|
464972126c | ||
|
|
c1392bc190 | ||
|
|
921aed0fae | ||
|
|
59d90e0bb1 | ||
|
|
e3fb6bb1a8 | ||
|
|
8103f5fd43 | ||
|
|
70f5681797 | ||
|
|
5ee02e954e | ||
|
|
23b2b49663 | ||
|
|
311ed493b4 | ||
|
|
9d8b3c0c36 | ||
|
|
f3f268388b | ||
|
|
8d0effe327 | ||
|
|
19455099ff | ||
|
|
6e754d7e4f | ||
|
|
ab6fa76303 | ||
|
|
93fc4b0151 |
No files matched your search
@@ -16,15 +16,13 @@ SPARKLE_AUTOMATED_DOWNGRADES = 0
|
|||||||
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
|
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
|
||||||
|
|
||||||
SPARKLE_VERSION_MAJOR = 1
|
SPARKLE_VERSION_MAJOR = 1
|
||||||
SPARKLE_VERSION_MINOR = 15
|
SPARKLE_VERSION_MINOR = 16
|
||||||
SPARKLE_VERSION_PATCH = 1
|
SPARKLE_VERSION_PATCH = 0
|
||||||
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
SPARKLE_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
||||||
|
|
||||||
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
|
CURRENT_PROJECT_VERSION = $(SPARKLE_VERSION)
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO
|
ALWAYS_SEARCH_USER_PATHS = NO
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES
|
ENABLE_STRICT_OBJC_MSGSEND = YES
|
||||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
|
||||||
GCC_PREFIX_HEADER = Sparkle/Sparkle.pch
|
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES
|
GCC_SYMBOLS_PRIVATE_EXTERN = YES
|
||||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
|
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
|
||||||
ARCHS = $(ARCHS_STANDARD)
|
ARCHS = $(ARCHS_STANDARD)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ if [ "$ACTION" = "" ] ; then
|
|||||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$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 -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||||
|
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
|
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -6,14 +6,15 @@ An easy-to-use software update framework for Cocoa developers.
|
|||||||
|
|
||||||
## Changes since 1.5b
|
## Changes since 1.5b
|
||||||
|
|
||||||
* Up-to-date with 10.11 SDK and Xcode 7. Supports macOS 10.7+.
|
* Compatibilty with macOS Sierra.
|
||||||
|
* Up-to-date with 10.12 SDK and Xcode 8 (supports macOS 10.7+).
|
||||||
* Important security fixes.
|
* Important security fixes.
|
||||||
* Cleaned up and modernized code, using ARC and Autolayout.
|
* Cleaned up and modernized code, using ARC and Autolayout.
|
||||||
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
|
* Truly automatic background updates (no UI at all) when user agreed to "Automatically download and install updates in the future."
|
||||||
|
* Upgraded and more reliable binary delta and code signing verification.
|
||||||
* Ability to mark updates as critical.
|
* Ability to mark updates as critical.
|
||||||
* Progress and status notifications for the host app.
|
* Progress and status notifications for the host app.
|
||||||
* Name of finish_installation.app can be configured to match your app's name.
|
* Name of finish_installation.app can be configured to match your app's name.
|
||||||
* Upgraded and more reliable binary delta and code signing verification.
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
buildPhases = (
|
buildPhases = (
|
||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
|
5AE13FAA1E0D7E2F000D2C2C /* PBXTargetDependency */,
|
||||||
14950064195FB8A600BC5B5B /* PBXTargetDependency */,
|
14950064195FB8A600BC5B5B /* PBXTargetDependency */,
|
||||||
14950066195FB8A600BC5B5B /* PBXTargetDependency */,
|
14950066195FB8A600BC5B5B /* PBXTargetDependency */,
|
||||||
14950068195FB8A600BC5B5B /* PBXTargetDependency */,
|
14950068195FB8A600BC5B5B /* PBXTargetDependency */,
|
||||||
@@ -66,15 +67,39 @@
|
|||||||
55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
|
55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
|
||||||
55C14F23136EF86700649790 /* SUSystemProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */; };
|
55C14F23136EF86700649790 /* SUSystemProfiler.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A2279B0D1CEE7600430CCD /* SUSystemProfiler.m */; };
|
||||||
55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; };
|
55C14F24136EF86F00649790 /* SUPackageInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5210DAE8E8A0026945C /* SUPackageInstaller.m */; };
|
||||||
55C14F2A136EF9A900649790 /* SUWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61180BC90D64138900B4E0D1 /* SUWindowController.m */; };
|
|
||||||
55C14F32136EFC2400649790 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; };
|
55C14F32136EFC2400649790 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 55C14F31136EFC2400649790 /* SystemConfiguration.framework */; };
|
||||||
55C14F9A136F045400649790 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
|
55C14F9A136F045400649790 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
|
||||||
55C14FC7136F05E100649790 /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; };
|
55C14FC7136F05E100649790 /* Sparkle.strings in Resources */ = {isa = PBXBuildFile; fileRef = 61AAE8220A321A7F00D8810D /* Sparkle.strings */; };
|
||||||
55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 55E6F33219EC9F6C00005E76 /* SUErrors.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 55E6F33219EC9F6C00005E76 /* SUErrors.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */; };
|
5A4094481C74EA5200983BE0 /* SUAppcastTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */; };
|
||||||
|
5A5AC5361E0C6CA300998119 /* Unarchive.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A5AC5351E0C6CA300998119 /* Unarchive.swift */; };
|
||||||
|
5A5AC5381E0C6D3000998119 /* FeedXML.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A5AC5371E0C6D3000998119 /* FeedXML.swift */; };
|
||||||
5A6D31EE1BF53245009C5157 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
5A6D31EE1BF53245009C5157 /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
||||||
5A6D31EF1BF5325F009C5157 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
|
5A6D31EF1BF5325F009C5157 /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
|
||||||
|
5AA96C581E0AE0DB00CA4346 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AA96C571E0AE0DB00CA4346 /* main.swift */; };
|
||||||
|
5AAD00521E0BE6BE00AF411E /* ArchiveItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AAD00511E0BE6BE00AF411E /* ArchiveItem.swift */; };
|
||||||
|
5AAD00661E0C2D9B00AF411E /* SUBinaryDeltaCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E20FD68CC7005AE3F6 /* SUBinaryDeltaCommon.m */; };
|
||||||
|
5AAD00671E0C2D9B00AF411E /* SUBinaryDeltaCreate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7268AC621AD634C200C3E0C1 /* SUBinaryDeltaCreate.m */; };
|
||||||
|
5AAD00681E0C2DAB00AF411E /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 723B252B1CEAB3A600909873 /* bscommon.c */; };
|
||||||
|
5AAD00691E0C2DAB00AF411E /* bsdiff.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DB0FD68CB9005AE3F6 /* bsdiff.c */; };
|
||||||
|
5AAD006A1E0C2DB500AF411E /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; };
|
||||||
|
5AAD006C1E0C2DBF00AF411E /* libxar.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5AAD006B1E0C2DBF00AF411E /* libxar.tbd */; };
|
||||||
5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */; };
|
5AD0FA7F1C73F2E2004BCEFF /* testappcast.xml in Resources */ = {isa = PBXBuildFile; fileRef = 5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */; };
|
||||||
|
5AE13F781E0C9B12000D2C2C /* DSASignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AE13F771E0C9B12000D2C2C /* DSASignature.swift */; };
|
||||||
|
5AE13FA01E0D4F65000D2C2C /* Appcast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AE13F9F1E0D4F65000D2C2C /* Appcast.swift */; };
|
||||||
|
5AE13FA11E0D7168000D2C2C /* SUUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A8C09CA790200B7442F /* SUUnarchiver.m */; };
|
||||||
|
5AE13FA21E0D716F000D2C2C /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
||||||
|
5AE13FA41E0D71D1000D2C2C /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 722954C31D04E66F00ECF9CA /* SUFileOperationConstants.m */; };
|
||||||
|
5AE13FA51E0D71F5000D2C2C /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
|
||||||
|
5AE13FA61E0D7275000D2C2C /* SUStandardVersionComparator.m in Sources */ = {isa = PBXBuildFile; fileRef = 61A225A30D1C4AC000430CCD /* SUStandardVersionComparator.m */; };
|
||||||
|
5AE13FB51E0D9F32000D2C2C /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; };
|
||||||
|
5AE13FB61E0D9F39000D2C2C /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; };
|
||||||
|
5AE13FB71E0D9F42000D2C2C /* SUUnarchiverNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 722589D91E0B19F4005EA0B9 /* SUUnarchiverNotifier.m */; };
|
||||||
|
5AE13FB81E0D9F8E000D2C2C /* SULog.m in Sources */ = {isa = PBXBuildFile; fileRef = 55C14F05136EF6DB00649790 /* SULog.m */; };
|
||||||
|
5AE13FB91E0DA384000D2C2C /* SUBinaryDeltaUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E9380FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m */; };
|
||||||
|
5AE13FBA1E0DA389000D2C2C /* SUBinaryDeltaApply.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8E00FD68CC7005AE3F6 /* SUBinaryDeltaApply.m */; };
|
||||||
|
5AE13FBB1E0DA391000D2C2C /* bspatch.c in Sources */ = {isa = PBXBuildFile; fileRef = 5D06E8DC0FD68CB9005AE3F6 /* bspatch.c */; };
|
||||||
|
5AE13FBD1E0DA39B000D2C2C /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5AE13FBC1E0DA39B000D2C2C /* libbz2.tbd */; };
|
||||||
5AE459001C34118500E3BB47 /* SUUpdaterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 14950074195FDF5900BC5B5B /* SUUpdaterTest.m */; };
|
5AE459001C34118500E3BB47 /* SUUpdaterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 14950074195FDF5900BC5B5B /* SUUpdaterTest.m */; };
|
||||||
5AE459021C34118500E3BB47 /* SUVersionComparisonTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */; };
|
5AE459021C34118500E3BB47 /* SUVersionComparisonTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 61227A150DB548B800AB99EA /* SUVersionComparisonTest.m */; };
|
||||||
5AE7E1111DC81AD3009C2C12 /* AppIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5AE7E10E1DC81ACA009C2C12 /* AppIcon.icns */; };
|
5AE7E1111DC81AD3009C2C12 /* AppIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 5AE7E10E1DC81ACA009C2C12 /* AppIcon.icns */; };
|
||||||
@@ -104,11 +129,8 @@
|
|||||||
6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
6102FE460E077FCE00F85D09 /* SUPipedUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; };
|
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */; };
|
||||||
6102FE5B0E08C7EC00F85D09 /* SUUnarchiver_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */; settings = {ATTRIBUTES = (); }; };
|
|
||||||
611142E910FB1BE5009810AA /* bspatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 611142E810FB1BE5009810AA /* bspatch.h */; };
|
611142E910FB1BE5009810AA /* bspatch.h in Headers */ = {isa = PBXBuildFile; fileRef = 611142E810FB1BE5009810AA /* bspatch.h */; };
|
||||||
61177A1F0D1112E900749C97 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6117796E0D1112E000749C97 /* IOKit.framework */; };
|
61177A1F0D1112E900749C97 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6117796E0D1112E000749C97 /* IOKit.framework */; };
|
||||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 61180BC80D64138900B4E0D1 /* SUWindowController.h */; settings = {ATTRIBUTES = (); }; };
|
|
||||||
61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61180BC90D64138900B4E0D1 /* SUWindowController.m */; };
|
|
||||||
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (); }; };
|
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */ = {isa = PBXBuildFile; fileRef = 6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; };
|
6120721309CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = 6120721109CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.m */; };
|
||||||
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */; settings = {ATTRIBUTES = (); }; };
|
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299A2D09CA2DAB00B7442F /* SUDSAVerifier.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
@@ -120,7 +142,7 @@
|
|||||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
61299B3609CB04E000B7442F /* Sparkle.h in Headers */ = {isa = PBXBuildFile; fileRef = 61299B3509CB04E000B7442F /* Sparkle.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (); }; };
|
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */ = {isa = PBXBuildFile; fileRef = 612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; };
|
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */ = {isa = PBXBuildFile; fileRef = 612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */; };
|
||||||
6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6158A1C4137904B300487EC1 /* SUUpdater_Private.h */; };
|
6158A1C5137904B300487EC1 /* SUUpdaterPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 6158A1C4137904B300487EC1 /* SUUpdaterPrivate.h */; };
|
||||||
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
|
615AE3D00D64DC40001CA7BD /* SUModelTranslation.plist in Resources */ = {isa = PBXBuildFile; fileRef = 615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */; };
|
||||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */ = {isa = PBXBuildFile; fileRef = 618FA4FF0DAE88B40026945C /* SUInstaller.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; };
|
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */ = {isa = PBXBuildFile; fileRef = 618FA5000DAE88B40026945C /* SUInstaller.m */; };
|
||||||
@@ -160,13 +182,14 @@
|
|||||||
61B93B280DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */; };
|
61B93B280DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93B260DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.m */; };
|
||||||
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61B93C070DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */; };
|
61B93C0A0DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61B93C080DD112FF00DCD2F8 /* SUScheduledUpdateDriver.m */; };
|
||||||
61CFB3290E385186007A1735 /* Sparkle.pch in Headers */ = {isa = PBXBuildFile; fileRef = 61CFB3280E385186007A1735 /* Sparkle.pch */; };
|
|
||||||
61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; };
|
61D85D6D0E10B2ED00F9B4A9 /* SUPipedUnarchiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */; };
|
||||||
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; };
|
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */ = {isa = PBXBuildFile; fileRef = 61EF67550E25B58D00F754E0 /* SUHost.m */; };
|
||||||
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 61EF67580E25C5B400F754E0 /* SUHost.h */; };
|
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 61EF67580E25C5B400F754E0 /* SUHost.h */; };
|
||||||
61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */; };
|
61F83F720DBFE140006FDD30 /* SUBasicUpdateDriver.m in Sources */ = {isa = PBXBuildFile; fileRef = 61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */; };
|
||||||
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */; settings = {ATTRIBUTES = (); }; };
|
||||||
61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (Required, ); }; };
|
61FA52880E2D9EA400EF58AD /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Sparkle.framework */; settings = {ATTRIBUTES = (Required, ); }; };
|
||||||
|
7205C4311E1215AD00E370AE /* SUUpdatePermissionResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 7205C42F1E1215AD00E370AE /* SUUpdatePermissionResponse.h */; };
|
||||||
|
7205C4321E1215AD00E370AE /* SUUpdatePermissionResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = 7205C4301E1215AD00E370AE /* SUUpdatePermissionResponse.m */; };
|
||||||
720B16451C66433D006985FB /* SUTestApplicationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720B16431C66433D006985FB /* SUTestApplicationTest.swift */; };
|
720B16451C66433D006985FB /* SUTestApplicationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720B16431C66433D006985FB /* SUTestApplicationTest.swift */; };
|
||||||
7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */; };
|
7210C7681B9A9A1500EB90AC /* SUUnarchiverTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */; };
|
||||||
721BC2111D1DFF05002BC71E /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 722954C31D04E66F00ECF9CA /* SUFileOperationConstants.m */; };
|
721BC2111D1DFF05002BC71E /* SUFileOperationConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 722954C31D04E66F00ECF9CA /* SUFileOperationConstants.m */; };
|
||||||
@@ -176,6 +199,9 @@
|
|||||||
721CF1AA1AD7647000D9AC09 /* libxar.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */; };
|
721CF1AA1AD7647000D9AC09 /* libxar.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */; };
|
||||||
721CF1AB1AD764EB00D9AC09 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */; };
|
721CF1AB1AD764EB00D9AC09 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */; };
|
||||||
7223E7631AD1AEFF008E3161 /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; };
|
7223E7631AD1AEFF008E3161 /* sais.c in Sources */ = {isa = PBXBuildFile; fileRef = 7223E7611AD1AEFF008E3161 /* sais.c */; };
|
||||||
|
722589D71E0AD86B005EA0B9 /* SUUnarchiverProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 722589D61E0AD86B005EA0B9 /* SUUnarchiverProtocol.h */; };
|
||||||
|
722589DA1E0B19F4005EA0B9 /* SUUnarchiverNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 722589D81E0B19F4005EA0B9 /* SUUnarchiverNotifier.h */; };
|
||||||
|
722589DB1E0B19F4005EA0B9 /* SUUnarchiverNotifier.m in Sources */ = {isa = PBXBuildFile; fileRef = 722589D91E0B19F4005EA0B9 /* SUUnarchiverNotifier.m */; };
|
||||||
722954B71D04ADAF00ECF9CA /* fileop.m in Sources */ = {isa = PBXBuildFile; fileRef = 722954B61D04ADAF00ECF9CA /* fileop.m */; };
|
722954B71D04ADAF00ECF9CA /* fileop.m in Sources */ = {isa = PBXBuildFile; fileRef = 722954B61D04ADAF00ECF9CA /* fileop.m */; };
|
||||||
722954BC1D04AE1100ECF9CA /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
722954BC1D04AE1100ECF9CA /* SUFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */; };
|
||||||
722954BD1D04AE3800ECF9CA /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
|
722954BD1D04AE3800ECF9CA /* SUConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 61299A5F09CA6EB100B7442F /* SUConstants.m */; };
|
||||||
@@ -188,6 +214,16 @@
|
|||||||
722954CA1D04EA6000ECF9CA /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
|
722954CA1D04EA6000ECF9CA /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
|
||||||
722954CB1D04EA6900ECF9CA /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
|
722954CB1D04EA6900ECF9CA /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61B5F8F609C4CEB300B25A18 /* Security.framework */; };
|
||||||
722954CC1D04EA7000ECF9CA /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
|
722954CC1D04EA7000ECF9CA /* SUOperatingSystem.m in Sources */ = {isa = PBXBuildFile; fileRef = 726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */; };
|
||||||
|
72316BD61E0DBF730039EFD9 /* SULocalizations.h in Headers */ = {isa = PBXBuildFile; fileRef = 72316BD51E0DBF730039EFD9 /* SULocalizations.h */; };
|
||||||
|
72316BD91E0E17180039EFD9 /* SUBundleIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 72316BD71E0E17180039EFD9 /* SUBundleIcon.h */; };
|
||||||
|
72316BDA1E0E17180039EFD9 /* SUBundleIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BD81E0E17180039EFD9 /* SUBundleIcon.m */; };
|
||||||
|
72316BDB1E0E17180039EFD9 /* SUBundleIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BD81E0E17180039EFD9 /* SUBundleIcon.m */; };
|
||||||
|
72316BDE1E0E17910039EFD9 /* SUApplicationInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 72316BDC1E0E17910039EFD9 /* SUApplicationInfo.h */; };
|
||||||
|
72316BDF1E0E17910039EFD9 /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BDD1E0E17910039EFD9 /* SUApplicationInfo.m */; };
|
||||||
|
72316BE01E0E17910039EFD9 /* SUApplicationInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BDD1E0E17910039EFD9 /* SUApplicationInfo.m */; };
|
||||||
|
72316BE31E0E1C7F0039EFD9 /* SUSystemUpdateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 72316BE11E0E1C7F0039EFD9 /* SUSystemUpdateInfo.h */; };
|
||||||
|
72316BE41E0E1C7F0039EFD9 /* SUSystemUpdateInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 72316BE21E0E1C7F0039EFD9 /* SUSystemUpdateInfo.m */; };
|
||||||
|
72316BE61E1087060039EFD9 /* SUUpdaterDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 72316BE51E1087060039EFD9 /* SUUpdaterDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
723A920E1D722438004A9DED /* SUSpotlightImporterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 723A920D1D722438004A9DED /* SUSpotlightImporterTest.swift */; };
|
723A920E1D722438004A9DED /* SUSpotlightImporterTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 723A920D1D722438004A9DED /* SUSpotlightImporterTest.swift */; };
|
||||||
723B252D1CEAB3A600909873 /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 723B252B1CEAB3A600909873 /* bscommon.c */; };
|
723B252D1CEAB3A600909873 /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 723B252B1CEAB3A600909873 /* bscommon.c */; };
|
||||||
723B252E1CEAB3A600909873 /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 723B252B1CEAB3A600909873 /* bscommon.c */; };
|
723B252E1CEAB3A600909873 /* bscommon.c in Sources */ = {isa = PBXBuildFile; fileRef = 723B252B1CEAB3A600909873 /* bscommon.c */; };
|
||||||
@@ -302,6 +338,20 @@
|
|||||||
remoteGlobalIDString = 55C14BB6136EEF1500649790;
|
remoteGlobalIDString = 55C14BB6136EEF1500649790;
|
||||||
remoteInfo = Autoupdate;
|
remoteInfo = Autoupdate;
|
||||||
};
|
};
|
||||||
|
5AE13FA71E0D7E1C000D2C2C /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 5AA96C541E0AE0DB00CA4346;
|
||||||
|
remoteInfo = Appcast;
|
||||||
|
};
|
||||||
|
5AE13FA91E0D7E2F000D2C2C /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 5AA96C541E0AE0DB00CA4346;
|
||||||
|
remoteInfo = Appcast;
|
||||||
|
};
|
||||||
5D06E8D50FD68C86005AE3F6 /* PBXContainerItemProxy */ = {
|
5D06E8D50FD68C86005AE3F6 /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
|
||||||
@@ -537,8 +587,18 @@
|
|||||||
55C14F05136EF6DB00649790 /* SULog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SULog.m; sourceTree = "<group>"; };
|
55C14F05136EF6DB00649790 /* SULog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SULog.m; sourceTree = "<group>"; };
|
||||||
55C14F31136EFC2400649790 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
55C14F31136EFC2400649790 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
|
||||||
55E6F33219EC9F6C00005E76 /* SUErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUErrors.h; sourceTree = "<group>"; };
|
55E6F33219EC9F6C00005E76 /* SUErrors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUErrors.h; sourceTree = "<group>"; };
|
||||||
|
5A5AC5351E0C6CA300998119 /* Unarchive.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Unarchive.swift; sourceTree = "<group>"; };
|
||||||
|
5A5AC5371E0C6D3000998119 /* FeedXML.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedXML.swift; sourceTree = "<group>"; };
|
||||||
5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUAppcastTest.swift; sourceTree = "<group>"; };
|
5AA4DCD01C73E5510078F128 /* SUAppcastTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUAppcastTest.swift; sourceTree = "<group>"; };
|
||||||
|
5AA96C571E0AE0DB00CA4346 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
|
||||||
|
5AA96C5D1E0AE0F900CA4346 /* Appcast-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Appcast-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
5AAD00511E0BE6BE00AF411E /* ArchiveItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArchiveItem.swift; sourceTree = "<group>"; };
|
||||||
|
5AAD006B1E0C2DBF00AF411E /* libxar.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxar.tbd; path = usr/lib/libxar.tbd; sourceTree = SDKROOT; };
|
||||||
5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast.xml; sourceTree = "<group>"; };
|
5AD0FA7E1C73F2E2004BCEFF /* testappcast.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = testappcast.xml; sourceTree = "<group>"; };
|
||||||
|
5AE13F771E0C9B12000D2C2C /* DSASignature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DSASignature.swift; sourceTree = "<group>"; };
|
||||||
|
5AE13F9F1E0D4F65000D2C2C /* Appcast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Appcast.swift; sourceTree = "<group>"; };
|
||||||
|
5AE13FB31E0D9E07000D2C2C /* generate_appcast */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = generate_appcast; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
5AE13FBC1E0DA39B000D2C2C /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
|
||||||
5AE7E10E1DC81ACA009C2C12 /* AppIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon.icns; sourceTree = "<group>"; };
|
5AE7E10E1DC81ACA009C2C12 /* AppIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = AppIcon.icns; sourceTree = "<group>"; };
|
||||||
5AEF45D9189D1CC90030D7DC /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
5AEF45D9189D1CC90030D7DC /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
5AF6C74C1AEA40760014A3AB /* SUInstallerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallerTest.m; sourceTree = "<group>"; };
|
5AF6C74C1AEA40760014A3AB /* SUInstallerTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUInstallerTest.m; sourceTree = "<group>"; };
|
||||||
@@ -569,14 +629,11 @@
|
|||||||
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPipedUnarchiver.h; sourceTree = "<group>"; };
|
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUPipedUnarchiver.h; sourceTree = "<group>"; };
|
||||||
6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDiskImageUnarchiver.h; sourceTree = "<group>"; };
|
6102FE480E07803800F85D09 /* SUDiskImageUnarchiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUDiskImageUnarchiver.h; sourceTree = "<group>"; };
|
||||||
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDiskImageUnarchiver.m; sourceTree = "<group>"; };
|
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUDiskImageUnarchiver.m; sourceTree = "<group>"; };
|
||||||
6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiver_Private.h; sourceTree = "<group>"; };
|
|
||||||
611142E810FB1BE5009810AA /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = "<group>"; };
|
611142E810FB1BE5009810AA /* bspatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bspatch.h; sourceTree = "<group>"; };
|
||||||
61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
61131A050F846CE600E97AF6 /* da */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
61131A090F846D0A00E97AF6 /* zh_CN */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
61131A0A0F846D1100E97AF6 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
61131A0A0F846D1100E97AF6 /* zh_TW */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
6117796E0D1112E000749C97 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUWindowController.h; sourceTree = "<group>"; };
|
|
||||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUWindowController.m; sourceTree = "<group>"; };
|
|
||||||
611A904210240DD300CC659E /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
611A904210240DD300CC659E /* pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
611A904610240DF700CC659E /* ja */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
611A904610240DF700CC659E /* ja */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = "<group>"; };
|
6120721009CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUAutomaticUpdateAlert.h; sourceTree = "<group>"; };
|
||||||
@@ -606,7 +663,7 @@
|
|||||||
6158A1BE1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
6158A1BE1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUAutomaticUpdateAlert.xib; sourceTree = "<group>"; };
|
||||||
6158A1BF1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
6158A1BF1378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||||
6158A1C01378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
6158A1C01378F8BB00487EC1 /* tr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = tr; path = tr.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||||
6158A1C4137904B300487EC1 /* SUUpdater_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdater_Private.h; sourceTree = "<group>"; };
|
6158A1C4137904B300487EC1 /* SUUpdaterPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterPrivate.h; sourceTree = "<group>"; };
|
||||||
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = "<group>"; };
|
615AE3CF0D64DC40001CA7BD /* SUModelTranslation.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SUModelTranslation.plist; sourceTree = "<group>"; };
|
||||||
6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
6186554310D7484E00B1E074 /* pt_PT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_PT; path = pt_PT.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
618915730E35937600B5E981 /* sv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
@@ -659,7 +716,6 @@
|
|||||||
61BA66DB14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
61BA66DB14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdateAlert.xib; sourceTree = "<group>"; };
|
||||||
61BA66DC14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
61BA66DC14BDFC5500D02D86 /* sl */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = sl; path = sl.lproj/SUUpdatePermissionPrompt.xib; sourceTree = "<group>"; };
|
||||||
61C268090E2DB5D000175E6C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
|
61C268090E2DB5D000175E6C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
|
||||||
61CFB3280E385186007A1735 /* Sparkle.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle.pch; sourceTree = "<group>"; };
|
|
||||||
61E31A80103299500051D188 /* pt_BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
61E31A80103299500051D188 /* pt_BR */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
61EF67550E25B58D00F754E0 /* SUHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUHost.m; sourceTree = "<group>"; };
|
61EF67550E25B58D00F754E0 /* SUHost.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUHost.m; sourceTree = "<group>"; };
|
||||||
61EF67580E25C5B400F754E0 /* SUHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUHost.h; sourceTree = "<group>"; };
|
61EF67580E25C5B400F754E0 /* SUHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUHost.h; sourceTree = "<group>"; };
|
||||||
@@ -670,11 +726,17 @@
|
|||||||
61F614540E24A12D009F47E7 /* it */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
61F614540E24A12D009F47E7 /* it */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||||
61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBasicUpdateDriver.h; sourceTree = "<group>"; };
|
61F83F6F0DBFE137006FDD30 /* SUBasicUpdateDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBasicUpdateDriver.h; sourceTree = "<group>"; };
|
||||||
61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBasicUpdateDriver.m; sourceTree = "<group>"; };
|
61F83F700DBFE137006FDD30 /* SUBasicUpdateDriver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBasicUpdateDriver.m; sourceTree = "<group>"; };
|
||||||
|
7205C42E1E11A6DA00E370AE /* SUInstallerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUInstallerProtocol.h; sourceTree = "<group>"; };
|
||||||
|
7205C42F1E1215AD00E370AE /* SUUpdatePermissionResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionResponse.h; sourceTree = "<group>"; };
|
||||||
|
7205C4301E1215AD00E370AE /* SUUpdatePermissionResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionResponse.m; sourceTree = "<group>"; };
|
||||||
720B16421C66433D006985FB /* UITests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UITests-Info.plist"; path = "UITests/UITests-Info.plist"; sourceTree = SOURCE_ROOT; };
|
720B16421C66433D006985FB /* UITests-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "UITests-Info.plist"; path = "UITests/UITests-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||||
720B16431C66433D006985FB /* SUTestApplicationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SUTestApplicationTest.swift; path = UITests/SUTestApplicationTest.swift; sourceTree = SOURCE_ROOT; };
|
720B16431C66433D006985FB /* SUTestApplicationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SUTestApplicationTest.swift; path = UITests/SUTestApplicationTest.swift; sourceTree = SOURCE_ROOT; };
|
||||||
7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = "<group>"; };
|
7210C7671B9A9A1500EB90AC /* SUUnarchiverTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUUnarchiverTest.swift; sourceTree = "<group>"; };
|
||||||
7223E7611AD1AEFF008E3161 /* sais.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sais.c; sourceTree = "<group>"; };
|
7223E7611AD1AEFF008E3161 /* sais.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sais.c; sourceTree = "<group>"; };
|
||||||
7223E7621AD1AEFF008E3161 /* sais.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sais.h; sourceTree = "<group>"; };
|
7223E7621AD1AEFF008E3161 /* sais.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sais.h; sourceTree = "<group>"; };
|
||||||
|
722589D61E0AD86B005EA0B9 /* SUUnarchiverProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiverProtocol.h; sourceTree = "<group>"; };
|
||||||
|
722589D81E0B19F4005EA0B9 /* SUUnarchiverNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUnarchiverNotifier.h; sourceTree = "<group>"; };
|
||||||
|
722589D91E0B19F4005EA0B9 /* SUUnarchiverNotifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUnarchiverNotifier.m; sourceTree = "<group>"; };
|
||||||
722954B41D04ADAF00ECF9CA /* fileop */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fileop; sourceTree = BUILT_PRODUCTS_DIR; };
|
722954B41D04ADAF00ECF9CA /* fileop */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fileop; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
722954B61D04ADAF00ECF9CA /* fileop.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileop.m; sourceTree = "<group>"; };
|
722954B61D04ADAF00ECF9CA /* fileop.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileop.m; sourceTree = "<group>"; };
|
||||||
722954C21D04E66F00ECF9CA /* SUFileOperationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileOperationConstants.h; sourceTree = "<group>"; };
|
722954C21D04E66F00ECF9CA /* SUFileOperationConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUFileOperationConstants.h; sourceTree = "<group>"; };
|
||||||
@@ -683,6 +745,14 @@
|
|||||||
722FB7471DD51331001D40CE /* ConfigSwift.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwift.xcconfig; sourceTree = "<group>"; };
|
722FB7471DD51331001D40CE /* ConfigSwift.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwift.xcconfig; sourceTree = "<group>"; };
|
||||||
722FB7481DD51350001D40CE /* ConfigSwiftDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwiftDebug.xcconfig; sourceTree = "<group>"; };
|
722FB7481DD51350001D40CE /* ConfigSwiftDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwiftDebug.xcconfig; sourceTree = "<group>"; };
|
||||||
722FB7491DD51350001D40CE /* ConfigSwiftRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwiftRelease.xcconfig; sourceTree = "<group>"; };
|
722FB7491DD51350001D40CE /* ConfigSwiftRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ConfigSwiftRelease.xcconfig; sourceTree = "<group>"; };
|
||||||
|
72316BD51E0DBF730039EFD9 /* SULocalizations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SULocalizations.h; sourceTree = "<group>"; };
|
||||||
|
72316BD71E0E17180039EFD9 /* SUBundleIcon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUBundleIcon.h; sourceTree = "<group>"; };
|
||||||
|
72316BD81E0E17180039EFD9 /* SUBundleIcon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUBundleIcon.m; sourceTree = "<group>"; };
|
||||||
|
72316BDC1E0E17910039EFD9 /* SUApplicationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUApplicationInfo.h; sourceTree = "<group>"; };
|
||||||
|
72316BDD1E0E17910039EFD9 /* SUApplicationInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUApplicationInfo.m; sourceTree = "<group>"; };
|
||||||
|
72316BE11E0E1C7F0039EFD9 /* SUSystemUpdateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUSystemUpdateInfo.h; sourceTree = "<group>"; };
|
||||||
|
72316BE21E0E1C7F0039EFD9 /* SUSystemUpdateInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUSystemUpdateInfo.m; sourceTree = "<group>"; };
|
||||||
|
72316BE51E1087060039EFD9 /* SUUpdaterDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdaterDelegate.h; sourceTree = "<group>"; };
|
||||||
723A920D1D722438004A9DED /* SUSpotlightImporterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUSpotlightImporterTest.swift; sourceTree = "<group>"; };
|
723A920D1D722438004A9DED /* SUSpotlightImporterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUSpotlightImporterTest.swift; sourceTree = "<group>"; };
|
||||||
723B252B1CEAB3A600909873 /* bscommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bscommon.c; sourceTree = "<group>"; };
|
723B252B1CEAB3A600909873 /* bscommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bscommon.c; sourceTree = "<group>"; };
|
||||||
723B252C1CEAB3A600909873 /* bscommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bscommon.h; sourceTree = "<group>"; };
|
723B252C1CEAB3A600909873 /* bscommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bscommon.h; sourceTree = "<group>"; };
|
||||||
@@ -753,6 +823,15 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
5AA96C521E0AE0DB00CA4346 /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
5AE13FBD1E0DA39B000D2C2C /* libbz2.tbd in Frameworks */,
|
||||||
|
5AAD006C1E0C2DBF00AF411E /* libxar.tbd in Frameworks */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
5D06E8CE0FD68C7C005AE3F6 /* Frameworks */ = {
|
5D06E8CE0FD68C7C005AE3F6 /* Frameworks */ = {
|
||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -829,6 +908,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */,
|
5D06E8D00FD68C7C005AE3F6 /* BinaryDelta */,
|
||||||
|
5AE13FB31E0D9E07000D2C2C /* generate_appcast */,
|
||||||
55C14BB7136EEF1500649790 /* Autoupdate.app */,
|
55C14BB7136EEF1500649790 /* Autoupdate.app */,
|
||||||
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */,
|
61B5F90209C4CEE200B25A18 /* Sparkle Test App.app */,
|
||||||
612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */,
|
612279D90DB5470200AB99EA /* Sparkle Unit Tests.xctest */,
|
||||||
@@ -842,6 +922,7 @@
|
|||||||
0867D691FE84028FC02AAC07 /* Sparkle */ = {
|
0867D691FE84028FC02AAC07 /* Sparkle */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
5AA96C561E0AE0DB00CA4346 /* generate_appcast */,
|
||||||
1495006D195FBBBD00BC5B5B /* Sparkle */,
|
1495006D195FBBBD00BC5B5B /* Sparkle */,
|
||||||
14732BB81960EEB600593899 /* Resources */,
|
14732BB81960EEB600593899 /* Resources */,
|
||||||
61227A100DB5484000AB99EA /* Tests */,
|
61227A100DB5484000AB99EA /* Tests */,
|
||||||
@@ -865,7 +946,9 @@
|
|||||||
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
|
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
|
||||||
6117796E0D1112E000749C97 /* IOKit.framework */,
|
6117796E0D1112E000749C97 /* IOKit.framework */,
|
||||||
5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */,
|
5D06E8FB0FD68D61005AE3F6 /* libbz2.dylib */,
|
||||||
|
5AE13FBC1E0DA39B000D2C2C /* libbz2.tbd */,
|
||||||
5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */,
|
5D1AF5890FD7678C0065DB48 /* libxar.1.dylib */,
|
||||||
|
5AAD006B1E0C2DBF00AF411E /* libxar.tbd */,
|
||||||
5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */,
|
5D1AF58F0FD767AD0065DB48 /* libxml2.dylib */,
|
||||||
5D1AF5990FD767E50065DB48 /* libz.dylib */,
|
5D1AF5990FD767E50065DB48 /* libz.dylib */,
|
||||||
61B5F8F609C4CEB300B25A18 /* Security.framework */,
|
61B5F8F609C4CEB300B25A18 /* Security.framework */,
|
||||||
@@ -991,6 +1074,20 @@
|
|||||||
path = Autoupdate;
|
path = Autoupdate;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
5AA96C561E0AE0DB00CA4346 /* generate_appcast */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
5AA96C5D1E0AE0F900CA4346 /* Appcast-Bridging-Header.h */,
|
||||||
|
5AE13F9F1E0D4F65000D2C2C /* Appcast.swift */,
|
||||||
|
5AAD00511E0BE6BE00AF411E /* ArchiveItem.swift */,
|
||||||
|
5AE13F771E0C9B12000D2C2C /* DSASignature.swift */,
|
||||||
|
5A5AC5371E0C6D3000998119 /* FeedXML.swift */,
|
||||||
|
5AA96C571E0AE0DB00CA4346 /* main.swift */,
|
||||||
|
5A5AC5351E0C6CA300998119 /* Unarchive.swift */,
|
||||||
|
);
|
||||||
|
path = generate_appcast;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
5D06E8D90FD68C95005AE3F6 /* Binary Delta */ = {
|
5D06E8D90FD68C95005AE3F6 /* Binary Delta */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -1015,9 +1112,11 @@
|
|||||||
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */,
|
6102FE490E07803800F85D09 /* SUDiskImageUnarchiver.m */,
|
||||||
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */,
|
6102FE440E077FCE00F85D09 /* SUPipedUnarchiver.h */,
|
||||||
6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */,
|
6129C0B90E0B79810062CE76 /* SUPipedUnarchiver.m */,
|
||||||
|
722589D61E0AD86B005EA0B9 /* SUUnarchiverProtocol.h */,
|
||||||
61299A8B09CA790200B7442F /* SUUnarchiver.h */,
|
61299A8B09CA790200B7442F /* SUUnarchiver.h */,
|
||||||
61299A8C09CA790200B7442F /* SUUnarchiver.m */,
|
61299A8C09CA790200B7442F /* SUUnarchiver.m */,
|
||||||
6102FE590E08C7EC00F85D09 /* SUUnarchiver_Private.h */,
|
722589D81E0B19F4005EA0B9 /* SUUnarchiverNotifier.h */,
|
||||||
|
722589D91E0B19F4005EA0B9 /* SUUnarchiverNotifier.m */,
|
||||||
);
|
);
|
||||||
name = Unarchiving;
|
name = Unarchiving;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1070,8 +1169,8 @@
|
|||||||
61B5FCA109C5228F00B25A18 /* SUUpdateAlert.m */,
|
61B5FCA109C5228F00B25A18 /* SUUpdateAlert.m */,
|
||||||
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */,
|
612DCBAD0D488BC60015DBEA /* SUUpdatePermissionPrompt.h */,
|
||||||
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */,
|
612DCBAE0D488BC60015DBEA /* SUUpdatePermissionPrompt.m */,
|
||||||
61180BC80D64138900B4E0D1 /* SUWindowController.h */,
|
7205C42F1E1215AD00E370AE /* SUUpdatePermissionResponse.h */,
|
||||||
61180BC90D64138900B4E0D1 /* SUWindowController.m */,
|
7205C4301E1215AD00E370AE /* SUUpdatePermissionResponse.m */,
|
||||||
);
|
);
|
||||||
name = "User Interface";
|
name = "User Interface";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1083,6 +1182,7 @@
|
|||||||
7275F9C01B5F1F2900B1D19E /* SUFileManager.m */,
|
7275F9C01B5F1F2900B1D19E /* SUFileManager.m */,
|
||||||
767B61AA1972D488004E0C3C /* SUGuidedPackageInstaller.h */,
|
767B61AA1972D488004E0C3C /* SUGuidedPackageInstaller.h */,
|
||||||
767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */,
|
767B61AB1972D488004E0C3C /* SUGuidedPackageInstaller.m */,
|
||||||
|
7205C42E1E11A6DA00E370AE /* SUInstallerProtocol.h */,
|
||||||
618FA4FF0DAE88B40026945C /* SUInstaller.h */,
|
618FA4FF0DAE88B40026945C /* SUInstaller.h */,
|
||||||
618FA5000DAE88B40026945C /* SUInstaller.m */,
|
618FA5000DAE88B40026945C /* SUInstaller.m */,
|
||||||
618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */,
|
618FA5200DAE8E8A0026945C /* SUPackageInstaller.h */,
|
||||||
@@ -1097,7 +1197,7 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
61299B3509CB04E000B7442F /* Sparkle.h */,
|
61299B3509CB04E000B7442F /* Sparkle.h */,
|
||||||
61CFB3280E385186007A1735 /* Sparkle.pch */,
|
72316BD51E0DBF730039EFD9 /* SULocalizations.h */,
|
||||||
61299A5B09CA6D4500B7442F /* SUConstants.h */,
|
61299A5B09CA6D4500B7442F /* SUConstants.h */,
|
||||||
61299A5F09CA6EB100B7442F /* SUConstants.m */,
|
61299A5F09CA6EB100B7442F /* SUConstants.m */,
|
||||||
55E6F33219EC9F6C00005E76 /* SUErrors.h */,
|
55E6F33219EC9F6C00005E76 /* SUErrors.h */,
|
||||||
@@ -1106,6 +1206,12 @@
|
|||||||
61EF67550E25B58D00F754E0 /* SUHost.m */,
|
61EF67550E25B58D00F754E0 /* SUHost.m */,
|
||||||
55C14F04136EF6DB00649790 /* SULog.h */,
|
55C14F04136EF6DB00649790 /* SULog.h */,
|
||||||
55C14F05136EF6DB00649790 /* SULog.m */,
|
55C14F05136EF6DB00649790 /* SULog.m */,
|
||||||
|
72316BD71E0E17180039EFD9 /* SUBundleIcon.h */,
|
||||||
|
72316BD81E0E17180039EFD9 /* SUBundleIcon.m */,
|
||||||
|
72316BDC1E0E17910039EFD9 /* SUApplicationInfo.h */,
|
||||||
|
72316BDD1E0E17910039EFD9 /* SUApplicationInfo.m */,
|
||||||
|
72316BE11E0E1C7F0039EFD9 /* SUSystemUpdateInfo.h */,
|
||||||
|
72316BE21E0E1C7F0039EFD9 /* SUSystemUpdateInfo.m */,
|
||||||
726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */,
|
726F2CE31BC9C33D001971A4 /* SUOperatingSystem.h */,
|
||||||
726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */,
|
726F2CE41BC9C33D001971A4 /* SUOperatingSystem.m */,
|
||||||
);
|
);
|
||||||
@@ -1177,7 +1283,8 @@
|
|||||||
61CFB2C10E384958007A1735 /* Support */,
|
61CFB2C10E384958007A1735 /* Support */,
|
||||||
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */,
|
61B5F8E309C4CE3C00B25A18 /* SUUpdater.h */,
|
||||||
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */,
|
61B5F8E409C4CE3C00B25A18 /* SUUpdater.m */,
|
||||||
6158A1C4137904B300487EC1 /* SUUpdater_Private.h */,
|
72316BE51E1087060039EFD9 /* SUUpdaterDelegate.h */,
|
||||||
|
6158A1C4137904B300487EC1 /* SUUpdaterPrivate.h */,
|
||||||
);
|
);
|
||||||
name = "Update Control";
|
name = "Update Control";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1250,15 +1357,17 @@
|
|||||||
files = (
|
files = (
|
||||||
611142E910FB1BE5009810AA /* bspatch.h in Headers */,
|
611142E910FB1BE5009810AA /* bspatch.h in Headers */,
|
||||||
61299B3609CB04E000B7442F /* Sparkle.h in Headers */,
|
61299B3609CB04E000B7442F /* Sparkle.h in Headers */,
|
||||||
61CFB3290E385186007A1735 /* Sparkle.pch in Headers */,
|
722589DA1E0B19F4005EA0B9 /* SUUnarchiverNotifier.h in Headers */,
|
||||||
61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */,
|
61B5FC0D09C4FC8200B25A18 /* SUAppcast.h in Headers */,
|
||||||
61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */,
|
61B5FC7009C51F4A00B25A18 /* SUAppcastItem.h in Headers */,
|
||||||
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */,
|
6120721209CC5C4B007FE0F6 /* SUAutomaticUpdateAlert.h in Headers */,
|
||||||
61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */,
|
61B93B270DD0FDD300DCD2F8 /* SUAutomaticUpdateDriver.h in Headers */,
|
||||||
|
72316BE61E1087060039EFD9 /* SUUpdaterDelegate.h in Headers */,
|
||||||
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */,
|
61F83F740DBFE141006FDD30 /* SUBasicUpdateDriver.h in Headers */,
|
||||||
5D06E9390FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.h in Headers */,
|
5D06E9390FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.h in Headers */,
|
||||||
61B078CE15A5FB6100600039 /* SUCodeSigningVerifier.h in Headers */,
|
61B078CE15A5FB6100600039 /* SUCodeSigningVerifier.h in Headers */,
|
||||||
61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */,
|
61299A5C09CA6D4500B7442F /* SUConstants.h in Headers */,
|
||||||
|
72316BE31E0E1C7F0039EFD9 /* SUSystemUpdateInfo.h in Headers */,
|
||||||
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */,
|
6102FE4A0E07803800F85D09 /* SUDiskImageUnarchiver.h in Headers */,
|
||||||
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */,
|
61299A2F09CA2DAB00B7442F /* SUDSAVerifier.h in Headers */,
|
||||||
55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */,
|
55E6F33319EC9F6C00005E76 /* SUErrors.h in Headers */,
|
||||||
@@ -1268,6 +1377,7 @@
|
|||||||
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */,
|
61EF67590E25C5B400F754E0 /* SUHost.h in Headers */,
|
||||||
729924731DF3478A00DBCDF5 /* SUUpdateValidator.h in Headers */,
|
729924731DF3478A00DBCDF5 /* SUUpdateValidator.h in Headers */,
|
||||||
723B25301CEAB3A600909873 /* bscommon.h in Headers */,
|
723B25301CEAB3A600909873 /* bscommon.h in Headers */,
|
||||||
|
722589D71E0AD86B005EA0B9 /* SUUnarchiverProtocol.h in Headers */,
|
||||||
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */,
|
618FA5010DAE88B40026945C /* SUInstaller.h in Headers */,
|
||||||
55C14F06136EF6DB00649790 /* SULog.h in Headers */,
|
55C14F06136EF6DB00649790 /* SULog.h in Headers */,
|
||||||
726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */,
|
726F2CE51BC9C33D001971A4 /* SUOperatingSystem.h in Headers */,
|
||||||
@@ -1277,21 +1387,23 @@
|
|||||||
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */,
|
6101347B0DD2541A0049ACDF /* SUProbingUpdateDriver.h in Headers */,
|
||||||
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */,
|
61B93C090DD112FF00DCD2F8 /* SUScheduledUpdateDriver.h in Headers */,
|
||||||
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */,
|
61A225A40D1C4AC000430CCD /* SUStandardVersionComparator.h in Headers */,
|
||||||
|
72316BD61E0DBF730039EFD9 /* SULocalizations.h in Headers */,
|
||||||
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */,
|
6196CFF909C72148000DC222 /* SUStatusController.h in Headers */,
|
||||||
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */,
|
61A2279C0D1CEE7600430CCD /* SUSystemProfiler.h in Headers */,
|
||||||
61B93A3C0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.h in Headers */,
|
61B93A3C0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.h in Headers */,
|
||||||
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */,
|
61299A8D09CA790200B7442F /* SUUnarchiver.h in Headers */,
|
||||||
6102FE5B0E08C7EC00F85D09 /* SUUnarchiver_Private.h in Headers */,
|
|
||||||
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */,
|
61B5FCDF09C52A9F00B25A18 /* SUUpdateAlert.h in Headers */,
|
||||||
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */,
|
610134730DD250470049ACDF /* SUUpdateDriver.h in Headers */,
|
||||||
|
72316BD91E0E17180039EFD9 /* SUBundleIcon.h in Headers */,
|
||||||
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */,
|
612DCBAF0D488BC60015DBEA /* SUUpdatePermissionPrompt.h in Headers */,
|
||||||
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */,
|
61B5F8ED09C4CE3C00B25A18 /* SUUpdater.h in Headers */,
|
||||||
6158A1C5137904B300487EC1 /* SUUpdater_Private.h in Headers */,
|
6158A1C5137904B300487EC1 /* SUUpdaterPrivate.h in Headers */,
|
||||||
|
72316BDE1E0E17910039EFD9 /* SUApplicationInfo.h in Headers */,
|
||||||
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */,
|
61A354550DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.h in Headers */,
|
||||||
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
61A2259E0D1C495D00430CCD /* SUVersionComparisonProtocol.h in Headers */,
|
||||||
3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */,
|
3772FEA913DE0B6B00F79537 /* SUVersionDisplayProtocol.h in Headers */,
|
||||||
|
7205C4311E1215AD00E370AE /* SUUpdatePermissionResponse.h in Headers */,
|
||||||
722954C41D04E66F00ECF9CA /* SUFileOperationConstants.h in Headers */,
|
722954C41D04E66F00ECF9CA /* SUFileOperationConstants.h in Headers */,
|
||||||
61180BCA0D64138900B4E0D1 /* SUWindowController.h in Headers */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -1321,6 +1433,7 @@
|
|||||||
buildToolPath = bash;
|
buildToolPath = bash;
|
||||||
buildWorkingDirectory = "";
|
buildWorkingDirectory = "";
|
||||||
dependencies = (
|
dependencies = (
|
||||||
|
5AE13FA81E0D7E1C000D2C2C /* PBXTargetDependency */,
|
||||||
14732BCB1960F73500593899 /* PBXTargetDependency */,
|
14732BCB1960F73500593899 /* PBXTargetDependency */,
|
||||||
1454BA1619637EDB00344E57 /* PBXTargetDependency */,
|
1454BA1619637EDB00344E57 /* PBXTargetDependency */,
|
||||||
14732BCF1960F73500593899 /* PBXTargetDependency */,
|
14732BCF1960F73500593899 /* PBXTargetDependency */,
|
||||||
@@ -1353,6 +1466,22 @@
|
|||||||
productReference = 55C14BB7136EEF1500649790 /* Autoupdate.app */;
|
productReference = 55C14BB7136EEF1500649790 /* Autoupdate.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
|
5AA96C541E0AE0DB00CA4346 /* generate_appcast */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 5AA96C5C1E0AE0DC00CA4346 /* Build configuration list for PBXNativeTarget "generate_appcast" */;
|
||||||
|
buildPhases = (
|
||||||
|
5AA96C511E0AE0DB00CA4346 /* Sources */,
|
||||||
|
5AA96C521E0AE0DB00CA4346 /* Frameworks */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = generate_appcast;
|
||||||
|
productName = Appcast;
|
||||||
|
productReference = 5AE13FB31E0D9E07000D2C2C /* generate_appcast */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */ = {
|
5D06E8CF0FD68C7C005AE3F6 /* BinaryDelta */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */;
|
buildConfigurationList = 5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */;
|
||||||
@@ -1474,10 +1603,15 @@
|
|||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
CLASSPREFIX = SU;
|
CLASSPREFIX = SU;
|
||||||
LastSwiftUpdateCheck = 0720;
|
LastSwiftUpdateCheck = 0800;
|
||||||
LastUpgradeCheck = 0800;
|
LastUpgradeCheck = 0800;
|
||||||
ORGANIZATIONNAME = "Sparkle Project";
|
ORGANIZATIONNAME = "Sparkle Project";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
|
5AA96C541E0AE0DB00CA4346 = {
|
||||||
|
CreatedOnToolsVersion = 8.0;
|
||||||
|
LastSwiftMigration = 0800;
|
||||||
|
ProvisioningStyle = Automatic;
|
||||||
|
};
|
||||||
612279D80DB5470200AB99EA = {
|
612279D80DB5470200AB99EA = {
|
||||||
LastSwiftMigration = 0800;
|
LastSwiftMigration = 0800;
|
||||||
TestTargetID = 8DC2EF4F0486A6940098B216;
|
TestTargetID = 8DC2EF4F0486A6940098B216;
|
||||||
@@ -1559,6 +1693,7 @@
|
|||||||
1495005F195FB89400BC5B5B /* All */,
|
1495005F195FB89400BC5B5B /* All */,
|
||||||
726B2B5C1C645FC900388755 /* UI Tests */,
|
726B2B5C1C645FC900388755 /* UI Tests */,
|
||||||
722954B31D04ADAF00ECF9CA /* fileop */,
|
722954B31D04ADAF00ECF9CA /* fileop */,
|
||||||
|
5AA96C541E0AE0DB00CA4346 /* generate_appcast */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -1705,9 +1840,11 @@
|
|||||||
files = (
|
files = (
|
||||||
55C14BD4136EEFCE00649790 /* Autoupdate.m in Sources */,
|
55C14BD4136EEFCE00649790 /* Autoupdate.m in Sources */,
|
||||||
F8761EB61ADC5E7A000C9034 /* SUCodeSigningVerifier.m in Sources */,
|
F8761EB61ADC5E7A000C9034 /* SUCodeSigningVerifier.m in Sources */,
|
||||||
|
72316BE01E0E17910039EFD9 /* SUApplicationInfo.m in Sources */,
|
||||||
55C14F00136EF6B700649790 /* SUConstants.m in Sources */,
|
55C14F00136EF6B700649790 /* SUConstants.m in Sources */,
|
||||||
7275F9C31B5F1F2900B1D19E /* SUFileManager.m in Sources */,
|
7275F9C31B5F1F2900B1D19E /* SUFileManager.m in Sources */,
|
||||||
767B61AE1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */,
|
767B61AE1972D488004E0C3C /* SUGuidedPackageInstaller.m in Sources */,
|
||||||
|
72316BDB1E0E17180039EFD9 /* SUBundleIcon.m in Sources */,
|
||||||
55C14F0C136EF6EA00649790 /* SUHost.m in Sources */,
|
55C14F0C136EF6EA00649790 /* SUHost.m in Sources */,
|
||||||
55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */,
|
55C14F0D136EF6F200649790 /* SUInstaller.m in Sources */,
|
||||||
55C14F08136EF6DB00649790 /* SULog.m in Sources */,
|
55C14F08136EF6DB00649790 /* SULog.m in Sources */,
|
||||||
@@ -1718,7 +1855,36 @@
|
|||||||
55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */,
|
55C14F22136EF86000649790 /* SUStandardVersionComparator.m in Sources */,
|
||||||
55C14F20136EF84300649790 /* SUStatusController.m in Sources */,
|
55C14F20136EF84300649790 /* SUStatusController.m in Sources */,
|
||||||
55C14F23136EF86700649790 /* SUSystemProfiler.m in Sources */,
|
55C14F23136EF86700649790 /* SUSystemProfiler.m in Sources */,
|
||||||
55C14F2A136EF9A900649790 /* SUWindowController.m in Sources */,
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
5AA96C511E0AE0DB00CA4346 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
5AE13FA01E0D4F65000D2C2C /* Appcast.swift in Sources */,
|
||||||
|
5AAD00521E0BE6BE00AF411E /* ArchiveItem.swift in Sources */,
|
||||||
|
5AAD00681E0C2DAB00AF411E /* bscommon.c in Sources */,
|
||||||
|
5AAD00691E0C2DAB00AF411E /* bsdiff.c in Sources */,
|
||||||
|
5AE13FBB1E0DA391000D2C2C /* bspatch.c in Sources */,
|
||||||
|
5AE13F781E0C9B12000D2C2C /* DSASignature.swift in Sources */,
|
||||||
|
5A5AC5381E0C6D3000998119 /* FeedXML.swift in Sources */,
|
||||||
|
5AA96C581E0AE0DB00CA4346 /* main.swift in Sources */,
|
||||||
|
5AAD006A1E0C2DB500AF411E /* sais.c in Sources */,
|
||||||
|
5AE13FBA1E0DA389000D2C2C /* SUBinaryDeltaApply.m in Sources */,
|
||||||
|
5AAD00661E0C2D9B00AF411E /* SUBinaryDeltaCommon.m in Sources */,
|
||||||
|
5AAD00671E0C2D9B00AF411E /* SUBinaryDeltaCreate.m in Sources */,
|
||||||
|
5AE13FB91E0DA384000D2C2C /* SUBinaryDeltaUnarchiver.m in Sources */,
|
||||||
|
5AE13FA51E0D71F5000D2C2C /* SUConstants.m in Sources */,
|
||||||
|
5AE13FB51E0D9F32000D2C2C /* SUDiskImageUnarchiver.m in Sources */,
|
||||||
|
5AE13FA21E0D716F000D2C2C /* SUFileManager.m in Sources */,
|
||||||
|
5AE13FA41E0D71D1000D2C2C /* SUFileOperationConstants.m in Sources */,
|
||||||
|
5AE13FB81E0D9F8E000D2C2C /* SULog.m in Sources */,
|
||||||
|
5AE13FB61E0D9F39000D2C2C /* SUPipedUnarchiver.m in Sources */,
|
||||||
|
5AE13FA61E0D7275000D2C2C /* SUStandardVersionComparator.m in Sources */,
|
||||||
|
5AE13FA11E0D7168000D2C2C /* SUUnarchiver.m in Sources */,
|
||||||
|
5AE13FB71E0D9F42000D2C2C /* SUUnarchiverNotifier.m in Sources */,
|
||||||
|
5A5AC5361E0C6CA300998119 /* Unarchive.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -1813,6 +1979,7 @@
|
|||||||
5D06E8EC0FD68CE4005AE3F6 /* SUBinaryDeltaApply.m in Sources */,
|
5D06E8EC0FD68CE4005AE3F6 /* SUBinaryDeltaApply.m in Sources */,
|
||||||
5D06E8ED0FD68CE4005AE3F6 /* SUBinaryDeltaCommon.m in Sources */,
|
5D06E8ED0FD68CE4005AE3F6 /* SUBinaryDeltaCommon.m in Sources */,
|
||||||
5D06E93A0FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m in Sources */,
|
5D06E93A0FD69271005AE3F6 /* SUBinaryDeltaUnarchiver.m in Sources */,
|
||||||
|
722589DB1E0B19F4005EA0B9 /* SUUnarchiverNotifier.m in Sources */,
|
||||||
61B078CF15A5FB6100600039 /* SUCodeSigningVerifier.m in Sources */,
|
61B078CF15A5FB6100600039 /* SUCodeSigningVerifier.m in Sources */,
|
||||||
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */,
|
61299A6009CA6EB100B7442F /* SUConstants.m in Sources */,
|
||||||
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */,
|
6102FE4B0E07803800F85D09 /* SUDiskImageUnarchiver.m in Sources */,
|
||||||
@@ -1822,6 +1989,7 @@
|
|||||||
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */,
|
61EF67560E25B58D00F754E0 /* SUHost.m in Sources */,
|
||||||
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */,
|
618FA5020DAE88B40026945C /* SUInstaller.m in Sources */,
|
||||||
55C14F07136EF6DB00649790 /* SULog.m in Sources */,
|
55C14F07136EF6DB00649790 /* SULog.m in Sources */,
|
||||||
|
72316BDA1E0E17180039EFD9 /* SUBundleIcon.m in Sources */,
|
||||||
729924741DF3478A00DBCDF5 /* SUUpdateValidator.m in Sources */,
|
729924741DF3478A00DBCDF5 /* SUUpdateValidator.m in Sources */,
|
||||||
723B252D1CEAB3A600909873 /* bscommon.c in Sources */,
|
723B252D1CEAB3A600909873 /* bscommon.c in Sources */,
|
||||||
726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */,
|
726F2CE61BC9C33D001971A4 /* SUOperatingSystem.m in Sources */,
|
||||||
@@ -1835,12 +2003,14 @@
|
|||||||
61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */,
|
61A2279D0D1CEE7600430CCD /* SUSystemProfiler.m in Sources */,
|
||||||
61B93A3D0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.m in Sources */,
|
61B93A3D0DD02D7000DCD2F8 /* SUUIBasedUpdateDriver.m in Sources */,
|
||||||
61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */,
|
61299A8E09CA790200B7442F /* SUUnarchiver.m in Sources */,
|
||||||
|
72316BDF1E0E17910039EFD9 /* SUApplicationInfo.m in Sources */,
|
||||||
61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */,
|
61B5FCDE09C52A9F00B25A18 /* SUUpdateAlert.m in Sources */,
|
||||||
610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */,
|
610134740DD250470049ACDF /* SUUpdateDriver.m in Sources */,
|
||||||
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */,
|
612DCBB00D488BC60015DBEA /* SUUpdatePermissionPrompt.m in Sources */,
|
||||||
|
72316BE41E0E1C7F0039EFD9 /* SUSystemUpdateInfo.m in Sources */,
|
||||||
|
7205C4321E1215AD00E370AE /* SUUpdatePermissionResponse.m in Sources */,
|
||||||
61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */,
|
61B5F8EE09C4CE3C00B25A18 /* SUUpdater.m in Sources */,
|
||||||
61A354560DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m in Sources */,
|
61A354560DF113C70076ECB1 /* SUUserInitiatedUpdateDriver.m in Sources */,
|
||||||
61180BCB0D64138900B4E0D1 /* SUWindowController.m in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -1897,6 +2067,16 @@
|
|||||||
target = 55C14BB6136EEF1500649790 /* Autoupdate */;
|
target = 55C14BB6136EEF1500649790 /* Autoupdate */;
|
||||||
targetProxy = 55C14F96136F044100649790 /* PBXContainerItemProxy */;
|
targetProxy = 55C14F96136F044100649790 /* PBXContainerItemProxy */;
|
||||||
};
|
};
|
||||||
|
5AE13FA81E0D7E1C000D2C2C /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 5AA96C541E0AE0DB00CA4346 /* generate_appcast */;
|
||||||
|
targetProxy = 5AE13FA71E0D7E1C000D2C2C /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
5AE13FAA1E0D7E2F000D2C2C /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 5AA96C541E0AE0DB00CA4346 /* generate_appcast */;
|
||||||
|
targetProxy = 5AE13FA91E0D7E2F000D2C2C /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
5D06E8D60FD68C86005AE3F6 /* PBXTargetDependency */ = {
|
5D06E8D60FD68C86005AE3F6 /* PBXTargetDependency */ = {
|
||||||
isa = PBXTargetDependency;
|
isa = PBXTargetDependency;
|
||||||
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
|
target = 8DC2EF4F0486A6940098B216 /* Sparkle */;
|
||||||
@@ -2255,6 +2435,37 @@
|
|||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
|
5AA96C591E0AE0DC00CA4346 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "generate_appcast/Appcast-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 3.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
5AA96C5A1E0AE0DC00CA4346 /* Coverage */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "generate_appcast/Appcast-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 3.0;
|
||||||
|
};
|
||||||
|
name = Coverage;
|
||||||
|
};
|
||||||
|
5AA96C5B1E0AE0DC00CA4346 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "generate_appcast/Appcast-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
|
SWIFT_VERSION = 3.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
5D06E8D20FD68C7D005AE3F6 /* Debug */ = {
|
5D06E8D20FD68C7D005AE3F6 /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 5D06E8F20FD68D21005AE3F6 /* ConfigBinaryDeltaDebug.xcconfig */;
|
baseConfigurationReference = 5D06E8F20FD68D21005AE3F6 /* ConfigBinaryDeltaDebug.xcconfig */;
|
||||||
@@ -2408,6 +2619,16 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
|
5AA96C5C1E0AE0DC00CA4346 /* Build configuration list for PBXNativeTarget "generate_appcast" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
5AA96C591E0AE0DC00CA4346 /* Debug */,
|
||||||
|
5AA96C5A1E0AE0DC00CA4346 /* Coverage */,
|
||||||
|
5AA96C5B1E0AE0DC00CA4346 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */ = {
|
5D06E8DA0FD68C95005AE3F6 /* Build configuration list for PBXNativeTarget "BinaryDelta" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
|
|||||||
Vendored
+67
-40
@@ -1,9 +1,12 @@
|
|||||||
#import <AppKit/AppKit.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
#import "SUInstaller.h"
|
#import "SUInstaller.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUStandardVersionComparator.h"
|
#import "SUStandardVersionComparator.h"
|
||||||
#import "SUStatusController.h"
|
#import "SUStatusController.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUInstallerProtocol.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -152,19 +155,20 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)showError:(NSError *)error
|
||||||
|
{
|
||||||
|
if (self.shouldShowUI) {
|
||||||
|
NSAlert *alert = [[NSAlert alloc] init];
|
||||||
|
alert.messageText = @"";
|
||||||
|
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
|
||||||
|
[alert runModal];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)install
|
- (void)install
|
||||||
{
|
{
|
||||||
NSBundle *theBundle = [NSBundle bundleWithPath:self.hostPath];
|
NSBundle *theBundle = [NSBundle bundleWithPath:self.hostPath];
|
||||||
SUHost *host = [[SUHost alloc] initWithBundle:theBundle];
|
SUHost *host = [[SUHost alloc] initWithBundle:theBundle];
|
||||||
NSString *installationPath = [[host installationPath] copy];
|
|
||||||
|
|
||||||
if (self.shouldShowUI) {
|
|
||||||
self.statusController = [[SUStatusController alloc] initWithHost:host];
|
|
||||||
[self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO];
|
|
||||||
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
|
|
||||||
maxProgressValue: 0 statusText: @""];
|
|
||||||
[self.statusController showWindow:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
NSString *fileOperationToolPath = [[[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@""SPARKLE_FILEOP_TOOL_NAME];
|
NSString *fileOperationToolPath = [[[[NSBundle mainBundle] executablePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@""SPARKLE_FILEOP_TOOL_NAME];
|
||||||
|
|
||||||
@@ -172,36 +176,59 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5;
|
|||||||
SULog(@"Potential Installation Error: File operation tool path %@ is not found", fileOperationToolPath);
|
SULog(@"Potential Installation Error: File operation tool path %@ is not found", fileOperationToolPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
[SUInstaller installFromUpdateFolder:self.updateFolderPath
|
NSError *retrieveInstallerError = nil;
|
||||||
overHost:host
|
id<SUInstallerProtocol> installer = [SUInstaller installerForHost:host fileOperationToolPath:fileOperationToolPath updateDirectory:self.updateFolderPath error:&retrieveInstallerError];
|
||||||
installationPath:installationPath
|
if (installer == nil) {
|
||||||
fileOperationToolPath:fileOperationToolPath
|
SULog(@"Retrieved Installer Error: %@", retrieveInstallerError);
|
||||||
versionComparator:[SUStandardVersionComparator defaultComparator]
|
exit(EXIT_FAILURE);
|
||||||
completionHandler:^(NSError *error) {
|
}
|
||||||
if (error) {
|
|
||||||
NSError *underlyingError = [error.userInfo objectForKey:NSUnderlyingErrorKey];
|
if (self.shouldShowUI && [installer canInstallSilently]) {
|
||||||
if (underlyingError == nil || underlyingError.code != SUInstallationCancelledError) {
|
self.statusController = [[SUStatusController alloc] initWithHost:host];
|
||||||
SULog(@"Installation Error: %@", error);
|
[self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO];
|
||||||
if (self.shouldShowUI) {
|
[self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"")
|
||||||
NSAlert *alert = [[NSAlert alloc] init];
|
maxProgressValue: 0 statusText: @""];
|
||||||
alert.messageText = @"";
|
[self.statusController showWindow:self];
|
||||||
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
|
}
|
||||||
[alert runModal];
|
|
||||||
}
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
}
|
NSError *initialInstallationError = nil;
|
||||||
exit(EXIT_FAILURE);
|
if (![installer performInitialInstallation:&initialInstallationError]) {
|
||||||
} else {
|
SULog(@"Failed to perform initial installation with error: %@", initialInstallationError);
|
||||||
NSString *pathToRelaunch = nil;
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
// If the installation path differs from the host path, we give higher precedence for it than
|
[self showError:initialInstallationError];
|
||||||
// if the desired relaunch path differs from the host path
|
exit(EXIT_FAILURE);
|
||||||
if (![installationPath.pathComponents isEqualToArray:self.hostPath.pathComponents] || [self.relaunchPath.pathComponents isEqualToArray:self.hostPath.pathComponents]) {
|
});
|
||||||
pathToRelaunch = installationPath;
|
return;
|
||||||
} else {
|
}
|
||||||
pathToRelaunch = self.relaunchPath;
|
|
||||||
}
|
NSError *finalInstallationError = nil;
|
||||||
[self cleanupAndTerminateWithPathToRelaunch:pathToRelaunch];
|
if (![installer performFinalInstallation:&finalInstallationError]) {
|
||||||
}
|
NSError *underlyingError = [finalInstallationError.userInfo objectForKey:NSUnderlyingErrorKey];
|
||||||
}];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
if (underlyingError == nil || underlyingError.code != SUInstallationCancelledError) {
|
||||||
|
SULog(@"Failed to perform final installation Error: %@", finalInstallationError);
|
||||||
|
[self showError:finalInstallationError];
|
||||||
|
}
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString *installationPath = [installer installationPath];
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
NSString *pathToRelaunch = nil;
|
||||||
|
// If the relaunch path is the same as the host bundle path, use the installation path from the installer which may be normalized
|
||||||
|
// Otherwise use the requested relaunch path in all other cases
|
||||||
|
if ([self.relaunchPath.pathComponents isEqualToArray:host.bundlePath.pathComponents]) {
|
||||||
|
pathToRelaunch = installationPath;
|
||||||
|
} else {
|
||||||
|
pathToRelaunch = self.relaunchPath;
|
||||||
|
}
|
||||||
|
[self cleanupAndTerminateWithPathToRelaunch:pathToRelaunch];
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)cleanupAndTerminateWithPathToRelaunch:(NSString *)relaunchPath
|
- (void)cleanupAndTerminateWithPathToRelaunch:(NSString *)relaunchPath
|
||||||
|
|||||||
Vendored
+8
-4
@@ -16,16 +16,20 @@
|
|||||||
#endif
|
#endif
|
||||||
#import "SUExport.h"
|
#import "SUExport.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class SUAppcastItem;
|
@class SUAppcastItem;
|
||||||
SU_EXPORT @interface SUAppcast : NSObject<NSURLDownloadDelegate>
|
SU_EXPORT @interface SUAppcast : NSObject<NSURLDownloadDelegate>
|
||||||
|
|
||||||
@property (copy) NSString *userAgentString;
|
@property (copy, nullable) NSString *userAgentString;
|
||||||
@property (copy) NSDictionary *httpHeaders;
|
@property (copy, nullable) NSDictionary *httpHeaders;
|
||||||
|
|
||||||
- (void)fetchAppcastFromURL:(NSURL *)url completionBlock:(void (^)(NSError *))err;
|
- (void)fetchAppcastFromURL:(NSURL *)url completionBlock:(void (^)(NSError *_Nullable))err;
|
||||||
- (SUAppcast *)copyWithoutDeltaUpdates;
|
- (SUAppcast *)copyWithoutDeltaUpdates;
|
||||||
|
|
||||||
@property (readonly, copy) NSArray *items;
|
@property (readonly, copy, nullable) NSArray *items;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+2
-5
@@ -6,14 +6,11 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
#import "SUAppcast.h"
|
||||||
#import "SUAppcastItem.h"
|
#import "SUAppcastItem.h"
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUConstants.h"
|
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
@interface NSXMLElement (SUAppcastExtensions)
|
@interface NSXMLElement (SUAppcastExtensions)
|
||||||
@property (readonly, copy) NSDictionary *attributesAsDictionary;
|
@property (readonly, copy) NSDictionary *attributesAsDictionary;
|
||||||
|
|||||||
Vendored
+1
-5
@@ -6,13 +6,9 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUAppcastItem.h"
|
#import "SUAppcastItem.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUConstants.h"
|
||||||
|
|
||||||
@interface SUAppcastItem ()
|
@interface SUAppcastItem ()
|
||||||
@property (copy, readwrite) NSString *title;
|
@property (copy, readwrite) NSString *title;
|
||||||
|
|||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// SUApplicationInfo.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 2/28/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUApplicationInfo : NSObject
|
||||||
|
|
||||||
|
+ (BOOL)isBackgroundApplication:(NSApplication *)application;
|
||||||
|
|
||||||
|
+ (NSImage *)bestIconForBundle:(NSBundle *)bundle;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+36
@@ -0,0 +1,36 @@
|
|||||||
|
//
|
||||||
|
// SUApplicationInfo.m
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 2/28/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
#import "SUBundleIcon.h"
|
||||||
|
|
||||||
|
@implementation SUApplicationInfo
|
||||||
|
|
||||||
|
+ (BOOL)isBackgroundApplication:(NSApplication *)application
|
||||||
|
{
|
||||||
|
return (application.activationPolicy == NSApplicationActivationPolicyAccessory);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSImage *)bestIconForBundle:(NSBundle *)bundle
|
||||||
|
{
|
||||||
|
NSURL *iconURL = [SUBundleIcon iconURLForBundle:bundle];
|
||||||
|
|
||||||
|
NSImage *icon = (iconURL == nil) ? nil : [[NSImage alloc] initWithContentsOfURL:iconURL];
|
||||||
|
// Use a default icon if none is defined.
|
||||||
|
if (!icon) {
|
||||||
|
// this asumption may not be correct (eg. even though we're not the main bundle, it could be still be a regular app)
|
||||||
|
// but still better than nothing if no icon was included
|
||||||
|
BOOL isMainBundle = (bundle == [NSBundle mainBundle]);
|
||||||
|
|
||||||
|
NSString *fileType = isMainBundle ? (__bridge NSString *)kUTTypeApplication : (__bridge NSString *)kUTTypeBundle;
|
||||||
|
icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileType];
|
||||||
|
}
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+2
-2
@@ -9,7 +9,7 @@
|
|||||||
#ifndef SUAUTOMATICUPDATEALERT_H
|
#ifndef SUAUTOMATICUPDATEALERT_H
|
||||||
#define SUAUTOMATICUPDATEALERT_H
|
#define SUAUTOMATICUPDATEALERT_H
|
||||||
|
|
||||||
#import "SUWindowController.h"
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, SUAutomaticInstallationChoice) {
|
typedef NS_ENUM(NSInteger, SUAutomaticInstallationChoice) {
|
||||||
SUInstallNowChoice,
|
SUInstallNowChoice,
|
||||||
@@ -18,7 +18,7 @@ typedef NS_ENUM(NSInteger, SUAutomaticInstallationChoice) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@class SUAppcastItem, SUHost;
|
@class SUAppcastItem, SUHost;
|
||||||
@interface SUAutomaticUpdateAlert : SUWindowController
|
@interface SUAutomaticUpdateAlert : NSWindowController
|
||||||
|
|
||||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle completionBlock:(void (^)(SUAutomaticInstallationChoice))c;
|
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle completionBlock:(void (^)(SUAutomaticInstallationChoice))c;
|
||||||
- (IBAction)installNow:sender;
|
- (IBAction)installNow:sender;
|
||||||
|
|||||||
Vendored
+5
-3
@@ -7,7 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUAutomaticUpdateAlert.h"
|
#import "SUAutomaticUpdateAlert.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUAppcastItem.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
|
|
||||||
@interface SUAutomaticUpdateAlert ()
|
@interface SUAutomaticUpdateAlert ()
|
||||||
@@ -34,7 +36,7 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *__nonnull)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self.host bundlePath], [self.host installationPath]]; }
|
- (NSString *__nonnull)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||||
|
|
||||||
- (IBAction)installNow:(id)__unused sender
|
- (IBAction)installNow:(id)__unused sender
|
||||||
{
|
{
|
||||||
@@ -59,7 +61,7 @@
|
|||||||
|
|
||||||
- (NSImage *__nonnull)applicationIcon
|
- (NSImage *__nonnull)applicationIcon
|
||||||
{
|
{
|
||||||
return [self.host icon];
|
return [SUApplicationInfo bestIconForBundle:self.host.bundle];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *__nonnull)titleText
|
- (NSString *__nonnull)titleText
|
||||||
|
|||||||
Vendored
+1
-3
@@ -9,11 +9,9 @@
|
|||||||
#ifndef SUAUTOMATICUPDATEDRIVER_H
|
#ifndef SUAUTOMATICUPDATEDRIVER_H
|
||||||
#define SUAUTOMATICUPDATEDRIVER_H
|
#define SUAUTOMATICUPDATEDRIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUBasicUpdateDriver.h"
|
#import "SUBasicUpdateDriver.h"
|
||||||
#import "SUAutomaticUpdateAlert.h"
|
|
||||||
|
|
||||||
@interface SUAutomaticUpdateDriver : SUBasicUpdateDriver <SUUnarchiverDelegate>
|
@interface SUAutomaticUpdateDriver : SUBasicUpdateDriver
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Vendored
+15
-7
@@ -7,10 +7,15 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUAutomaticUpdateDriver.h"
|
#import "SUAutomaticUpdateDriver.h"
|
||||||
|
#import "SUUpdaterPrivate.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
#import "SUAutomaticUpdateAlert.h"
|
#import "SUAutomaticUpdateAlert.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
|
#import "SUAppcastItem.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
|
||||||
// If the user hasn't quit in a week, ask them if they want to relaunch to get the latest bits. It doesn't matter that this measure of "one day" is imprecise.
|
// If the user hasn't quit in a week, ask them if they want to relaunch to get the latest bits. It doesn't matter that this measure of "one day" is imprecise.
|
||||||
static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 24 * 7;
|
static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 24 * 7;
|
||||||
@@ -51,7 +56,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
// If the app is a menubar app or the like, we need to focus it first and alter the
|
// If the app is a menubar app or the like, we need to focus it first and alter the
|
||||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||||
// there may be no way for the application to be activated to make it visible again.
|
// there may be no way for the application to be activated to make it visible again.
|
||||||
if ([self.host isBackgroundApplication]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[[self.alert window] setHidesOnDeactivate:NO];
|
[[self.alert window] setHidesOnDeactivate:NO];
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
@@ -62,7 +67,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)unarchiverDidFinish:(SUUnarchiver *)__unused ua
|
- (void)unarchiverDidFinish:(id)__unused ua
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
|
||||||
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillPowerOff:) name:NSWorkspaceWillPowerOffNotification object:nil];
|
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(systemWillPowerOff:) name:NSWorkspaceWillPowerOffNotification object:nil];
|
||||||
@@ -73,7 +78,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
|
|
||||||
self.willUpdateOnTermination = YES;
|
self.willUpdateOnTermination = YES;
|
||||||
|
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationInvocation:)])
|
if ([updaterDelegate respondsToSelector:@selector(updater:willInstallUpdateOnQuit:immediateInstallationInvocation:)])
|
||||||
{
|
{
|
||||||
BOOL relaunch = YES;
|
BOOL relaunch = YES;
|
||||||
@@ -83,7 +89,7 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
[invocation setArgument:&relaunch atIndex:2];
|
[invocation setArgument:&relaunch atIndex:2];
|
||||||
[invocation setArgument:&showUI atIndex:3];
|
[invocation setArgument:&showUI atIndex:3];
|
||||||
[invocation setTarget:self];
|
[invocation setTarget:self];
|
||||||
|
|
||||||
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
|
[updaterDelegate updater:self.updater willInstallUpdateOnQuit:self.updateItem immediateInstallationInvocation:invocation];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +119,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
|
|
||||||
self.willUpdateOnTermination = NO;
|
self.willUpdateOnTermination = NO;
|
||||||
|
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:didCancelInstallUpdateOnQuit:)])
|
if ([updaterDelegate respondsToSelector:@selector(updater:didCancelInstallUpdateOnQuit:)])
|
||||||
[updaterDelegate updater:self.updater didCancelInstallUpdateOnQuit:self.updateItem];
|
[updaterDelegate updater:self.updater didCancelInstallUpdateOnQuit:self.updateItem];
|
||||||
}
|
}
|
||||||
@@ -210,7 +217,8 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2
|
|||||||
} else {
|
} else {
|
||||||
// Call delegate separately here because otherwise it won't know we stopped.
|
// Call delegate separately here because otherwise it won't know we stopped.
|
||||||
// Normally this gets called by the superclass
|
// Normally this gets called by the superclass
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+6
-7
@@ -9,13 +9,10 @@
|
|||||||
#ifndef SUBASICUPDATEDRIVER_H
|
#ifndef SUBASICUPDATEDRIVER_H
|
||||||
#define SUBASICUPDATEDRIVER_H
|
#define SUBASICUPDATEDRIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUUpdateDriver.h"
|
#import "SUUpdateDriver.h"
|
||||||
#import "SUUnarchiver.h"
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
|
|
||||||
@class SUAppcastItem, SUHost;
|
@class SUAppcast, SUAppcastItem, SUHost;
|
||||||
@interface SUBasicUpdateDriver : SUUpdateDriver <NSURLDownloadDelegate, SUUnarchiverDelegate>
|
@interface SUBasicUpdateDriver : SUUpdateDriver <NSURLDownloadDelegate>
|
||||||
|
|
||||||
@property (strong, readonly) SUAppcastItem *updateItem;
|
@property (strong, readonly) SUAppcastItem *updateItem;
|
||||||
@property (strong, readonly) NSURLDownload *download;
|
@property (strong, readonly) NSURLDownload *download;
|
||||||
@@ -37,10 +34,12 @@
|
|||||||
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
|
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
|
||||||
|
|
||||||
- (void)extractUpdate;
|
- (void)extractUpdate;
|
||||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua;
|
|
||||||
- (void)unarchiverDidFail:(SUUnarchiver *)ua;
|
|
||||||
- (void)failedToApplyDeltaUpdate;
|
- (void)failedToApplyDeltaUpdate;
|
||||||
|
|
||||||
|
// Needed to preserve compatibility to subclasses, even though our unarchiver code uses blocks now
|
||||||
|
- (void)unarchiver:(id)ua extractedProgress:(double)progress;
|
||||||
|
- (void)unarchiverDidFinish:(id)ua;
|
||||||
|
|
||||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch;
|
- (void)installWithToolAndRelaunch:(BOOL)relaunch;
|
||||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI;
|
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI;
|
||||||
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
|
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
|
||||||
|
|||||||
Vendored
+89
-39
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#import "SUBasicUpdateDriver.h"
|
#import "SUBasicUpdateDriver.h"
|
||||||
|
|
||||||
|
#import "SUUnarchiverProtocol.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUOperatingSystem.h"
|
#import "SUOperatingSystem.h"
|
||||||
#import "SUStandardVersionComparator.h"
|
#import "SUStandardVersionComparator.h"
|
||||||
@@ -15,9 +16,14 @@
|
|||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
#import "SUBinaryDeltaCommon.h"
|
#import "SUBinaryDeltaCommon.h"
|
||||||
#import "SUUpdater_Private.h"
|
#import "SUUpdaterPrivate.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
#import "SUFileManager.h"
|
#import "SUFileManager.h"
|
||||||
#import "SUUpdateValidator.h"
|
#import "SUUpdateValidator.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
#import "SUAppcast.h"
|
||||||
|
#import "SUAppcastItem.h"
|
||||||
|
|
||||||
@interface SUBasicUpdateDriver ()
|
@interface SUBasicUpdateDriver ()
|
||||||
|
|
||||||
@@ -56,8 +62,9 @@
|
|||||||
|
|
||||||
SUAppcast *appcast = [[SUAppcast alloc] init];
|
SUAppcast *appcast = [[SUAppcast alloc] init];
|
||||||
|
|
||||||
[appcast setUserAgentString:[self.updater userAgentString]];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[appcast setHttpHeaders:[self.updater httpHeaders]];
|
[appcast setUserAgentString:[updater userAgentString]];
|
||||||
|
[appcast setHttpHeaders:[updater httpHeaders]];
|
||||||
[appcast fetchAppcastFromURL:URL completionBlock:^(NSError *error) {
|
[appcast fetchAppcastFromURL:URL completionBlock:^(NSError *error) {
|
||||||
if (error) {
|
if (error) {
|
||||||
[self abortUpdateWithError:error];
|
[self abortUpdateWithError:error];
|
||||||
@@ -70,15 +77,16 @@
|
|||||||
- (id<SUVersionComparison>)versionComparator
|
- (id<SUVersionComparison>)versionComparator
|
||||||
{
|
{
|
||||||
id<SUVersionComparison> comparator = nil;
|
id<SUVersionComparison> comparator = nil;
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
|
||||||
// Give the delegate a chance to provide a custom version comparator
|
// Give the delegate a chance to provide a custom version comparator
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)]) {
|
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)]) {
|
||||||
comparator = [[self.updater delegate] versionComparatorForUpdater:self.updater];
|
comparator = [[updater delegate] versionComparatorForUpdater:self.updater];
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't get a comparator from the delegate, use the default comparator
|
// If we don't get a comparator from the delegate, use the default comparator
|
||||||
if (!comparator) {
|
if (!comparator) {
|
||||||
comparator = [SUStandardVersionComparator defaultComparator];
|
comparator = [[SUStandardVersionComparator alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
return comparator;
|
return comparator;
|
||||||
@@ -112,13 +120,15 @@
|
|||||||
|
|
||||||
BOOL minimumVersionOK = TRUE;
|
BOOL minimumVersionOK = TRUE;
|
||||||
BOOL maximumVersionOK = TRUE;
|
BOOL maximumVersionOK = TRUE;
|
||||||
|
|
||||||
|
id<SUVersionComparison> versionComparator = [[SUStandardVersionComparator alloc] init];
|
||||||
|
|
||||||
// Check minimum and maximum System Version
|
// Check minimum and maximum System Version
|
||||||
if ([ui minimumSystemVersion] != nil && ![[ui minimumSystemVersion] isEqualToString:@""]) {
|
if ([ui minimumSystemVersion] != nil && ![[ui minimumSystemVersion] isEqualToString:@""]) {
|
||||||
minimumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedDescending;
|
minimumVersionOK = [versionComparator compareVersion:[ui minimumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedDescending;
|
||||||
}
|
}
|
||||||
if ([ui maximumSystemVersion] != nil && ![[ui maximumSystemVersion] isEqualToString:@""]) {
|
if ([ui maximumSystemVersion] != nil && ![[ui maximumSystemVersion] isEqualToString:@""]) {
|
||||||
maximumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending;
|
maximumVersionOK = [versionComparator compareVersion:[ui maximumSystemVersion] toVersion:[SUOperatingSystem systemVersionString]] != NSOrderedAscending;
|
||||||
}
|
}
|
||||||
|
|
||||||
return minimumVersionOK && maximumVersionOK;
|
return minimumVersionOK && maximumVersionOK;
|
||||||
@@ -143,8 +153,9 @@
|
|||||||
|
|
||||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||||
{
|
{
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) {
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[[self.updater delegate] updater:self.updater didFinishLoadingAppcast:ac];
|
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)]) {
|
||||||
|
[[updater delegate] updater:self.updater didFinishLoadingAppcast:ac];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDictionary *userInfo = (ac != nil) ? @{ SUUpdaterAppcastNotificationKey: ac } : nil;
|
NSDictionary *userInfo = (ac != nil) ? @{ SUUpdaterAppcastNotificationKey: ac } : nil;
|
||||||
@@ -153,14 +164,18 @@
|
|||||||
SUAppcastItem *item = nil;
|
SUAppcastItem *item = nil;
|
||||||
|
|
||||||
// Now we have to find the best valid update in the appcast.
|
// Now we have to find the best valid update in the appcast.
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(bestValidUpdateInAppcast:forUpdater:)]) // Does the delegate want to handle it?
|
if ([[updater delegate] respondsToSelector:@selector(bestValidUpdateInAppcast:forUpdater:)]) // Does the delegate want to handle it?
|
||||||
|
{
|
||||||
|
item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:self.updater];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item != nil) // Does the delegate want to handle it?
|
||||||
{
|
{
|
||||||
item = [[self.updater delegate] bestValidUpdateInAppcast:ac forUpdater:self.updater];
|
|
||||||
if ([item isDeltaUpdate]) {
|
if ([item isDeltaUpdate]) {
|
||||||
self.nonDeltaUpdateItem = [[self.updater delegate] bestValidUpdateInAppcast:[ac copyWithoutDeltaUpdates] forUpdater:self.updater];
|
self.nonDeltaUpdateItem = [[updater delegate] bestValidUpdateInAppcast:[ac copyWithoutDeltaUpdates] forUpdater:self.updater];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // If not, we'll take care of it ourselves.
|
else // If not, we'll take care of it ourselves.
|
||||||
{
|
{
|
||||||
// Find the best supported update
|
// Find the best supported update
|
||||||
SUAppcastItem *deltaUpdateItem = nil;
|
SUAppcastItem *deltaUpdateItem = nil;
|
||||||
@@ -184,9 +199,11 @@
|
|||||||
- (void)didFindValidUpdate
|
- (void)didFindValidUpdate
|
||||||
{
|
{
|
||||||
assert(self.updateItem);
|
assert(self.updateItem);
|
||||||
|
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
||||||
[[self.updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
|
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
|
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidFindValidUpdateNotification
|
||||||
@@ -197,8 +214,10 @@
|
|||||||
|
|
||||||
- (void)didNotFindUpdate
|
- (void)didNotFindUpdate
|
||||||
{
|
{
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[[self.updater delegate] updaterDidNotFindUpdate:self.updater];
|
|
||||||
|
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||||
|
[[updater delegate] updaterDidNotFindUpdate:self.updater];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater];
|
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater];
|
||||||
@@ -240,10 +259,12 @@
|
|||||||
[[NSFileManager defaultManager] removeItemAtPath:appCachePath error:NULL];
|
[[NSFileManager defaultManager] removeItemAtPath:appCachePath error:NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
|
||||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self.updateItem fileURL]];
|
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[self.updateItem fileURL]];
|
||||||
[request setValue:[self.updater userAgentString] forHTTPHeaderField:@"User-Agent"];
|
[request setValue:[updater userAgentString] forHTTPHeaderField:@"User-Agent"];
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) {
|
if ([[updater delegate] respondsToSelector:@selector(updater:willDownloadUpdate:withRequest:)]) {
|
||||||
[[self.updater delegate] updater:self.updater
|
[[updater delegate] updater:self.updater
|
||||||
willDownloadUpdate:self.updateItem
|
willDownloadUpdate:self.updateItem
|
||||||
withRequest:request];
|
withRequest:request];
|
||||||
}
|
}
|
||||||
@@ -289,9 +310,11 @@
|
|||||||
if (!failingUrl) {
|
if (!failingUrl) {
|
||||||
failingUrl = [self.updateItem fileURL];
|
failingUrl = [self.updateItem fileURL];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updater:failedToDownloadUpdate:error:)]) {
|
if ([[updater delegate] respondsToSelector:@selector(updater:failedToDownloadUpdate:error:)]) {
|
||||||
[[self.updater delegate] updater:self.updater
|
[[updater delegate] updater:self.updater
|
||||||
failedToDownloadUpdate:self.updateItem
|
failedToDownloadUpdate:self.updateItem
|
||||||
error:error];
|
error:error];
|
||||||
}
|
}
|
||||||
@@ -316,7 +339,8 @@
|
|||||||
|
|
||||||
- (void)extractUpdate
|
- (void)extractUpdate
|
||||||
{
|
{
|
||||||
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath withPassword:self.updater.decryptionPassword];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:self.downloadPath updatingHostBundlePath:self.host.bundlePath decryptionPassword:updater.decryptionPassword];
|
||||||
|
|
||||||
BOOL success;
|
BOOL success;
|
||||||
if (!unarchiver) {
|
if (!unarchiver) {
|
||||||
@@ -333,10 +357,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
[self unarchiverDidFail:nil];
|
NSError *reason = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{NSLocalizedDescriptionKey: @"Failed to extract update."}];
|
||||||
|
[self unarchiverDidFailWithError:reason];
|
||||||
} else {
|
} else {
|
||||||
unarchiver.delegate = self;
|
[unarchiver unarchiveWithCompletionBlock:^(NSError *err){
|
||||||
[unarchiver start];
|
if (err) {
|
||||||
|
[self unarchiverDidFailWithError:err];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[self unarchiverDidFinish:nil];
|
||||||
|
} progressBlock:^(double progress) {
|
||||||
|
[self unarchiver:nil extractedProgress:progress];
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,14 +382,20 @@
|
|||||||
[self downloadUpdate];
|
[self downloadUpdate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)unarchiverDidFinish:(SUUnarchiver *)__unused ua
|
// By default does nothing, can be overridden
|
||||||
|
- (void)unarchiver:(id)__unused ua extractedProgress:(double)__unused progress
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note this method can be overridden (and is)
|
||||||
|
- (void)unarchiverDidFinish:(id)__unused ua
|
||||||
{
|
{
|
||||||
assert(self.updateItem);
|
assert(self.updateItem);
|
||||||
|
|
||||||
[self installWithToolAndRelaunch:YES];
|
[self installWithToolAndRelaunch:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)unarchiverDidFail:(SUUnarchiver *)__unused ua
|
- (void)unarchiverDidFailWithError:(NSError *)err
|
||||||
{
|
{
|
||||||
// No longer needed
|
// No longer needed
|
||||||
self.updateValidator = nil;
|
self.updateValidator = nil;
|
||||||
@@ -365,8 +404,8 @@
|
|||||||
[self failedToApplyDeltaUpdate];
|
[self failedToApplyDeltaUpdate];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey: SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) }]];
|
[self abortUpdateWithError:err];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch
|
- (void)installWithToolAndRelaunch:(BOOL)relaunch
|
||||||
@@ -400,6 +439,12 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)mayUpdateAndRestart
|
||||||
|
{
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
return (!updater.delegate || ![updater.delegate respondsToSelector:@selector(updaterShouldRelaunchApplication:)] || [updater.delegate updaterShouldRelaunchApplication:self.updater]);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI
|
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI
|
||||||
{
|
{
|
||||||
assert(self.updateItem);
|
assert(self.updateItem);
|
||||||
@@ -415,15 +460,16 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (![self.updater mayUpdateAndRestart])
|
if (![self mayUpdateAndRestart])
|
||||||
{
|
{
|
||||||
[self abortUpdate];
|
[self abortUpdate];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Give the host app an opportunity to postpone the install and relaunch.
|
// Give the host app an opportunity to postpone the install and relaunch.
|
||||||
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
static BOOL postponedOnce = NO;
|
static BOOL postponedOnce = NO;
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if (!postponedOnce && [updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
if (!postponedOnce && [updaterDelegate respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
||||||
{
|
{
|
||||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
|
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
|
||||||
@@ -441,7 +487,7 @@
|
|||||||
[updaterDelegate updater:self.updater willInstallUpdate:self.updateItem];
|
[updaterDelegate updater:self.updater willInstallUpdate:self.updateItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSBundle *sparkleBundle = self.updater.sparkleBundle;
|
NSBundle *sparkleBundle = updater.sparkleBundle;
|
||||||
|
|
||||||
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
||||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||||
@@ -499,7 +545,10 @@
|
|||||||
|
|
||||||
NSString *pathToRelaunch = [self.host bundlePath];
|
NSString *pathToRelaunch = [self.host bundlePath];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(pathToRelaunchForUpdater:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(pathToRelaunchForUpdater:)]) {
|
||||||
pathToRelaunch = [updaterDelegate pathToRelaunchForUpdater:self.updater];
|
NSString *delegateRelaunchPath = [updaterDelegate pathToRelaunchForUpdater:self.updater];
|
||||||
|
if (delegateRelaunchPath != nil) {
|
||||||
|
pathToRelaunch = delegateRelaunchPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
|
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
|
||||||
@@ -566,7 +615,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Notify host app that update has aborted
|
// Notify host app that update has aborted
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+3
-1
@@ -9,7 +9,9 @@
|
|||||||
#ifndef SUBINARYDELTAAPPLY_H
|
#ifndef SUBINARYDELTAAPPLY_H
|
||||||
#define SUBINARYDELTAAPPLY_H
|
#define SUBINARYDELTAAPPLY_H
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@class NSString;
|
@class NSString;
|
||||||
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, NSError * __autoreleasing *error);
|
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, void (^progressCallback)(double), NSError * __autoreleasing *error);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+16
-1
@@ -25,7 +25,7 @@ static BOOL applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFil
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, NSError * __autoreleasing *error)
|
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, void (^progressCallback)(double progress), NSError * __autoreleasing *error)
|
||||||
{
|
{
|
||||||
xar_t x = xar_open([patchFile fileSystemRepresentation], READ);
|
xar_t x = xar_open([patchFile fileSystemRepresentation], READ);
|
||||||
if (!x) {
|
if (!x) {
|
||||||
@@ -44,6 +44,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
NSString *expectedNewBeforeHash = nil;
|
NSString *expectedNewBeforeHash = nil;
|
||||||
NSString *expectedNewAfterHash = nil;
|
NSString *expectedNewAfterHash = nil;
|
||||||
|
|
||||||
|
progressCallback(0/6.0);
|
||||||
|
|
||||||
xar_subdoc_t subdoc;
|
xar_subdoc_t subdoc;
|
||||||
for (subdoc = xar_subdoc_first(x); subdoc; subdoc = xar_subdoc_next(subdoc)) {
|
for (subdoc = xar_subdoc_first(x); subdoc; subdoc = xar_subdoc_next(subdoc)) {
|
||||||
if (!strcmp(xar_subdoc_name(subdoc), BINARY_DELTA_ATTRIBUTES_KEY)) {
|
if (!strcmp(xar_subdoc_name(subdoc), BINARY_DELTA_ATTRIBUTES_KEY)) {
|
||||||
@@ -112,6 +114,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
fprintf(stderr, "Verifying source...");
|
fprintf(stderr, "Verifying source...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressCallback(1/6.0);
|
||||||
|
|
||||||
NSString *beforeHash = hashOfTreeWithVersion(source, majorDiffVersion);
|
NSString *beforeHash = hashOfTreeWithVersion(source, majorDiffVersion);
|
||||||
if (!beforeHash) {
|
if (!beforeHash) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@@ -137,6 +141,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
fprintf(stderr, "\nCopying files...");
|
fprintf(stderr, "\nCopying files...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressCallback(2/6.0);
|
||||||
|
|
||||||
if (!removeTree(destination)) {
|
if (!removeTree(destination)) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -146,6 +152,9 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressCallback(3/6.0);
|
||||||
|
|
||||||
if (!copyTree(source, destination)) {
|
if (!copyTree(source, destination)) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
@@ -156,6 +165,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressCallback(4/6.0);
|
||||||
|
|
||||||
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
|
BOOL hasExtractKeyAvailable = MAJOR_VERSION_IS_AT_LEAST(majorDiffVersion, SUBeigeMajorVersion);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
@@ -252,6 +263,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
}
|
}
|
||||||
xar_close(x);
|
xar_close(x);
|
||||||
|
|
||||||
|
progressCallback(5/6.0);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
fprintf(stderr, "\nVerifying destination...");
|
fprintf(stderr, "\nVerifying destination...");
|
||||||
}
|
}
|
||||||
@@ -277,6 +290,8 @@ BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFi
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressCallback(6/6.0);
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
fprintf(stderr, "\nDone!\n");
|
fprintf(stderr, "\nDone!\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+8
-4
@@ -96,21 +96,25 @@ static BOOL runCreateCommand(NSString *programName, NSArray *args)
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSString *sourcePath = fileArgs[0];
|
||||||
|
NSString *destPath = fileArgs[1];
|
||||||
|
NSString *patchPath = fileArgs[2];
|
||||||
|
|
||||||
BOOL isDirectory;
|
BOOL isDirectory;
|
||||||
if (![[NSFileManager defaultManager] fileExistsAtPath:fileArgs[0] isDirectory:&isDirectory] || !isDirectory) {
|
if (![[NSFileManager defaultManager] fileExistsAtPath:sourcePath isDirectory:&isDirectory] || !isDirectory) {
|
||||||
printUsage(programName);
|
printUsage(programName);
|
||||||
fprintf(stderr, "Error: before-tree must be a directory\n");
|
fprintf(stderr, "Error: before-tree must be a directory\n");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (![[NSFileManager defaultManager] fileExistsAtPath:fileArgs[1] isDirectory:&isDirectory] || !isDirectory) {
|
if (![[NSFileManager defaultManager] fileExistsAtPath:destPath isDirectory:&isDirectory] || !isDirectory) {
|
||||||
printUsage(programName);
|
printUsage(programName);
|
||||||
fprintf(stderr, "Error: after-tree must be a directory\n");
|
fprintf(stderr, "Error: after-tree must be a directory\n");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSError *createDiffError = nil;
|
NSError *createDiffError = nil;
|
||||||
if (!createBinaryDelta(fileArgs[0], fileArgs[1], fileArgs[2], patchVersion, verbose, &createDiffError)) {
|
if (!createBinaryDelta(sourcePath, destPath, patchPath, patchVersion, verbose, &createDiffError)) {
|
||||||
fprintf(stderr, "%s\n", [createDiffError.localizedDescription UTF8String]);
|
fprintf(stderr, "%s\n", [createDiffError.localizedDescription UTF8String]);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
@@ -158,7 +162,7 @@ static BOOL runApplyCommand(NSString *programName, NSArray *args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSError *applyDiffError = nil;
|
NSError *applyDiffError = nil;
|
||||||
if (!applyBinaryDelta(fileArgs[0], fileArgs[1], fileArgs[2], verbose, &applyDiffError)) {
|
if (!applyBinaryDelta(fileArgs[0], fileArgs[1], fileArgs[2], verbose, ^(__unused double x){}, &applyDiffError)) {
|
||||||
fprintf(stderr, "%s\n", [applyDiffError.localizedDescription UTF8String]);
|
fprintf(stderr, "%s\n", [applyDiffError.localizedDescription UTF8String]);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+9
-3
@@ -9,11 +9,17 @@
|
|||||||
#ifndef SUBINARYDELTAUNARCHIVER_H
|
#ifndef SUBINARYDELTAUNARCHIVER_H
|
||||||
#define SUBINARYDELTAUNARCHIVER_H
|
#define SUBINARYDELTAUNARCHIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "SUUnarchiver.h"
|
#import "SUUnarchiverProtocol.h"
|
||||||
|
|
||||||
@interface SUBinaryDeltaUnarchiver : SUUnarchiver
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
|
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+43
-28
@@ -6,16 +6,25 @@
|
|||||||
// Copyright 2009 Mark Rowe. All rights reserved.
|
// Copyright 2009 Mark Rowe. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUBinaryDeltaCommon.h"
|
|
||||||
#import "SUBinaryDeltaUnarchiver.h"
|
#import "SUBinaryDeltaUnarchiver.h"
|
||||||
|
#import "SUUnarchiverNotifier.h"
|
||||||
|
#import "SUBinaryDeltaCommon.h"
|
||||||
#import "SUBinaryDeltaApply.h"
|
#import "SUBinaryDeltaApply.h"
|
||||||
#import "SUUnarchiver_Private.h"
|
|
||||||
#import "SUFileManager.h"
|
|
||||||
#import "SUHost.h"
|
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUFileManager.h"
|
||||||
|
|
||||||
|
@interface SUBinaryDeltaUnarchiver ()
|
||||||
|
|
||||||
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *updateHostBundlePath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUBinaryDeltaUnarchiver
|
@implementation SUBinaryDeltaUnarchiver
|
||||||
|
|
||||||
|
@synthesize archivePath = _archivePath;
|
||||||
|
@synthesize updateHostBundlePath = _updateHostBundlePath;
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
{
|
{
|
||||||
return [[path pathExtension] isEqualToString:@"delta"];
|
return [[path pathExtension] isEqualToString:@"delta"];
|
||||||
@@ -61,40 +70,46 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applyBinaryDelta
|
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
self = [super init];
|
||||||
NSString *sourcePath = self.updateHostBundlePath;
|
if (self != nil) {
|
||||||
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
_archivePath = [archivePath copy];
|
||||||
|
_updateHostBundlePath = [updateHostBundlePath copy];
|
||||||
NSError *applyDiffError = nil;
|
|
||||||
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, &applyDiffError);
|
|
||||||
if (success) {
|
|
||||||
[[self class] updateSpotlightImportersAtBundlePath:targetPath];
|
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self notifyDelegateOfSuccess];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
SULog(@"Applying delta patch failed with error: %@", applyDiffError);
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self notifyDelegateOfFailure];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)start
|
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
[self applyBinaryDelta];
|
@autoreleasepool {
|
||||||
|
SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock];
|
||||||
|
[self extractDeltaWithNotifier:notifier];
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)load
|
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||||
{
|
{
|
||||||
[self registerImplementation:self];
|
NSString *sourcePath = self.updateHostBundlePath;
|
||||||
|
NSString *targetPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||||
|
|
||||||
|
NSError *applyDiffError = nil;
|
||||||
|
BOOL success = applyBinaryDelta(sourcePath, targetPath, self.archivePath, NO, ^(double progress){
|
||||||
|
[notifier notifyProgress:progress];
|
||||||
|
|
||||||
|
}, &applyDiffError);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
[[self class] updateSpotlightImportersAtBundlePath:targetPath];
|
||||||
|
[notifier notifySuccess];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[notifier notifyFailureWithError:applyDiffError];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.archivePath]; }
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
//
|
||||||
|
// SUBundleIcon.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 7/24/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUBundleIcon : NSObject
|
||||||
|
|
||||||
|
+ (NSURL * _Nullable)iconURLForBundle:(NSBundle *)bundle;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+29
@@ -0,0 +1,29 @@
|
|||||||
|
//
|
||||||
|
// SUBundleIcon.m
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 7/24/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SUBundleIcon.h"
|
||||||
|
|
||||||
|
@implementation SUBundleIcon
|
||||||
|
|
||||||
|
+ (NSURL *)iconURLForBundle:(NSBundle *)bundle
|
||||||
|
{
|
||||||
|
NSString *resource = [bundle objectForInfoDictionaryKey:@"CFBundleIconFile"];
|
||||||
|
if (resource == nil || ![resource isKindOfClass:[NSString class]]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSURL *iconURL = [bundle URLForResource:resource withExtension:@"icns"];
|
||||||
|
|
||||||
|
// The resource could already be containing the path extension, so try again without the extra extension
|
||||||
|
if (iconURL == nil) {
|
||||||
|
iconURL = [bundle URLForResource:resource withExtension:nil];
|
||||||
|
}
|
||||||
|
return iconURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+1
-5
@@ -6,12 +6,8 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
#define DEBUG 0
|
#define DEBUG 0
|
||||||
|
|||||||
Vendored
+9
-3
@@ -9,11 +9,17 @@
|
|||||||
#ifndef SUDISKIMAGEUNARCHIVER_H
|
#ifndef SUDISKIMAGEUNARCHIVER_H
|
||||||
#define SUDISKIMAGEUNARCHIVER_H
|
#define SUDISKIMAGEUNARCHIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "SUUnarchiver.h"
|
#import "SUUnarchiverProtocol.h"
|
||||||
|
|
||||||
@interface SUDiskImageUnarchiver : SUUnarchiver
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
|
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+68
-71
@@ -7,12 +7,21 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUDiskImageUnarchiver.h"
|
#import "SUDiskImageUnarchiver.h"
|
||||||
#import "SUUnarchiver_Private.h"
|
#import "SUUnarchiverNotifier.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
#include <CoreServices/CoreServices.h>
|
|
||||||
|
@interface SUDiskImageUnarchiver ()
|
||||||
|
|
||||||
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
|
@property (nullable, nonatomic, copy, readonly) NSString *decryptionPassword;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUDiskImageUnarchiver
|
@implementation SUDiskImageUnarchiver
|
||||||
|
|
||||||
|
@synthesize archivePath = _archivePath;
|
||||||
|
@synthesize decryptionPassword = _decryptionPassword;
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
{
|
{
|
||||||
return [[path pathExtension] isEqualToString:@"dmg"];
|
return [[path pathExtension] isEqualToString:@"dmg"];
|
||||||
@@ -23,59 +32,58 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called on a non-main thread.
|
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
|
||||||
- (void)extractDMG
|
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
self = [super init];
|
||||||
[self extractDMGWithPassword:nil];
|
if (self != nil) {
|
||||||
|
_archivePath = [archivePath copy];
|
||||||
|
_decryptionPassword = [decryptionPassword copy];
|
||||||
}
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
|
||||||
|
{
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock];
|
||||||
|
[self extractDMGWithNotifier:notifier];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called on a non-main thread.
|
// Called on a non-main thread.
|
||||||
- (void)extractDMGWithPassword:(NSString *)__unused password
|
- (void)extractDMGWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||||
{
|
{
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
BOOL mountedSuccessfully = NO;
|
BOOL mountedSuccessfully = NO;
|
||||||
|
|
||||||
SULog(@"Extracting %@ as a DMG", self.archivePath);
|
|
||||||
|
|
||||||
// get a unique mount point path
|
// get a unique mount point path
|
||||||
NSString *mountPoint = nil;
|
NSString *mountPoint = nil;
|
||||||
FSRef tmpRef;
|
|
||||||
NSFileManager *manager;
|
NSFileManager *manager;
|
||||||
NSError *error;
|
NSError *error;
|
||||||
NSArray *contents;
|
NSArray *contents;
|
||||||
// We have to declare these before a goto to prevent an error under ARC.
|
do
|
||||||
// No, we cannot have them in the dispatch_async calls, as the goto "jump enters
|
|
||||||
// lifetime of block which strongly captures a variable"
|
|
||||||
dispatch_block_t delegateFailure = ^{
|
|
||||||
[self notifyDelegateOfFailure];
|
|
||||||
};
|
|
||||||
dispatch_block_t delegateSuccess = ^{
|
|
||||||
[self notifyDelegateOfSuccess];
|
|
||||||
};
|
|
||||||
do
|
|
||||||
{
|
{
|
||||||
// Using NSUUID would make creating UUIDs be done in Cocoa,
|
// Using NSUUID would make creating UUIDs be done in Cocoa,
|
||||||
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
|
// and thus managed under ARC. Sadly, the class is in 10.8 and later.
|
||||||
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
CFUUIDRef uuid = CFUUIDCreate(NULL);
|
||||||
if (uuid)
|
if (uuid)
|
||||||
{
|
{
|
||||||
NSString *uuidString = CFBridgingRelease(CFUUIDCreateString(NULL, uuid));
|
NSString *uuidString = CFBridgingRelease(CFUUIDCreateString(NULL, uuid));
|
||||||
if (uuidString)
|
if (uuidString)
|
||||||
{
|
{
|
||||||
mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString];
|
mountPoint = [@"/Volumes" stringByAppendingPathComponent:uuidString];
|
||||||
}
|
}
|
||||||
CFRelease(uuid);
|
CFRelease(uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (noErr == FSPathMakeRefWithOptions((const UInt8 *)[mountPoint fileSystemRepresentation], kFSPathMakeRefDoNotFollowLeafSymlink, &tmpRef, NULL));
|
// Note: this check does not follow symbolic links, which is what we want
|
||||||
|
while ([[NSURL fileURLWithPath:mountPoint] checkResourceIsReachableAndReturnError:NULL]);
|
||||||
|
|
||||||
NSData *promptData = nil;
|
NSData *promptData = nil;
|
||||||
promptData = [NSData dataWithBytes:"yes\n" length:4];
|
promptData = [NSData dataWithBytes:"yes\n" length:4];
|
||||||
|
|
||||||
NSMutableArray *arguments = [@[@"attach", self.archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen"] mutableCopy];
|
NSMutableArray *arguments = [@[@"attach", self.archivePath, @"-mountpoint", mountPoint, /*@"-noverify",*/ @"-nobrowse", @"-noautoopen"] mutableCopy];
|
||||||
|
|
||||||
if (self.decryptionPassword) {
|
if (self.decryptionPassword) {
|
||||||
NSMutableData *passwordData = [[self.decryptionPassword dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];
|
NSMutableData *passwordData = [[self.decryptionPassword dataUsingEncoding:NSUTF8StringEncoding] mutableCopy];
|
||||||
// From the hdiutil docs:
|
// From the hdiutil docs:
|
||||||
@@ -85,14 +93,14 @@
|
|||||||
[passwordData appendData:[NSData dataWithBytes:"\0" length:1]];
|
[passwordData appendData:[NSData dataWithBytes:"\0" length:1]];
|
||||||
[passwordData appendData:promptData];
|
[passwordData appendData:promptData];
|
||||||
promptData = passwordData;
|
promptData = passwordData;
|
||||||
|
|
||||||
[arguments addObject:@"-stdinpass"];
|
[arguments addObject:@"-stdinpass"];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSData *output = nil;
|
NSData *output = nil;
|
||||||
NSInteger taskResult = -1;
|
NSInteger taskResult = -1;
|
||||||
@try
|
@try
|
||||||
{
|
{
|
||||||
NSTask *task = [[NSTask alloc] init];
|
NSTask *task = [[NSTask alloc] init];
|
||||||
task.launchPath = @"/usr/bin/hdiutil";
|
task.launchPath = @"/usr/bin/hdiutil";
|
||||||
task.currentDirectoryPath = @"/";
|
task.currentDirectoryPath = @"/";
|
||||||
@@ -106,6 +114,8 @@
|
|||||||
|
|
||||||
[task launch];
|
[task launch];
|
||||||
|
|
||||||
|
[notifier notifyProgress:0.125];
|
||||||
|
|
||||||
[inputPipe.fileHandleForWriting writeData:promptData];
|
[inputPipe.fileHandleForWriting writeData:promptData];
|
||||||
[inputPipe.fileHandleForWriting closeFile];
|
[inputPipe.fileHandleForWriting closeFile];
|
||||||
|
|
||||||
@@ -119,6 +129,8 @@
|
|||||||
{
|
{
|
||||||
goto reportError;
|
goto reportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[notifier notifyProgress:0.5];
|
||||||
|
|
||||||
if (taskResult != 0)
|
if (taskResult != 0)
|
||||||
{
|
{
|
||||||
@@ -127,45 +139,55 @@
|
|||||||
goto reportError;
|
goto reportError;
|
||||||
}
|
}
|
||||||
mountedSuccessfully = YES;
|
mountedSuccessfully = YES;
|
||||||
|
|
||||||
// Now that we've mounted it, we need to copy out its contents.
|
// Now that we've mounted it, we need to copy out its contents.
|
||||||
manager = [[NSFileManager alloc] init];
|
manager = [[NSFileManager alloc] init];
|
||||||
contents = [manager contentsOfDirectoryAtPath:mountPoint error:&error];
|
contents = [manager contentsOfDirectoryAtPath:mountPoint error:&error];
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
SULog(@"Couldn't enumerate contents of archive mounted at %@: %@", mountPoint, error);
|
SULog(@"Couldn't enumerate contents of archive mounted at %@: %@", mountPoint, error);
|
||||||
goto reportError;
|
goto reportError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double itemsCopied = 0;
|
||||||
|
double totalItems = [contents count];
|
||||||
|
|
||||||
for (NSString *item in contents)
|
for (NSString *item in contents)
|
||||||
{
|
{
|
||||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||||
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
NSString *toPath = [[self.archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
||||||
|
|
||||||
// We skip any files in the DMG which are not readable.
|
// We skip any files in the DMG which are not readable.
|
||||||
if (![manager isReadableFileAtPath:fromPath]) {
|
if (![manager isReadableFileAtPath:fromPath]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemsCopied += 1.0;
|
||||||
|
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
|
||||||
SULog(@"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
|
SULog(@"copyItemAtPath:%@ toPath:%@", fromPath, toPath);
|
||||||
|
|
||||||
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
if (![manager copyItemAtPath:fromPath toPath:toPath error:&error])
|
||||||
{
|
{
|
||||||
SULog(@"Couldn't copy item: %@ : %@", error, error.userInfo ? error.userInfo : @"");
|
|
||||||
goto reportError;
|
goto reportError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), delegateSuccess);
|
[notifier notifySuccess];
|
||||||
goto finally;
|
goto finally;
|
||||||
|
|
||||||
reportError:
|
reportError:
|
||||||
dispatch_async(dispatch_get_main_queue(), delegateFailure);
|
[notifier notifyFailureWithError:error];
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
if (mountedSuccessfully) {
|
if (mountedSuccessfully) {
|
||||||
|
NSTask *task = [[NSTask alloc] init];
|
||||||
|
task.launchPath = @"/usr/bin/hdiutil";
|
||||||
|
task.arguments = @[@"detach", mountPoint, @"-force"];
|
||||||
|
task.standardOutput = [NSPipe pipe];
|
||||||
|
task.standardError = [NSPipe pipe];
|
||||||
|
|
||||||
@try {
|
@try {
|
||||||
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/hdiutil" arguments:@[@"detach", mountPoint, @"-force"]];
|
[task launch];
|
||||||
} @catch (NSException *exception) {
|
} @catch (NSException *exception) {
|
||||||
SULog(@"Failed to unmount %@", mountPoint);
|
SULog(@"Failed to unmount %@", mountPoint);
|
||||||
SULog(@"Exception: %@", exception);
|
SULog(@"Exception: %@", exception);
|
||||||
@@ -176,31 +198,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)start
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.archivePath]; }
|
||||||
{
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
||||||
[self extractDMG];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)load
|
|
||||||
{
|
|
||||||
[self registerImplementation:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isEncrypted:(NSData *)resultData
|
|
||||||
{
|
|
||||||
BOOL result = NO;
|
|
||||||
if(resultData)
|
|
||||||
{
|
|
||||||
NSString *data = [[NSString alloc] initWithData:resultData encoding:NSUTF8StringEncoding];
|
|
||||||
|
|
||||||
if ((data != nil) && !NSEqualRanges([data rangeOfString:@"passphrase-count"], NSMakeRange(NSNotFound, 0)))
|
|
||||||
{
|
|
||||||
result = YES;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+16
-12
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class used for performing file operations that may also perform authorization if allowed and if permission is denied when trying to
|
* A class used for performing file operations that may also perform authorization if allowed and if permission is denied when trying to
|
||||||
* perform them normally as the running user. All operations on this class may be used on thread other than the main thread.
|
* perform them normally as the running user. All operations on this class may be used on thread other than the main thread.
|
||||||
@@ -50,7 +52,7 @@
|
|||||||
* When moving an item from a source to a destination, it is desirable to create a temporary intermediate destination on the same volume as the destination to ensure
|
* When moving an item from a source to a destination, it is desirable to create a temporary intermediate destination on the same volume as the destination to ensure
|
||||||
* that the item will be moved, and not copied, from the intermediate point to the final destination. This ensures file atomicity.
|
* that the item will be moved, and not copied, from the intermediate point to the final destination. This ensures file atomicity.
|
||||||
*/
|
*/
|
||||||
- (NSURL *)makeTemporaryDirectoryWithPreferredName:(NSString *)preferredName appropriateForDirectoryURL:(NSURL *)appropriateURL error:(NSError **)error;
|
- (nullable NSURL *)makeTemporaryDirectoryWithPreferredName:(NSString *)preferredName appropriateForDirectoryURL:(NSURL *)appropriateURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a directory at the target URL
|
* Creates a directory at the target URL
|
||||||
@@ -60,7 +62,7 @@
|
|||||||
*
|
*
|
||||||
* This is an atomic operation.
|
* This is an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)makeDirectoryAtURL:(NSURL *)targetURL error:(NSError **)error;
|
- (BOOL)makeDirectoryAtURL:(NSURL *)targetURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves an item from a source to a destination
|
* Moves an item from a source to a destination
|
||||||
@@ -68,11 +70,11 @@
|
|||||||
* @param destinationURL A URL pointing to the destination the item will be moved at. An item must not already exist at this URL.
|
* @param destinationURL A URL pointing to the destination the item will be moved at. An item must not already exist at this URL.
|
||||||
* @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
|
* @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
|
||||||
* @return YES if the item was moved successfully, otherwise NO along with a populated error object
|
* @return YES if the item was moved successfully, otherwise NO along with a populated error object
|
||||||
*
|
*
|
||||||
* If sourceURL and destinationURL reside on the same volume, this operation will be an atomic move operation.
|
* If sourceURL and destinationURL reside on the same volume, this operation will be an atomic move operation.
|
||||||
* Otherwise this will be equivalent to a copy & remove which will be a nonatomic operation.
|
* Otherwise this will be equivalent to a copy & remove which will be a nonatomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)moveItemAtURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL error:(NSError **)error;
|
- (BOOL)moveItemAtURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copies an item from a source to a destination
|
* Copies an item from a source to a destination
|
||||||
@@ -83,7 +85,7 @@
|
|||||||
*
|
*
|
||||||
* This is not an atomic operation.
|
* This is not an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)copyItemAtURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL error:(NSError **)error;
|
- (BOOL)copyItemAtURL:(NSURL *)sourceURL toURL:(NSURL *)destinationURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves an item at a specified URL to the running user's trash directory
|
* Moves an item at a specified URL to the running user's trash directory
|
||||||
@@ -95,10 +97,10 @@
|
|||||||
* This method has to locate the trash directory and uses an intermediate temporary directory before trashing the item.
|
* This method has to locate the trash directory and uses an intermediate temporary directory before trashing the item.
|
||||||
* A copy may have to be done if the url is not on the same volume as the running user's trash directory.
|
* A copy may have to be done if the url is not on the same volume as the running user's trash directory.
|
||||||
* If a failure occurs in the middle of this operation, the item to remove may be lost forever or stuck in a temporary location.
|
* If a failure occurs in the middle of this operation, the item to remove may be lost forever or stuck in a temporary location.
|
||||||
*
|
*
|
||||||
* This is not an atomic operation, nor intended to be a recoverable operation if the worst comes to worst.
|
* This is not an atomic operation, nor intended to be a recoverable operation if the worst comes to worst.
|
||||||
*/
|
*/
|
||||||
- (BOOL)moveItemAtURLToTrash:(NSURL *)url error:(NSError **)error;
|
- (BOOL)moveItemAtURLToTrash:(NSURL *)url error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes an item at a URL
|
* Removes an item at a URL
|
||||||
@@ -108,7 +110,7 @@
|
|||||||
*
|
*
|
||||||
* This is not an atomic operation.
|
* This is not an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)removeItemAtURL:(NSURL *)url error:(NSError **)error;
|
- (BOOL)removeItemAtURL:(NSURL *)url error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the owner and group IDs of an item at a specified target URL to match another URL
|
* Changes the owner and group IDs of an item at a specified target URL to match another URL
|
||||||
@@ -123,7 +125,7 @@
|
|||||||
*
|
*
|
||||||
* This is not an atomic operation.
|
* This is not an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)changeOwnerAndGroupOfItemAtRootURL:(NSURL *)targetURL toMatchURL:(NSURL *)matchURL error:(NSError **)error;
|
- (BOOL)changeOwnerAndGroupOfItemAtRootURL:(NSURL *)targetURL toMatchURL:(NSURL *)matchURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the modification and access time of an item at a specified target URL to the current time
|
* Updates the modification and access time of an item at a specified target URL to the current time
|
||||||
@@ -136,7 +138,7 @@
|
|||||||
*
|
*
|
||||||
* This is not an atomic operation.
|
* This is not an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)updateModificationAndAccessTimeOfItemAtURL:(NSURL *)targetURL error:(NSError **)error;
|
- (BOOL)updateModificationAndAccessTimeOfItemAtURL:(NSURL *)targetURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Releases Apple's quarantine extended attribute from the item at the specified root URL
|
* Releases Apple's quarantine extended attribute from the item at the specified root URL
|
||||||
@@ -154,7 +156,7 @@
|
|||||||
*
|
*
|
||||||
* This is not an atomic operation.
|
* This is not an atomic operation.
|
||||||
*/
|
*/
|
||||||
- (BOOL)releaseItemFromQuarantineAtRootURL:(NSURL *)rootURL error:(NSError **)error;
|
- (BOOL)releaseItemFromQuarantineAtRootURL:(NSURL *)rootURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs an installer package (pkg) in a headless mode using /usr/sbin/installer
|
* Runs an installer package (pkg) in a headless mode using /usr/sbin/installer
|
||||||
@@ -166,6 +168,8 @@
|
|||||||
* an initial authorization prompt if the calling process does not have root privileges. In other words, root privileges are required to use this method, and the file manager instance must have been created by allowing authorization.
|
* an initial authorization prompt if the calling process does not have root privileges. In other words, root privileges are required to use this method, and the file manager instance must have been created by allowing authorization.
|
||||||
* An error can occur if the package is unable to be ran by the installer, or if the installer reports a non-zero exit status code.
|
* An error can occur if the package is unable to be ran by the installer, or if the installer reports a non-zero exit status code.
|
||||||
*/
|
*/
|
||||||
- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError **)error;
|
- (BOOL)executePackageAtURL:(NSURL *)packageURL error:(NSError *_Nullable*_Nullable)error;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+5
@@ -7,9 +7,14 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUFileManager.h"
|
#import "SUFileManager.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
#import "SUOperatingSystem.h"
|
#import "SUOperatingSystem.h"
|
||||||
#import "SUFileOperationConstants.h"
|
#import "SUFileOperationConstants.h"
|
||||||
|
|
||||||
|
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1080
|
||||||
|
#import <AppKit/AppKit.h> // for NSWorkspace
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/xattr.h>
|
#include <sys/xattr.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|||||||
Vendored
+7
-9
@@ -19,17 +19,15 @@ A guided installation can be started by applications other than the application
|
|||||||
- Replace the use of `AuthorizationExecuteWithPrivilegesAndWait`. This method remains because it is well supported and tested. Ideally a helper tool or XPC would be used.
|
- Replace the use of `AuthorizationExecuteWithPrivilegesAndWait`. This method remains because it is well supported and tested. Ideally a helper tool or XPC would be used.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SUGUIDEDPACKAGEINSTALLER_H
|
|
||||||
#define SUGUIDEDPACKAGEINSTALLER_H
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "Sparkle.h"
|
#import "SUInstallerProtocol.h"
|
||||||
#import "SUInstaller.h"
|
|
||||||
|
|
||||||
@interface SUGuidedPackageInstaller : SUInstaller
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUGuidedPackageInstaller : NSObject <SUInstallerProtocol>
|
||||||
|
|
||||||
|
- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath;
|
||||||
|
|
||||||
/*! Perform the guided installation */
|
|
||||||
+ (void)performInstallationToPath:(NSString *)path fromPath:(NSString *)installerGuide host:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)comparator completionHandler:(void (^)(NSError *))completionHandler;
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+36
-16
@@ -9,26 +9,46 @@
|
|||||||
#import "SUGuidedPackageInstaller.h"
|
#import "SUGuidedPackageInstaller.h"
|
||||||
#import "SUFileManager.h"
|
#import "SUFileManager.h"
|
||||||
|
|
||||||
|
@interface SUGuidedPackageInstaller ()
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) NSString *packagePath;
|
||||||
|
@property (nonatomic, readonly, copy) NSString *installationPath;
|
||||||
|
@property (nonatomic, readonly, copy) NSString *fileOperationToolPath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUGuidedPackageInstaller
|
@implementation SUGuidedPackageInstaller
|
||||||
|
|
||||||
+ (void)performInstallationToPath:(NSString *)destinationPath fromPath:(NSString *)packagePath host:(SUHost *)__unused host fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)__unused comparator completionHandler:(void (^)(NSError *))completionHandler
|
@synthesize packagePath = _packagePath;
|
||||||
|
@synthesize installationPath = _installationPath;
|
||||||
|
@synthesize fileOperationToolPath = _fileOperationToolPath;
|
||||||
|
|
||||||
|
- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath
|
||||||
{
|
{
|
||||||
SUParameterAssert(packagePath);
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_packagePath = [packagePath copy];
|
||||||
|
_installationPath = [installationPath copy];
|
||||||
|
_fileOperationToolPath = [fileOperationToolPath copy];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)performInitialInstallation:(NSError * __autoreleasing *)__unused error
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error
|
||||||
|
{
|
||||||
|
SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:self.fileOperationToolPath];
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
return [fileManager executePackageAtURL:[NSURL fileURLWithPath:self.packagePath] error:error];
|
||||||
SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath];
|
}
|
||||||
|
|
||||||
NSError *error = nil;
|
- (BOOL)canInstallSilently
|
||||||
BOOL validInstallation = [fileManager executePackageAtURL:[NSURL fileURLWithPath:packagePath] error:&error];
|
{
|
||||||
|
return YES;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self finishInstallationToPath:destinationPath
|
|
||||||
withResult:validInstallation
|
|
||||||
error:error
|
|
||||||
completionHandler:completionHandler];
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
-17
@@ -6,18 +6,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "SUUpdater.h"
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
|
||||||
typedef struct {
|
|
||||||
NSInteger majorVersion;
|
|
||||||
NSInteger minorVersion;
|
|
||||||
NSInteger patchVersion;
|
|
||||||
} NSOperatingSystemVersion;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@interface SUHost : NSObject
|
@interface SUHost : NSObject
|
||||||
|
|
||||||
@@ -25,17 +13,12 @@ typedef struct {
|
|||||||
|
|
||||||
- (instancetype)initWithBundle:(NSBundle *)aBundle;
|
- (instancetype)initWithBundle:(NSBundle *)aBundle;
|
||||||
@property (readonly, copy) NSString *bundlePath;
|
@property (readonly, copy) NSString *bundlePath;
|
||||||
@property (readonly) BOOL allowsAutomaticUpdates;
|
|
||||||
@property (readonly, copy) NSString *installationPath;
|
|
||||||
@property (readonly, copy) NSString *name;
|
@property (readonly, copy) NSString *name;
|
||||||
@property (readonly, copy) NSString *version;
|
@property (readonly, copy) NSString *version;
|
||||||
@property (readonly, copy) NSString *displayVersion;
|
@property (readonly, copy) NSString *displayVersion;
|
||||||
@property (readonly, copy) NSImage *icon;
|
|
||||||
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
|
@property (getter=isRunningOnReadOnlyVolume, readonly) BOOL runningOnReadOnlyVolume;
|
||||||
@property (getter=isBackgroundApplication, readonly) BOOL backgroundApplication;
|
|
||||||
@property (readonly, copy) NSString *publicDSAKey;
|
@property (readonly, copy) NSString *publicDSAKey;
|
||||||
@property (readonly, nonatomic, copy) NSString *publicDSAKeyFileKey;
|
@property (readonly, nonatomic, copy) NSString *publicDSAKeyFileKey;
|
||||||
@property (readonly, copy) NSArray *systemProfile;
|
|
||||||
|
|
||||||
- (id)objectForInfoDictionaryKey:(NSString *)key;
|
- (id)objectForInfoDictionaryKey:(NSString *)key;
|
||||||
- (BOOL)boolForInfoDictionaryKey:(NSString *)key;
|
- (BOOL)boolForInfoDictionaryKey:(NSString *)key;
|
||||||
|
|||||||
Vendored
+8
-97
@@ -8,16 +8,14 @@
|
|||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
|
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
#import "SUSystemProfiler.h"
|
|
||||||
#include <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
|
#include <sys/mount.h> // For statfs for isRunningOnReadOnlyVolume
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
#import "SUFileManager.h"
|
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
// This class should not rely on AppKit and should also be process independent
|
||||||
@interface NSProcessInfo ()
|
// For example, it should not have code that tests writabilty to somewhere on disk,
|
||||||
- (NSOperatingSystemVersion)operatingSystemVersion;
|
// as that may depend on the privileges of the process owner. Or code that depends on
|
||||||
@end
|
// if the process is sandboxed or not; eg: finding the user's caches directory. Or code that depends
|
||||||
#endif
|
// on compilation flags and if other files exist relative to the host bundle.
|
||||||
|
|
||||||
@interface SUHost ()
|
@interface SUHost ()
|
||||||
|
|
||||||
@@ -37,7 +35,7 @@
|
|||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
SUParameterAssert(aBundle);
|
NSParameterAssert(aBundle);
|
||||||
self.bundle = aBundle;
|
self.bundle = aBundle;
|
||||||
if (![self.bundle bundleIdentifier]) {
|
if (![self.bundle bundleIdentifier]) {
|
||||||
SULog(@"Error: the bundle being updated at %@ has no %@! This will cause preference read/write to not work properly.", self.bundle, kCFBundleIdentifierKey);
|
SULog(@"Error: the bundle being updated at %@ has no %@! This will cause preference read/write to not work properly.", self.bundle, kCFBundleIdentifierKey);
|
||||||
@@ -56,68 +54,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self bundlePath], [self installationPath]]; }
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self bundlePath]]; }
|
||||||
|
|
||||||
- (NSString *)bundlePath
|
- (NSString *)bundlePath
|
||||||
{
|
{
|
||||||
return [self.bundle bundlePath];
|
return [self.bundle bundlePath];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)allowsAutomaticUpdates
|
|
||||||
{
|
|
||||||
// Does the developer want us to disable automatic updates?
|
|
||||||
NSNumber *developerAllowsAutomaticUpdates = [self objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey];
|
|
||||||
if (developerAllowsAutomaticUpdates != nil && !developerAllowsAutomaticUpdates.boolValue) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can we automatically update in the background without bugging the user (e.g, with a administrator password prompt)?
|
|
||||||
// Note it's very well possible to have the bundle be writable but not be able to write into the parent directory
|
|
||||||
// And if the bundle isn't writable, but we can write into the parent directory, we will still need to authorize to replace it
|
|
||||||
NSString *bundlePath = [self bundlePath];
|
|
||||||
if (![[NSFileManager defaultManager] isWritableFileAtPath:bundlePath.stringByDeletingLastPathComponent] || ![[NSFileManager defaultManager] isWritableFileAtPath:bundlePath]) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Just because we have writability access does not mean we can set the correct owner/group silently
|
|
||||||
// Test if we can set the owner/group on a temporarily created file
|
|
||||||
// If we can, then we can probably perform an update without authorization
|
|
||||||
// One place where this matters is if you copy and run an app from /tmp/
|
|
||||||
|
|
||||||
NSString *tempFilename = @"permission_test" ;
|
|
||||||
|
|
||||||
SUFileManager *suFileManager = [SUFileManager defaultManager];
|
|
||||||
NSURL *tempDirectoryURL = [suFileManager makeTemporaryDirectoryWithPreferredName:tempFilename appropriateForDirectoryURL:[NSURL fileURLWithPath:NSTemporaryDirectory()] error:NULL];
|
|
||||||
|
|
||||||
if (tempDirectoryURL == nil) {
|
|
||||||
// I don't imagine this ever happening but in case it does, requesting authorization may be the better option
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
NSURL *tempFileURL = [tempDirectoryURL URLByAppendingPathComponent:tempFilename];
|
|
||||||
|
|
||||||
BOOL changeOwnerAndGroupSuccess =
|
|
||||||
[[NSData data] writeToURL:tempFileURL atomically:NO] &&
|
|
||||||
[suFileManager changeOwnerAndGroupOfItemAtRootURL:tempFileURL toMatchURL:self.bundle.bundleURL error:NULL];
|
|
||||||
|
|
||||||
[suFileManager removeItemAtURL:tempDirectoryURL error:NULL];
|
|
||||||
|
|
||||||
return changeOwnerAndGroupSuccess;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *)installationPath
|
|
||||||
{
|
|
||||||
if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) {
|
|
||||||
// We'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name.
|
|
||||||
NSString *normalizedAppPath = [[[self.bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [self.bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[self.bundle bundlePath] pathExtension]]];
|
|
||||||
|
|
||||||
if (![[NSFileManager defaultManager] fileExistsAtPath:normalizedAppPath]) {
|
|
||||||
return normalizedAppPath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [self.bundle bundlePath];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *__nonnull)name
|
- (NSString *__nonnull)name
|
||||||
{
|
{
|
||||||
NSString *name;
|
NSString *name;
|
||||||
@@ -152,29 +95,6 @@
|
|||||||
return [self version]; // Fall back on the normal version string.
|
return [self version]; // Fall back on the normal version string.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSImage *__nonnull)icon
|
|
||||||
{
|
|
||||||
// Cache the application icon.
|
|
||||||
NSString *iconPath = [self.bundle pathForResource:[self.bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"];
|
|
||||||
// According to the macOS 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 macOS 10.3.9) so we'll also try:
|
|
||||||
if (!iconPath) {
|
|
||||||
iconPath = [self.bundle pathForResource:[self.bundle objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:nil];
|
|
||||||
}
|
|
||||||
NSImage *icon = [[NSImage alloc] initWithContentsOfFile:iconPath];
|
|
||||||
// Use a default icon if none is defined.
|
|
||||||
if (!icon) {
|
|
||||||
BOOL isMainBundle = (self.bundle == [NSBundle mainBundle]);
|
|
||||||
|
|
||||||
NSString *fileType = isMainBundle ? (__bridge NSString *)kUTTypeApplication : (__bridge NSString *)kUTTypeBundle;
|
|
||||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileType];
|
|
||||||
}
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isRunningOnReadOnlyVolume
|
- (BOOL)isRunningOnReadOnlyVolume
|
||||||
{
|
{
|
||||||
struct statfs statfs_info;
|
struct statfs statfs_info;
|
||||||
@@ -182,11 +102,6 @@
|
|||||||
return (statfs_info.f_flags & MNT_RDONLY) != 0;
|
return (statfs_info.f_flags & MNT_RDONLY) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)isBackgroundApplication
|
|
||||||
{
|
|
||||||
return ([[NSApplication sharedApplication] activationPolicy] == NSApplicationActivationPolicyAccessory);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSString *__nullable)publicDSAKey
|
- (NSString *__nullable)publicDSAKey
|
||||||
{
|
{
|
||||||
// Maybe the key is just a string in the Info.plist.
|
// Maybe the key is just a string in the Info.plist.
|
||||||
@@ -213,11 +128,6 @@
|
|||||||
return [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
|
return [self objectForInfoDictionaryKey:SUPublicDSAKeyFileKey];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSArray *)systemProfile
|
|
||||||
{
|
|
||||||
return [[SUSystemProfiler sharedSystemProfiler] systemProfileArrayForHost:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)objectForInfoDictionaryKey:(NSString *)key
|
- (id)objectForInfoDictionaryKey:(NSString *)key
|
||||||
{
|
{
|
||||||
return [self.bundle objectForInfoDictionaryKey:key];
|
return [self.bundle objectForInfoDictionaryKey:key];
|
||||||
@@ -245,6 +155,7 @@
|
|||||||
return CFBridgingRelease(obj);
|
return CFBridgingRelease(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note this handles nil being passed for defaultName, in which case the user default will be removed
|
||||||
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName
|
- (void)setObject:(id)value forUserDefaultsKey:(NSString *)defaultName
|
||||||
{
|
{
|
||||||
if (self.usesStandardUserDefaults)
|
if (self.usesStandardUserDefaults)
|
||||||
|
|||||||
Vendored
+10
-8
@@ -6,19 +6,21 @@
|
|||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef SUINSTALLER_H
|
#import <Foundation/Foundation.h>
|
||||||
#define SUINSTALLER_H
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
#import "SUVersionComparisonProtocol.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class SUHost;
|
@class SUHost;
|
||||||
|
|
||||||
|
@protocol SUInstallerProtocol;
|
||||||
|
|
||||||
@interface SUInstaller : NSObject
|
@interface SUInstaller : NSObject
|
||||||
|
|
||||||
+ (NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr;
|
+ (nullable id<SUInstallerProtocol>)installerForHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath updateDirectory:(NSString *)updateDirectory error:(NSError **)error;
|
||||||
+ (void)installFromUpdateFolder:(NSString *)inUpdateFolder overHost:(SUHost *)host installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)comparator completionHandler:(void (^)(NSError *))completionHandler;
|
|
||||||
+ (void)finishInstallationToPath:(NSString *)installationPath withResult:(BOOL)result error:(NSError *)error completionHandler:(void (^)(NSError *))completionHandler;
|
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(nullable BOOL *)isGuidedPtr;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+43
-29
@@ -7,12 +7,13 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUInstaller.h"
|
#import "SUInstaller.h"
|
||||||
|
#import "SUInstallerProtocol.h"
|
||||||
#import "SUPlainInstaller.h"
|
#import "SUPlainInstaller.h"
|
||||||
#import "SUPackageInstaller.h"
|
#import "SUPackageInstaller.h"
|
||||||
#import "SUGuidedPackageInstaller.h"
|
#import "SUGuidedPackageInstaller.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUConstants.h"
|
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
@implementation SUInstaller
|
@implementation SUInstaller
|
||||||
|
|
||||||
@@ -25,10 +26,10 @@
|
|||||||
return aliasFlag.boolValue && directoryFlag.boolValue;
|
return aliasFlag.boolValue && directoryFlag.boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
|
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host isPackage:(BOOL *)isPackagePtr isGuided:(nullable BOOL *)isGuidedPtr
|
||||||
{
|
{
|
||||||
SUParameterAssert(inUpdateFolder);
|
NSParameterAssert(inUpdateFolder);
|
||||||
SUParameterAssert(host);
|
NSParameterAssert(host);
|
||||||
|
|
||||||
// Search subdirectories for the application
|
// Search subdirectories for the application
|
||||||
NSString *currentFile,
|
NSString *currentFile,
|
||||||
@@ -103,39 +104,52 @@
|
|||||||
return newAppDownloadPath;
|
return newAppDownloadPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)installFromUpdateFolder:(NSString *)inUpdateFolder overHost:(SUHost *)host installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)comparator completionHandler:(void (^)(NSError *))completionHandler
|
+ (nullable id<SUInstallerProtocol>)installerForHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath updateDirectory:(NSString *)updateDirectory error:(NSError * __autoreleasing *)error
|
||||||
{
|
{
|
||||||
BOOL isPackage = NO;
|
BOOL isPackage = NO;
|
||||||
BOOL isGuided = NO;
|
BOOL isGuided = NO;
|
||||||
NSString *newAppDownloadPath = [self installSourcePathInUpdateFolder:inUpdateFolder forHost:host isPackage:&isPackage isGuided:&isGuided];
|
NSString *newDownloadPath = [self installSourcePathInUpdateFolder:updateDirectory forHost:host isPackage:&isPackage isGuided:&isGuided];
|
||||||
|
|
||||||
if (newAppDownloadPath == nil) {
|
if (newDownloadPath == nil) {
|
||||||
[self finishInstallationToPath:installationPath withResult:NO error:[NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:@{ NSLocalizedDescriptionKey: @"Couldn't find an appropriate update in the downloaded package." }] completionHandler:completionHandler];
|
if (error != NULL) {
|
||||||
} else {
|
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingUpdateError userInfo:@{ NSLocalizedDescriptionKey: @"Couldn't find an appropriate update in the downloaded package." }];
|
||||||
if (isPackage && isGuided) {
|
|
||||||
[SUGuidedPackageInstaller performInstallationToPath:installationPath fromPath:newAppDownloadPath host:host fileOperationToolPath:fileOperationToolPath versionComparator:comparator completionHandler:completionHandler];
|
|
||||||
} else if (isPackage) {
|
|
||||||
[SUPackageInstaller performInstallationToPath:installationPath fromPath:newAppDownloadPath host:host fileOperationToolPath:fileOperationToolPath versionComparator:comparator completionHandler:completionHandler];
|
|
||||||
} else {
|
|
||||||
[SUPlainInstaller performInstallationToPath:installationPath fromPath:newAppDownloadPath host:host fileOperationToolPath:fileOperationToolPath versionComparator:comparator completionHandler:completionHandler];
|
|
||||||
}
|
}
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
id <SUInstallerProtocol> installer;
|
||||||
|
if (isPackage && isGuided) {
|
||||||
|
installer = [[SUGuidedPackageInstaller alloc] initWithPackagePath:newDownloadPath installationPath:host.bundlePath fileOperationToolPath:fileOperationToolPath];
|
||||||
|
} else if (isPackage) {
|
||||||
|
installer = [[SUPackageInstaller alloc] initWithPackagePath:newDownloadPath installationPath:host.bundlePath];
|
||||||
|
} else {
|
||||||
|
NSString *normalizedInstallationPath = nil;
|
||||||
|
if (SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) {
|
||||||
|
normalizedInstallationPath = [self normalizedInstallationPathForHost:host];
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we have a normalized path, we'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name.
|
||||||
|
// Otherwise if there's no normalized path (the more likely case), we'll just use the host bundle's path
|
||||||
|
NSString *installationPath;
|
||||||
|
if (normalizedInstallationPath != nil && ![[NSFileManager defaultManager] fileExistsAtPath:normalizedInstallationPath]) {
|
||||||
|
installationPath = normalizedInstallationPath;
|
||||||
|
} else {
|
||||||
|
installationPath = host.bundlePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
installer = [[SUPlainInstaller alloc] initWithHost:host bundlePath:newDownloadPath installationPath:installationPath fileOperationToolPath:fileOperationToolPath];
|
||||||
|
}
|
||||||
|
return installer;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)finishInstallationToPath:(NSString *)__unused installationPath withResult:(BOOL)result error:(NSError *)error completionHandler:(void (^)(NSError *))completionHandler
|
+ (NSString *)normalizedInstallationPathForHost:(SUHost *)host
|
||||||
{
|
{
|
||||||
if (result) {
|
NSBundle *bundle = host.bundle;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
assert(bundle != nil);
|
||||||
completionHandler(nil);
|
|
||||||
});
|
NSString *normalizedAppPath = [[[bundle bundlePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", [bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey], [[bundle bundlePath] pathExtension]]];
|
||||||
} else {
|
|
||||||
if (!error) {
|
return normalizedAppPath;
|
||||||
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:nil];
|
|
||||||
}
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
completionHandler(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+36
@@ -0,0 +1,36 @@
|
|||||||
|
//
|
||||||
|
// SUInstallerProtocol.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/26/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol SUInstallerProtocol <NSObject>
|
||||||
|
|
||||||
|
// Any installation work can be done prior to user application being terminated and relaunched
|
||||||
|
// Currently this is invoked after the user application is terminated, but this may change in the future.
|
||||||
|
// No UI should occur during this stage (i.e, do not show package installer apps, etc..)
|
||||||
|
// Should be able to be called from non-main thread
|
||||||
|
- (BOOL)performInitialInstallation:(NSError **)error;
|
||||||
|
|
||||||
|
// Any installation work after the user application has been terminated. This is where the final installation work can be done.
|
||||||
|
// After this stage is done, the user application may be relaunched.
|
||||||
|
// Should be able to be called from non-main thread
|
||||||
|
- (BOOL)performFinalInstallation:(NSError **)error;
|
||||||
|
|
||||||
|
// Indicates whether or not this installer can install the update silently in the background, without hindering the user
|
||||||
|
// Should be thread safe
|
||||||
|
- (BOOL)canInstallSilently;
|
||||||
|
|
||||||
|
// The destination and installation path of the bundle being updated
|
||||||
|
// Should be thread safe
|
||||||
|
- (NSString *)installationPath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+16
@@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// SULocalizations.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 2/28/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef SULocalizations_h
|
||||||
|
#define SULocalizations_h
|
||||||
|
|
||||||
|
#import "SUConstants.h"
|
||||||
|
|
||||||
|
#define SULocalizedString(key, comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", (NSBundle * _Nonnull)([NSBundle bundleWithIdentifier:SUBundleIdentifier] ? [NSBundle bundleWithIdentifier:SUBundleIdentifier] : [NSBundle mainBundle]), comment)
|
||||||
|
|
||||||
|
#endif /* SULocalizations_h */
|
||||||
Vendored
+8
@@ -7,6 +7,14 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
||||||
|
typedef struct {
|
||||||
|
NSInteger majorVersion;
|
||||||
|
NSInteger minorVersion;
|
||||||
|
NSInteger patchVersion;
|
||||||
|
} NSOperatingSystemVersion;
|
||||||
|
#endif
|
||||||
|
|
||||||
@interface SUOperatingSystem : NSObject
|
@interface SUOperatingSystem : NSObject
|
||||||
|
|
||||||
+ (NSOperatingSystemVersion)operatingSystemVersion;
|
+ (NSOperatingSystemVersion)operatingSystemVersion;
|
||||||
|
|||||||
Vendored
+6
@@ -7,6 +7,12 @@
|
|||||||
|
|
||||||
#import "SUOperatingSystem.h"
|
#import "SUOperatingSystem.h"
|
||||||
|
|
||||||
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
||||||
|
@interface NSProcessInfo ()
|
||||||
|
- (NSOperatingSystemVersion)operatingSystemVersion;
|
||||||
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
@implementation SUOperatingSystem
|
@implementation SUOperatingSystem
|
||||||
|
|
||||||
+ (NSOperatingSystemVersion)operatingSystemVersion
|
+ (NSOperatingSystemVersion)operatingSystemVersion
|
||||||
|
|||||||
Vendored
+6
-10
@@ -6,19 +6,15 @@
|
|||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef SUPACKAGEINSTALLER_H
|
|
||||||
#define SUPACKAGEINSTALLER_H
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "SUInstallerProtocol.h"
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
@interface SUPackageInstaller : NSObject <SUInstallerProtocol>
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath;
|
||||||
#import "SUPlainInstaller.h"
|
|
||||||
|
|
||||||
@interface SUPackageInstaller : SUPlainInstaller
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+55
-18
@@ -7,35 +7,72 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUPackageInstaller.h"
|
#import "SUPackageInstaller.h"
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
#import "SULog.h"
|
||||||
|
|
||||||
|
@interface SUPackageInstaller ()
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) NSString *packagePath;
|
||||||
|
@property (nonatomic, readonly, copy) NSString *installationPath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUPackageInstaller
|
@implementation SUPackageInstaller
|
||||||
|
|
||||||
+ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)__unused host fileOperationToolPath:(NSString *)__unused fileOperationToolPath versionComparator:(id<SUVersionComparison>)__unused comparator completionHandler:(void (^)(NSError *))completionHandler
|
static NSString *SUOpenUtilityPath = @"/usr/bin/open";
|
||||||
|
|
||||||
|
@synthesize packagePath = _packagePath;
|
||||||
|
@synthesize installationPath = _installationPath;
|
||||||
|
|
||||||
|
- (instancetype)initWithPackagePath:(NSString *)packagePath installationPath:(NSString *)installationPath
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_packagePath = [packagePath copy];
|
||||||
|
_installationPath = [installationPath copy];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)performInitialInstallation:(NSError * __autoreleasing *)error
|
||||||
|
{
|
||||||
|
if (![[NSFileManager defaultManager] fileExistsAtPath:SUOpenUtilityPath]) {
|
||||||
|
if (error != NULL) {
|
||||||
|
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:@{ NSLocalizedDescriptionKey: @"Couldn't find Apple's installer tool!" }];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error
|
||||||
{
|
{
|
||||||
// Run installer using the "open" command to ensure it is launched in front of current application.
|
// Run installer using the "open" command to ensure it is launched in front of current application.
|
||||||
// -W = wait until the app has quit.
|
// -W = wait until the app has quit.
|
||||||
// -n = Open another instance if already open.
|
// -n = Open another instance if already open.
|
||||||
// -b = app bundle identifier
|
// -b = app bundle identifier
|
||||||
NSString *command = @"/usr/bin/open";
|
NSArray *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", self.packagePath];
|
||||||
NSArray *args = @[@"-W", @"-n", @"-b", @"com.apple.installer", path];
|
|
||||||
|
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
||||||
if (![[NSFileManager defaultManager] fileExistsAtPath:command]) {
|
@try {
|
||||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUMissingInstallerToolError userInfo:@{ NSLocalizedDescriptionKey: @"Couldn't find Apple's installer tool!" }];
|
NSTask *installer = [NSTask launchedTaskWithLaunchPath:SUOpenUtilityPath arguments:args];
|
||||||
[self finishInstallationToPath:installationPath withResult:NO error:error completionHandler:completionHandler];
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
||||||
NSTask *installer = [NSTask launchedTaskWithLaunchPath:command arguments:args];
|
|
||||||
[installer waitUntilExit];
|
[installer waitUntilExit];
|
||||||
|
}
|
||||||
|
@catch (NSException *exception) {
|
||||||
|
SULog(@"Error: Failed to launch package installer: %@", exception);
|
||||||
|
if (error != NULL) {
|
||||||
|
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{ NSLocalizedDescriptionKey: @"Package installer failed to launch." }];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
// Known bug: if the installation fails or is canceled, Sparkle goes ahead and restarts, thinking everything is fine.
|
- (BOOL)canInstallSilently
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
{
|
||||||
[self finishInstallationToPath:installationPath withResult:YES error:nil completionHandler:completionHandler];
|
return NO;
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+9
-3
@@ -9,11 +9,17 @@
|
|||||||
#ifndef SUPIPEDUNARCHIVER_H
|
#ifndef SUPIPEDUNARCHIVER_H
|
||||||
#define SUPIPEDUNARCHIVER_H
|
#define SUPIPEDUNARCHIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "SUUnarchiver.h"
|
#import "SUUnarchiverProtocol.h"
|
||||||
|
|
||||||
@interface SUPipedUnarchiver : SUUnarchiver
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||||
|
|
||||||
|
- (instancetype)initWithArchivePath:(NSString *)archivePath;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+71
-86
@@ -7,38 +7,52 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUPipedUnarchiver.h"
|
#import "SUPipedUnarchiver.h"
|
||||||
#import "SUUnarchiver_Private.h"
|
#import "SUUnarchiverNotifier.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
|
@interface SUPipedUnarchiver ()
|
||||||
|
|
||||||
|
@property (nonatomic, copy, readonly) NSString *archivePath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUPipedUnarchiver
|
@implementation SUPipedUnarchiver
|
||||||
|
|
||||||
+ (SEL)selectorConformingToTypeOfPath:(NSString *)path
|
@synthesize archivePath = _archivePath;
|
||||||
|
|
||||||
|
+ (nullable NSArray <NSString *> *)commandAndArgumentsConformingToTypeOfPath:(NSString *)path
|
||||||
{
|
{
|
||||||
static NSDictionary *typeSelectorDictionary;
|
NSArray <NSString *> *extractTGZ = @[@"/usr/bin/tar", @"-zxC"];
|
||||||
if (!typeSelectorDictionary)
|
NSArray <NSString *> *extractTBZ = @[@"/usr/bin/tar", @"-jxC"];
|
||||||
typeSelectorDictionary = @{ @".zip": @"extractZIP",
|
NSArray <NSString *> *extractTXZ = extractTGZ;
|
||||||
@".tar": @"extractTAR",
|
|
||||||
@".tar.gz": @"extractTGZ",
|
NSDictionary <NSString *, NSArray<NSString *> *> *extractCommandDictionary =
|
||||||
@".tgz": @"extractTGZ",
|
@{
|
||||||
@".tar.bz2": @"extractTBZ",
|
@".zip" : @[@"/usr/bin/ditto", @"-x",@"-k",@"-"],
|
||||||
@".tbz": @"extractTBZ",
|
@".tar" : @[@"/usr/bin/tar", @"-xC"],
|
||||||
@".tar.xz": @"extractTXZ",
|
@".tar.gz" : extractTGZ,
|
||||||
@".txz": @"extractTXZ",
|
@".tgz" : extractTGZ,
|
||||||
@".tar.lzma": @"extractTXZ"};
|
@".tar.bz2" : extractTBZ,
|
||||||
|
@".tbz" : extractTBZ,
|
||||||
|
@".tar.xz" : extractTXZ,
|
||||||
|
@".txz" : extractTXZ,
|
||||||
|
@".tar.lzma" : extractTXZ
|
||||||
|
};
|
||||||
|
|
||||||
NSString *lastPathComponent = [path lastPathComponent];
|
NSString *lastPathComponent = [path lastPathComponent];
|
||||||
for (NSString *currentType in typeSelectorDictionary)
|
for (NSString *currentType in extractCommandDictionary)
|
||||||
{
|
{
|
||||||
NSString *value = [typeSelectorDictionary objectForKey:currentType];
|
if ([lastPathComponent hasSuffix:currentType]) {
|
||||||
assert(value);
|
return [extractCommandDictionary objectForKey:currentType];
|
||||||
|
|
||||||
if ([currentType length] > [lastPathComponent length]) continue;
|
|
||||||
if ([[lastPathComponent substringFromIndex:[lastPathComponent length] - [currentType length]] isEqualToString:currentType]) {
|
|
||||||
return NSSelectorFromString(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||||
|
{
|
||||||
|
return ([self commandAndArgumentsConformingToTypeOfPath:path] != nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)unsafeIfArchiveIsNotValidated
|
+ (BOOL)unsafeIfArchiveIsNotValidated
|
||||||
@@ -46,35 +60,50 @@
|
|||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)start
|
- (instancetype)initWithArchivePath:(NSString *)archivePath
|
||||||
{
|
{
|
||||||
[NSThread detachNewThreadSelector:[[self class] selectorConformingToTypeOfPath:self.archivePath] toTarget:self withObject:nil];
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_archivePath = [archivePath copy];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
|
||||||
{
|
{
|
||||||
return ([self selectorConformingToTypeOfPath:path] != nil);
|
NSArray <NSString *> *commandAndArguments = [[self class] commandAndArgumentsConformingToTypeOfPath:self.archivePath];
|
||||||
|
assert(commandAndArguments != nil);
|
||||||
|
|
||||||
|
NSString *command = commandAndArguments.firstObject;
|
||||||
|
assert(command != nil);
|
||||||
|
|
||||||
|
NSArray <NSString *> *arguments = [commandAndArguments subarrayWithRange:NSMakeRange(1, commandAndArguments.count - 1)];
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
SUUnarchiverNotifier *notifier = [[SUUnarchiverNotifier alloc] initWithCompletionBlock:completionBlock progressBlock:progressBlock];
|
||||||
|
[self extractArchivePipingDataToCommand:command arguments:arguments notifier:notifier];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method abstracts the types that use a command line tool piping data from stdin.
|
// This method abstracts the types that use a command line tool piping data from stdin.
|
||||||
- (void)extractArchivePipingDataToCommand:(NSString *)command args:(NSArray*)args
|
- (void)extractArchivePipingDataToCommand:(NSString *)command arguments:(NSArray*)args notifier:(SUUnarchiverNotifier *)notifier
|
||||||
{
|
{
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
|
NSError *error = nil;
|
||||||
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
|
NSString *destination = [self.archivePath stringByDeletingLastPathComponent];
|
||||||
|
|
||||||
SULog(@"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
|
SULog(@"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], self.archivePath, destination);
|
||||||
|
|
||||||
// Get the file size.
|
// Get the file size.
|
||||||
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.archivePath error:nil];
|
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.archivePath error:nil];
|
||||||
NSUInteger expectedLength = [[attributes objectForKey:NSFileSize] unsignedIntegerValue];
|
NSUInteger expectedLength = [[attributes objectForKey:NSFileSize] unsignedIntegerValue];
|
||||||
if (expectedLength > 0) {
|
if (expectedLength > 0) {
|
||||||
NSFileHandle *archiveInput = [NSFileHandle fileHandleForReadingAtPath:self.archivePath];
|
NSFileHandle *archiveInput = [NSFileHandle fileHandleForReadingAtPath:self.archivePath];
|
||||||
|
|
||||||
NSPipe *pipe = [NSPipe pipe];
|
NSPipe *pipe = [NSPipe pipe];
|
||||||
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
|
NSFileHandle *archiveOutput = [pipe fileHandleForWriting];
|
||||||
|
|
||||||
NSTask *task = [[NSTask alloc] init];
|
NSTask *task = [[NSTask alloc] init];
|
||||||
[task setStandardInput:[pipe fileHandleForReading]];
|
[task setStandardInput:[pipe fileHandleForReading]];
|
||||||
[task setStandardError:[NSFileHandle fileHandleWithStandardError]];
|
[task setStandardError:[NSFileHandle fileHandleWithStandardError]];
|
||||||
@@ -82,7 +111,7 @@
|
|||||||
[task setLaunchPath:command];
|
[task setLaunchPath:command];
|
||||||
[task setArguments:[args arrayByAddingObject:destination]];
|
[task setArguments:[args arrayByAddingObject:destination]];
|
||||||
[task launch];
|
[task launch];
|
||||||
|
|
||||||
NSUInteger bytesRead = 0;
|
NSUInteger bytesRead = 0;
|
||||||
do {
|
do {
|
||||||
NSData *data = [archiveInput readDataOfLength:256*1024];
|
NSData *data = [archiveInput readDataOfLength:256*1024];
|
||||||
@@ -92,76 +121,32 @@
|
|||||||
}
|
}
|
||||||
bytesRead += len;
|
bytesRead += len;
|
||||||
[archiveOutput writeData:data];
|
[archiveOutput writeData:data];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
[notifier notifyProgress:(double)bytesRead / (double)expectedLength];
|
||||||
[self notifyDelegateOfProgress:(double)bytesRead / (double)expectedLength];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
while(bytesRead < expectedLength);
|
while(bytesRead < expectedLength);
|
||||||
|
|
||||||
[archiveOutput closeFile];
|
[archiveOutput closeFile];
|
||||||
|
|
||||||
[task waitUntilExit];
|
[task waitUntilExit];
|
||||||
|
|
||||||
if ([task terminationStatus] == 0) {
|
if ([task terminationStatus] == 0) {
|
||||||
if (bytesRead == expectedLength) {
|
if (bytesRead == expectedLength) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
[notifier notifySuccess];
|
||||||
[self notifyDelegateOfSuccess];
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
SULog(@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength);
|
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes", command, (long)bytesRead, (long)expectedLength]}];
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SULog(@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]);
|
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, command '%@' returned %d", command, [task terminationStatus]]}];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
SULog(@"Extraction failed, archive '%@' is empty", self.archivePath);
|
error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Extraction failed, archive '%@' is empty", self.archivePath]}];
|
||||||
}
|
}
|
||||||
|
[notifier notifyFailureWithError:error];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self notifyDelegateOfFailure];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)extractTAR
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.archivePath]; }
|
||||||
{
|
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
|
||||||
|
|
||||||
[self extractArchivePipingDataToCommand:@"/usr/bin/tar" args:@[@"-xC"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)extractTGZ
|
|
||||||
{
|
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
|
||||||
|
|
||||||
[self extractArchivePipingDataToCommand:@"/usr/bin/tar" args:@[@"-zxC"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)extractTBZ
|
|
||||||
{
|
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
|
||||||
|
|
||||||
[self extractArchivePipingDataToCommand:@"/usr/bin/tar" args:@[@"-jxC"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)extractZIP
|
|
||||||
{
|
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
|
||||||
|
|
||||||
[self extractArchivePipingDataToCommand:@"/usr/bin/ditto" args:@[@"-x",@"-k",@"-"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)extractTXZ
|
|
||||||
{
|
|
||||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
|
||||||
|
|
||||||
[self extractArchivePipingDataToCommand:@"/usr/bin/tar" args:@[@"-zxC"]];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (void)load
|
|
||||||
{
|
|
||||||
[self registerImplementation:self];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+11
-13
@@ -6,25 +6,23 @@
|
|||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef SUPLAININSTALLER_H
|
|
||||||
#define SUPLAININSTALLER_H
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "SUInstallerProtocol.h"
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUInstaller.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
|
|
||||||
@class SUHost;
|
@class SUHost;
|
||||||
|
|
||||||
@interface SUPlainInstaller : SUInstaller
|
@interface SUPlainInstaller : NSObject <SUInstallerProtocol>
|
||||||
|
|
||||||
+ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)comparator completionHandler:(void (^)(NSError *))completionHandler;
|
/*!
|
||||||
|
@param host The current (old) bundle host
|
||||||
|
@param bundlePath The path to the new bundle that will be installed.
|
||||||
|
@param installationPath The path the new bundlePath will be installed to.
|
||||||
|
@param fileOperationToolPath The path to the file operation tool for authorized operations.
|
||||||
|
*/
|
||||||
|
- (instancetype)initWithHost:(SUHost *)host bundlePath:(NSString *)bundlePath installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+58
-22
@@ -7,16 +7,43 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUPlainInstaller.h"
|
#import "SUPlainInstaller.h"
|
||||||
|
#import "SUVersionComparisonProtocol.h"
|
||||||
|
#import "SUStandardVersionComparator.h"
|
||||||
#import "SUFileManager.h"
|
#import "SUFileManager.h"
|
||||||
#import "SUCodeSigningVerifier.h"
|
|
||||||
#import "SUConstants.h"
|
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
|
@interface SUPlainInstaller ()
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) SUHost *host;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *bundlePath;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *installationPath;
|
||||||
|
@property (nonatomic, copy, readonly) NSString *fileOperationToolPath;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
@implementation SUPlainInstaller
|
@implementation SUPlainInstaller
|
||||||
|
|
||||||
|
@synthesize host = _host;
|
||||||
|
@synthesize bundlePath = _bundlePath;
|
||||||
|
@synthesize installationPath = _installationPath;
|
||||||
|
@synthesize fileOperationToolPath = _fileOperationToolPath;
|
||||||
|
|
||||||
|
- (instancetype)initWithHost:(SUHost *)host bundlePath:(NSString *)bundlePath installationPath:(NSString *)installationPath fileOperationToolPath:(NSString *)fileOperationToolPath
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_host = host;
|
||||||
|
_bundlePath = [bundlePath copy];
|
||||||
|
_installationPath = [installationPath copy];
|
||||||
|
_fileOperationToolPath = [fileOperationToolPath copy];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
// Returns the bundle version from the specified host that is appropriate to use as a filename, or nil if we're unable to retrieve one
|
// Returns the bundle version from the specified host that is appropriate to use as a filename, or nil if we're unable to retrieve one
|
||||||
+ (NSString *)bundleVersionAppropriateForFilenameFromHost:(SUHost *)host
|
- (NSString *)bundleVersionAppropriateForFilenameFromHost:(SUHost *)host
|
||||||
{
|
{
|
||||||
NSString *bundleVersion = [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
|
NSString *bundleVersion = [host objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
|
||||||
NSString *trimmedVersion = @"";
|
NSString *trimmedVersion = @"";
|
||||||
@@ -31,7 +58,7 @@
|
|||||||
return trimmedVersion.length > 0 ? trimmedVersion : nil;
|
return trimmedVersion.length > 0 ? trimmedVersion : nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)performInstallationToURL:(NSURL *)installationURL fromUpdateAtURL:(NSURL *)newURL withHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath error:(NSError * __autoreleasing *)error
|
- (BOOL)performInstallationToURL:(NSURL *)installationURL fromUpdateAtURL:(NSURL *)newURL withHost:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath error:(NSError * __autoreleasing *)error
|
||||||
{
|
{
|
||||||
if (installationURL == nil || newURL == nil) {
|
if (installationURL == nil || newURL == nil) {
|
||||||
// this really shouldn't happen but just in case
|
// this really shouldn't happen but just in case
|
||||||
@@ -45,7 +72,9 @@
|
|||||||
SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath];
|
SUFileManager *fileManager = [SUFileManager fileManagerWithAuthorizationToolPath:fileOperationToolPath];
|
||||||
|
|
||||||
// Create a temporary directory for our new app that resides on our destination's volume
|
// Create a temporary directory for our new app that resides on our destination's volume
|
||||||
NSURL *tempNewDirectoryURL = [fileManager makeTemporaryDirectoryWithPreferredName:[installationURL.lastPathComponent.stringByDeletingPathExtension stringByAppendingString:@" (Incomplete Update)"] appropriateForDirectoryURL:installationURL.URLByDeletingLastPathComponent error:error];
|
NSString *preferredName = [installationURL.lastPathComponent.stringByDeletingPathExtension stringByAppendingString:@" (Incomplete Update)"];
|
||||||
|
NSURL *installationDirectory = installationURL.URLByDeletingLastPathComponent;
|
||||||
|
NSURL *tempNewDirectoryURL = [fileManager makeTemporaryDirectoryWithPreferredName:preferredName appropriateForDirectoryURL:installationDirectory error:error];
|
||||||
if (tempNewDirectoryURL == nil) {
|
if (tempNewDirectoryURL == nil) {
|
||||||
SULog(@"Failed to make new temp directory");
|
SULog(@"Failed to make new temp directory");
|
||||||
return NO;
|
return NO;
|
||||||
@@ -104,9 +133,10 @@
|
|||||||
|
|
||||||
NSString *oldURLExtension = oldURL.pathExtension;
|
NSString *oldURLExtension = oldURL.pathExtension;
|
||||||
NSString *oldDestinationNameWithPathExtension = [oldDestinationName stringByAppendingPathExtension:oldURLExtension];
|
NSString *oldDestinationNameWithPathExtension = [oldDestinationName stringByAppendingPathExtension:oldURLExtension];
|
||||||
|
NSURL *oldURLDirectory = oldURL.URLByDeletingLastPathComponent;
|
||||||
|
|
||||||
// Create a temporary directory for our old app that resides on its volume
|
// Create a temporary directory for our old app that resides on its volume
|
||||||
NSURL *tempOldDirectoryURL = [fileManager makeTemporaryDirectoryWithPreferredName:oldDestinationName appropriateForDirectoryURL:oldURL.URLByDeletingLastPathComponent error:error];
|
NSURL *tempOldDirectoryURL = [fileManager makeTemporaryDirectoryWithPreferredName:oldDestinationName appropriateForDirectoryURL:oldURLDirectory error:error];
|
||||||
if (tempOldDirectoryURL == nil) {
|
if (tempOldDirectoryURL == nil) {
|
||||||
SULog(@"Failed to create temporary directory for old app at %@", oldURL.path);
|
SULog(@"Failed to create temporary directory for old app at %@", oldURL.path);
|
||||||
[fileManager removeItemAtURL:tempNewDirectoryURL error:NULL];
|
[fileManager removeItemAtURL:tempNewDirectoryURL error:NULL];
|
||||||
@@ -155,30 +185,36 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)performInstallationToPath:(NSString *)installationPath fromPath:(NSString *)path host:(SUHost *)host fileOperationToolPath:(NSString *)fileOperationToolPath versionComparator:(id<SUVersionComparison>)comparator completionHandler:(void (^)(NSError *))completionHandler
|
- (BOOL)performInitialInstallation:(NSError * __autoreleasing *)error
|
||||||
{
|
{
|
||||||
SUParameterAssert(host);
|
|
||||||
|
|
||||||
BOOL allowDowngrades = SPARKLE_AUTOMATED_DOWNGRADES;
|
BOOL allowDowngrades = SPARKLE_AUTOMATED_DOWNGRADES;
|
||||||
|
|
||||||
// Prevent malicious downgrades
|
// Prevent malicious downgrades
|
||||||
if (!allowDowngrades) {
|
if (!allowDowngrades) {
|
||||||
if ([comparator compareVersion:[host version] toVersion:[[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey]] == NSOrderedDescending) {
|
NSString *hostVersion = [self.host version];
|
||||||
NSString *errorMessage = [NSString stringWithFormat:@"For security reasons, updates that downgrade version of the application are not allowed. Refusing to downgrade app from version %@ to %@. Aborting update.", [host version], [[NSBundle bundleWithPath:path] objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey]];
|
NSBundle *bundle = [NSBundle bundleWithPath:self.bundlePath];
|
||||||
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{ NSLocalizedDescriptionKey: errorMessage }];
|
NSString *updateVersion = [bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey];
|
||||||
[self finishInstallationToPath:installationPath withResult:NO error:error completionHandler:completionHandler];
|
id<SUVersionComparison> comparator = [[SUStandardVersionComparator alloc] init];
|
||||||
return;
|
if (!updateVersion || [comparator compareVersion:hostVersion toVersion:updateVersion] == NSOrderedDescending) {
|
||||||
|
if (error != NULL) {
|
||||||
|
NSString *errorMessage = [NSString stringWithFormat:@"For security reasons, updates that downgrade version of the application are not allowed. Refusing to downgrade app from version %@ to %@. Aborting update.", hostVersion, [bundle objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey]];
|
||||||
|
|
||||||
|
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUDowngradeError userInfo:@{ NSLocalizedDescriptionKey: errorMessage }];
|
||||||
|
}
|
||||||
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
- (BOOL)performFinalInstallation:(NSError * __autoreleasing *)error
|
||||||
NSError *error = nil;
|
{
|
||||||
BOOL result = [self performInstallationToURL:[NSURL fileURLWithPath:installationPath] fromUpdateAtURL:[NSURL fileURLWithPath:path] withHost:host fileOperationToolPath:fileOperationToolPath error:&error];
|
return [self performInstallationToURL:[NSURL fileURLWithPath:self.installationPath] fromUpdateAtURL:[NSURL fileURLWithPath:self.bundlePath] withHost:self.host fileOperationToolPath:self.fileOperationToolPath error:error];
|
||||||
|
}
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
- (BOOL)canInstallSilently
|
||||||
[self finishInstallationToPath:installationPath withResult:result error:error completionHandler:completionHandler];
|
{
|
||||||
});
|
return YES;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
-1
@@ -9,7 +9,6 @@
|
|||||||
#ifndef SUPROBINGUPDATEDRIVER_H
|
#ifndef SUPROBINGUPDATEDRIVER_H
|
||||||
#define SUPROBINGUPDATEDRIVER_H
|
#define SUPROBINGUPDATEDRIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUBasicUpdateDriver.h"
|
#import "SUBasicUpdateDriver.h"
|
||||||
|
|
||||||
// This replaces the old SUStatusChecker.
|
// This replaces the old SUStatusChecker.
|
||||||
|
|||||||
Vendored
+6
-3
@@ -7,7 +7,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUProbingUpdateDriver.h"
|
#import "SUProbingUpdateDriver.h"
|
||||||
#import "SUUpdater.h"
|
#import "SUUpdaterPrivate.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
|
|
||||||
@implementation SUProbingUpdateDriver
|
@implementation SUProbingUpdateDriver
|
||||||
|
|
||||||
@@ -15,7 +16,8 @@
|
|||||||
|
|
||||||
- (void)didFindValidUpdate
|
- (void)didFindValidUpdate
|
||||||
{
|
{
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
|
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
if ([updaterDelegate respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||||
[updaterDelegate updater:self.updater didFindValidUpdate:self.updateItem];
|
[updaterDelegate updater:self.updater didFindValidUpdate:self.updateItem];
|
||||||
@@ -26,7 +28,8 @@
|
|||||||
|
|
||||||
- (void)didNotFindUpdate
|
- (void)didNotFindUpdate
|
||||||
{
|
{
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
|
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||||
[updaterDelegate updaterDidNotFindUpdate:self.updater];
|
[updaterDelegate updaterDidNotFindUpdate:self.updater];
|
||||||
|
|||||||
Vendored
-1
@@ -9,7 +9,6 @@
|
|||||||
#ifndef SUSCHEDULEDUPDATEDRIVER_H
|
#ifndef SUSCHEDULEDUPDATEDRIVER_H
|
||||||
#define SUSCHEDULEDUPDATEDRIVER_H
|
#define SUSCHEDULEDUPDATEDRIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUUIBasedUpdateDriver.h"
|
#import "SUUIBasedUpdateDriver.h"
|
||||||
|
|
||||||
@interface SUScheduledUpdateDriver : SUUIBasedUpdateDriver
|
@interface SUScheduledUpdateDriver : SUUIBasedUpdateDriver
|
||||||
|
|||||||
Vendored
+6
-7
@@ -7,11 +7,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUScheduledUpdateDriver.h"
|
#import "SUScheduledUpdateDriver.h"
|
||||||
#import "SUUpdater.h"
|
#import "SUUpdaterPrivate.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
|
|
||||||
@interface SUScheduledUpdateDriver ()
|
@interface SUScheduledUpdateDriver ()
|
||||||
|
|
||||||
@@ -31,7 +28,8 @@
|
|||||||
|
|
||||||
- (void)didNotFindUpdate
|
- (void)didNotFindUpdate
|
||||||
{
|
{
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
|
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(updaterDidNotFindUpdate:)]) {
|
||||||
[updaterDelegate updaterDidNotFindUpdate:self.updater];
|
[updaterDelegate updaterDidNotFindUpdate:self.updater];
|
||||||
@@ -48,7 +46,8 @@
|
|||||||
} else {
|
} else {
|
||||||
// Call delegate separately here because otherwise it won't know we stopped.
|
// Call delegate separately here because otherwise it won't know we stopped.
|
||||||
// Normally this gets called by the superclass
|
// Normally this gets called by the superclass
|
||||||
id<SUUpdaterDelegate> updaterDelegate = [self.updater delegate];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
id<SUUpdaterDelegate> updaterDelegate = [updater delegate];
|
||||||
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
if ([updaterDelegate respondsToSelector:@selector(updater:didAbortWithError:)]) {
|
||||||
[updaterDelegate updater:self.updater didAbortWithError:error];
|
[updaterDelegate updater:self.updater didAbortWithError:error];
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -17,6 +17,8 @@
|
|||||||
#import "SUExport.h"
|
#import "SUExport.h"
|
||||||
#import "SUVersionComparisonProtocol.h"
|
#import "SUVersionComparisonProtocol.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sparkle's default version comparator.
|
Sparkle's default version comparator.
|
||||||
|
|
||||||
@@ -26,8 +28,15 @@
|
|||||||
*/
|
*/
|
||||||
SU_EXPORT @interface SUStandardVersionComparator : NSObject <SUVersionComparison>
|
SU_EXPORT @interface SUStandardVersionComparator : NSObject <SUVersionComparison>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Initializes a new instance of the standard version comparator.
|
||||||
|
*/
|
||||||
|
- (instancetype)init;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a singleton instance of the comparator.
|
Returns a singleton instance of the comparator.
|
||||||
|
|
||||||
|
It is usually preferred to alloc/init new a comparator instead.
|
||||||
*/
|
*/
|
||||||
+ (SUStandardVersionComparator *)defaultComparator;
|
+ (SUStandardVersionComparator *)defaultComparator;
|
||||||
|
|
||||||
@@ -39,4 +48,5 @@ SU_EXPORT @interface SUStandardVersionComparator : NSObject <SUVersionComparison
|
|||||||
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
|
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
#endif
|
#endif
|
||||||
+8
-6
@@ -6,21 +6,23 @@
|
|||||||
// Copyright 2007 Andy Matuschak. All rights reserved.
|
// Copyright 2007 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
#import "SUVersionComparisonProtocol.h"
|
||||||
#import "SUStandardVersionComparator.h"
|
#import "SUStandardVersionComparator.h"
|
||||||
|
|
||||||
@implementation SUStandardVersionComparator
|
@implementation SUStandardVersionComparator
|
||||||
|
|
||||||
|
- (instancetype)init
|
||||||
|
{
|
||||||
|
return [super init];
|
||||||
|
}
|
||||||
|
|
||||||
+ (SUStandardVersionComparator *)defaultComparator
|
+ (SUStandardVersionComparator *)defaultComparator
|
||||||
{
|
{
|
||||||
static SUStandardVersionComparator *defaultComparator = nil;
|
static SUStandardVersionComparator *defaultComparator = nil;
|
||||||
if (defaultComparator == nil) {
|
static dispatch_once_t onceToken;
|
||||||
|
dispatch_once(&onceToken, ^{
|
||||||
defaultComparator = [[SUStandardVersionComparator alloc] init];
|
defaultComparator = [[SUStandardVersionComparator alloc] init];
|
||||||
}
|
});
|
||||||
return defaultComparator;
|
return defaultComparator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-2
@@ -9,10 +9,10 @@
|
|||||||
#ifndef SUSTATUSCONTROLLER_H
|
#ifndef SUSTATUSCONTROLLER_H
|
||||||
#define SUSTATUSCONTROLLER_H
|
#define SUSTATUSCONTROLLER_H
|
||||||
|
|
||||||
#import "SUWindowController.h"
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
@class SUHost;
|
@class SUHost;
|
||||||
@interface SUStatusController : SUWindowController
|
@interface SUStatusController : NSWindowController
|
||||||
@property (weak) IBOutlet NSButton *actionButton;
|
@property (weak) IBOutlet NSButton *actionButton;
|
||||||
@property (weak) IBOutlet NSProgressIndicator *progressBar;
|
@property (weak) IBOutlet NSProgressIndicator *progressBar;
|
||||||
@property (weak) IBOutlet NSTextField *statusTextField;
|
@property (weak) IBOutlet NSTextField *statusTextField;
|
||||||
|
|||||||
Vendored
+5
-8
@@ -6,14 +6,11 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUOperatingSystem.h"
|
#import "SUOperatingSystem.h"
|
||||||
#import "SUStatusController.h"
|
#import "SUStatusController.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
|
||||||
@interface SUStatusController ()
|
@interface SUStatusController ()
|
||||||
@property (copy) NSString *title, *buttonTitle;
|
@property (copy) NSString *title, *buttonTitle;
|
||||||
@@ -42,11 +39,11 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self.host bundlePath], [self.host installationPath]]; }
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||||
|
|
||||||
- (void)windowDidLoad
|
- (void)windowDidLoad
|
||||||
{
|
{
|
||||||
if ([self.host isBackgroundApplication]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[[self window] setLevel:NSFloatingWindowLevel];
|
[[self window] setLevel:NSFloatingWindowLevel];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +66,7 @@
|
|||||||
|
|
||||||
- (NSImage *)applicationIcon
|
- (NSImage *)applicationIcon
|
||||||
{
|
{
|
||||||
return [self.host icon];
|
return [SUApplicationInfo bestIconForBundle:self.host.bundle];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)beginActionWithTitle:(NSString *)aTitle maxProgressValue:(double)aMaxProgressValue statusText:(NSString *)aStatusText
|
- (void)beginActionWithTitle:(NSString *)aTitle maxProgressValue:(double)aMaxProgressValue statusText:(NSString *)aStatusText
|
||||||
|
|||||||
Vendored
+6
-2
@@ -11,10 +11,14 @@
|
|||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@class SUHost;
|
@class SUHost;
|
||||||
@interface SUSystemProfiler : NSObject
|
@interface SUSystemProfiler : NSObject
|
||||||
+ (SUSystemProfiler *)sharedSystemProfiler;
|
|
||||||
- (NSMutableArray *)systemProfileArrayForHost:(SUHost *)host;
|
+ (NSArray *)systemProfileArrayForHost:(SUHost *)host;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
#endif
|
#endif
|
||||||
Vendored
+4
-12
@@ -7,7 +7,7 @@
|
|||||||
// Adapted from Sparkle+, by Tom Harrington.
|
// Adapted from Sparkle+, by Tom Harrington.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "SUSystemProfiler.h"
|
#import "SUSystemProfiler.h"
|
||||||
|
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
@@ -27,23 +27,15 @@ static NSString *const SUSystemProfilerOperatingSystemVersionKey = @"osVersion";
|
|||||||
static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||||
|
|
||||||
@implementation SUSystemProfiler
|
@implementation SUSystemProfiler
|
||||||
+ (SUSystemProfiler *)sharedSystemProfiler
|
|
||||||
{
|
|
||||||
static SUSystemProfiler *sharedSystemProfiler = nil;
|
|
||||||
if (!sharedSystemProfiler) {
|
|
||||||
sharedSystemProfiler = [[self alloc] init];
|
|
||||||
}
|
|
||||||
return sharedSystemProfiler;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSDictionary *)modelTranslationTable
|
+ (NSDictionary *)modelTranslationTable
|
||||||
{
|
{
|
||||||
// Use explicit class to use the correct bundle even when subclassed
|
// Use explicit class to use the correct bundle even when subclassed
|
||||||
NSString *path = [[NSBundle bundleForClass:[SUSystemProfiler class]] pathForResource:@"SUModelTranslation" ofType:@"plist"];
|
NSString *path = [[NSBundle bundleForClass:[SUSystemProfiler class]] pathForResource:@"SUModelTranslation" ofType:@"plist"];
|
||||||
return [[NSDictionary alloc] initWithContentsOfFile:path];
|
return [[NSDictionary alloc] initWithContentsOfFile:path];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSMutableArray *)systemProfileArrayForHost:(SUHost *)host
|
+ (NSArray *)systemProfileArrayForHost:(SUHost *)host
|
||||||
{
|
{
|
||||||
NSDictionary *modelTranslation = [self modelTranslationTable];
|
NSDictionary *modelTranslation = [self modelTranslationTable];
|
||||||
|
|
||||||
@@ -166,7 +158,7 @@ static NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
|||||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerMemoryKey, @"Memory (MB)", @(megabytes), @(megabytes)] forKeys:profileDictKeys]];
|
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerMemoryKey, @"Memory (MB)", @(megabytes), @(megabytes)] forKeys:profileDictKeys]];
|
||||||
}
|
}
|
||||||
|
|
||||||
return profileArray;
|
return [profileArray copy];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
//
|
||||||
|
// SUSystemUpdateInfo.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/23/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@class SUHost;
|
||||||
|
|
||||||
|
@interface SUSystemUpdateInfo : NSObject
|
||||||
|
|
||||||
|
+ (BOOL)systemAllowsAutomaticUpdatesForHost:(SUHost *)host;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+58
@@ -0,0 +1,58 @@
|
|||||||
|
//
|
||||||
|
// SUSystemUpdateInfo.m
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/23/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SUSystemUpdateInfo.h"
|
||||||
|
#import "SUHost.h"
|
||||||
|
#import "SUConstants.h"
|
||||||
|
#import "SUFileManager.h"
|
||||||
|
|
||||||
|
@implementation SUSystemUpdateInfo
|
||||||
|
|
||||||
|
+ (BOOL)systemAllowsAutomaticUpdatesForHost:(SUHost *)host
|
||||||
|
{
|
||||||
|
// Does the developer want us to disable automatic updates?
|
||||||
|
NSNumber *developerAllowsAutomaticUpdates = [host objectForInfoDictionaryKey:SUAllowsAutomaticUpdatesKey];
|
||||||
|
if (developerAllowsAutomaticUpdates != nil && !developerAllowsAutomaticUpdates.boolValue) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can we automatically update in the background without bugging the user (e.g, with a administrator password prompt)?
|
||||||
|
// Note it's very well possible to have the bundle be writable but not be able to write into the parent directory
|
||||||
|
// And if the bundle isn't writable, but we can write into the parent directory, we will still need to authorize to replace it
|
||||||
|
NSString *bundlePath = [host bundlePath];
|
||||||
|
if (![[NSFileManager defaultManager] isWritableFileAtPath:bundlePath.stringByDeletingLastPathComponent] || ![[NSFileManager defaultManager] isWritableFileAtPath:bundlePath]) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Just because we have writability access does not mean we can set the correct owner/group silently
|
||||||
|
// Test if we can set the owner/group on a temporarily created file
|
||||||
|
// If we can, then we can probably perform an update without authorization
|
||||||
|
// One place where this matters is if you copy and run an app from /tmp/
|
||||||
|
|
||||||
|
NSString *tempFilename = @"permission_test" ;
|
||||||
|
|
||||||
|
SUFileManager *suFileManager = [SUFileManager defaultManager];
|
||||||
|
NSURL *tempDirectoryURL = [suFileManager makeTemporaryDirectoryWithPreferredName:tempFilename appropriateForDirectoryURL:[NSURL fileURLWithPath:NSTemporaryDirectory()] error:NULL];
|
||||||
|
|
||||||
|
if (tempDirectoryURL == nil) {
|
||||||
|
// I don't imagine this ever happening but in case it does, requesting authorization may be the better option
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSURL *tempFileURL = [tempDirectoryURL URLByAppendingPathComponent:tempFilename];
|
||||||
|
|
||||||
|
BOOL changeOwnerAndGroupSuccess =
|
||||||
|
[[NSData data] writeToURL:tempFileURL atomically:NO] &&
|
||||||
|
[suFileManager changeOwnerAndGroupOfItemAtRootURL:tempFileURL toMatchURL:host.bundle.bundleURL error:NULL];
|
||||||
|
|
||||||
|
[suFileManager removeItemAtURL:tempDirectoryURL error:NULL];
|
||||||
|
|
||||||
|
return changeOwnerAndGroupSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+1
-2
@@ -11,11 +11,10 @@
|
|||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "SUBasicUpdateDriver.h"
|
#import "SUBasicUpdateDriver.h"
|
||||||
#import "SUUpdateAlert.h"
|
|
||||||
|
|
||||||
@class SUStatusController;
|
@class SUStatusController;
|
||||||
|
|
||||||
@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver <SUUnarchiverDelegate>
|
@interface SUUIBasedUpdateDriver : SUBasicUpdateDriver
|
||||||
|
|
||||||
- (void)showAlert:(NSAlert *)alert;
|
- (void)showAlert:(NSAlert *)alert;
|
||||||
- (IBAction)cancelDownload:(id)sender;
|
- (IBAction)cancelDownload:(id)sender;
|
||||||
|
|||||||
Vendored
+28
-19
@@ -9,11 +9,15 @@
|
|||||||
#import "SUUIBasedUpdateDriver.h"
|
#import "SUUIBasedUpdateDriver.h"
|
||||||
|
|
||||||
#import "SUUpdateAlert.h"
|
#import "SUUpdateAlert.h"
|
||||||
#import "SUUpdater_Private.h"
|
#import "SUUpdaterPrivate.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUOperatingSystem.h"
|
#import "SUOperatingSystem.h"
|
||||||
#import "SUStatusController.h"
|
#import "SUStatusController.h"
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUAppcastItem.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
|
||||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1080
|
#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1080
|
||||||
@interface NSByteCountFormatter : NSFormatter {
|
@interface NSByteCountFormatter : NSFormatter {
|
||||||
@@ -42,7 +46,7 @@
|
|||||||
@synthesize statusController;
|
@synthesize statusController;
|
||||||
@synthesize updateAlert;
|
@synthesize updateAlert;
|
||||||
|
|
||||||
- (instancetype)initWithUpdater:(SUUpdater *)anUpdater
|
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
|
||||||
{
|
{
|
||||||
if ((self = [super initWithUpdater:anUpdater])) {
|
if ((self = [super initWithUpdater:anUpdater])) {
|
||||||
self.automaticallyInstallUpdates = NO;
|
self.automaticallyInstallUpdates = NO;
|
||||||
@@ -52,8 +56,9 @@
|
|||||||
|
|
||||||
- (void)didFindValidUpdate
|
- (void)didFindValidUpdate
|
||||||
{
|
{
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[[self.updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
|
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)]) {
|
||||||
|
[[updater delegate] updater:self.updater didFindValidUpdate:self.updateItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.automaticallyInstallUpdates) {
|
if (self.automaticallyInstallUpdates) {
|
||||||
@@ -66,15 +71,15 @@
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
id<SUVersionDisplay> versDisp = nil;
|
id<SUVersionDisplay> versDisp = nil;
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) {
|
if ([[updater delegate] respondsToSelector:@selector(versionDisplayerForUpdater:)]) {
|
||||||
versDisp = [[self.updater delegate] versionDisplayerForUpdater:self.updater];
|
versDisp = [[updater delegate] versionDisplayerForUpdater:self.updater];
|
||||||
}
|
}
|
||||||
[self.updateAlert setVersionDisplayer:versDisp];
|
[self.updateAlert setVersionDisplayer:versDisp];
|
||||||
|
|
||||||
// If the app is a menubar app or the like, we need to focus it first and alter the
|
// If the app is a menubar app or the like, we need to focus it first and alter the
|
||||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||||
// there may be no way for the application to be activated to make it visible again.
|
// there may be no way for the application to be activated to make it visible again.
|
||||||
if ([self.host isBackgroundApplication]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[[self.updateAlert window] setHidesOnDeactivate:NO];
|
[[self.updateAlert window] setHidesOnDeactivate:NO];
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
@@ -88,8 +93,9 @@
|
|||||||
|
|
||||||
- (void)didNotFindUpdate
|
- (void)didNotFindUpdate
|
||||||
{
|
{
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[[self.updater delegate] updaterDidNotFindUpdate:self.updater];
|
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||||
|
[[updater delegate] updaterDidNotFindUpdate:self.updater];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater];
|
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterDidNotFindUpdateNotification object:self.updater];
|
||||||
|
|
||||||
if (!self.automaticallyInstallUpdates) {
|
if (!self.automaticallyInstallUpdates) {
|
||||||
@@ -201,8 +207,10 @@
|
|||||||
{
|
{
|
||||||
if (self.download) {
|
if (self.download) {
|
||||||
[self.download cancel];
|
[self.download cancel];
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(userDidCancelDownload:)]) {
|
|
||||||
[[self.updater delegate] userDidCancelDownload:self.updater];
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
|
if ([[updater delegate] respondsToSelector:@selector(userDidCancelDownload:)]) {
|
||||||
|
[[updater delegate] userDidCancelDownload:self.updater];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[self abortUpdate];
|
[self abortUpdate];
|
||||||
@@ -216,7 +224,7 @@
|
|||||||
[super extractUpdate];
|
[super extractUpdate];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)unarchiver:(SUUnarchiver *)__unused ua extractedProgress:(double)progress
|
- (void)unarchiver:(id)__unused ua extractedProgress:(double)progress
|
||||||
{
|
{
|
||||||
// We do this here instead of in extractUpdate so that we only have a determinate progress bar for archives with progress.
|
// We do this here instead of in extractUpdate so that we only have a determinate progress bar for archives with progress.
|
||||||
if ([self.statusController maxProgressValue] == 0.0) {
|
if ([self.statusController maxProgressValue] == 0.0) {
|
||||||
@@ -225,7 +233,7 @@
|
|||||||
[self.statusController setProgressValue:progress];
|
[self.statusController setProgressValue:progress];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)unarchiverDidFinish:(SUUnarchiver *)__unused ua
|
- (void)unarchiverDidFinish:(id)__unused ua
|
||||||
{
|
{
|
||||||
if (self.automaticallyInstallUpdates) {
|
if (self.automaticallyInstallUpdates) {
|
||||||
[self installWithToolAndRelaunch:YES];
|
[self installWithToolAndRelaunch:YES];
|
||||||
@@ -289,19 +297,20 @@
|
|||||||
|
|
||||||
- (void)showAlert:(NSAlert *)alert
|
- (void)showAlert:(NSAlert *)alert
|
||||||
{
|
{
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)]) {
|
id<SUUpdaterPrivate> updater = self.updater;
|
||||||
[[self.updater delegate] updaterWillShowModalAlert:self.updater];
|
if ([[updater delegate] respondsToSelector:@selector(updaterWillShowModalAlert:)]) {
|
||||||
|
[[updater delegate] updaterWillShowModalAlert:self.updater];
|
||||||
}
|
}
|
||||||
|
|
||||||
// When showing a modal alert we need to ensure that background applications
|
// When showing a modal alert we need to ensure that background applications
|
||||||
// are focused to inform the user since there is no dock icon to notify them.
|
// are focused to inform the user since there is no dock icon to notify them.
|
||||||
if ([self.host isBackgroundApplication]) { [NSApp activateIgnoringOtherApps:YES]; }
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { [NSApp activateIgnoringOtherApps:YES]; }
|
||||||
|
|
||||||
[alert setIcon:[self.host icon]];
|
[alert setIcon:[SUApplicationInfo bestIconForBundle:self.host.bundle]];
|
||||||
[alert runModal];
|
[alert runModal];
|
||||||
|
|
||||||
if ([[self.updater delegate] respondsToSelector:@selector(updaterDidShowModalAlert:)])
|
if ([[updater delegate] respondsToSelector:@selector(updaterDidShowModalAlert:)])
|
||||||
[[self.updater delegate] updaterDidShowModalAlert:self.updater];
|
[[updater delegate] updaterDidShowModalAlert:self.updater];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+5
-23
@@ -6,34 +6,16 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef SUUNARCHIVER_H
|
|
||||||
#define SUUNARCHIVER_H
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
@class SUHost;
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
@protocol SUUnarchiverDelegate;
|
|
||||||
|
@protocol SUUnarchiverProtocol;
|
||||||
|
|
||||||
@interface SUUnarchiver : NSObject
|
@interface SUUnarchiver : NSObject
|
||||||
|
|
||||||
@property (copy, readonly) NSString *archivePath;
|
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||||
@property (copy, readonly) NSString *updateHostBundlePath;
|
|
||||||
@property (copy, readonly) NSString *decryptionPassword;
|
|
||||||
@property (weak) id<SUUnarchiverDelegate> delegate;
|
|
||||||
|
|
||||||
+ (SUUnarchiver *)unarchiverForPath:(NSString *)path updatingHostBundlePath:(NSString *)host withPassword:(NSString *)decryptionPassword;
|
|
||||||
|
|
||||||
+ (BOOL)unsafeIfArchiveIsNotValidated;
|
|
||||||
|
|
||||||
- (void)start;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@protocol SUUnarchiverDelegate <NSObject>
|
NS_ASSUME_NONNULL_END
|
||||||
- (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver;
|
|
||||||
- (void)unarchiverDidFail:(SUUnarchiver *)unarchiver;
|
|
||||||
@optional
|
|
||||||
- (void)unarchiver:(SUUnarchiver *)unarchiver extractedProgress:(double)progress;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Vendored
+15
-81
@@ -6,94 +6,28 @@
|
|||||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
#import "SUAppcast.h"
|
|
||||||
#import "SUAppcastItem.h"
|
|
||||||
#import "SUVersionComparisonProtocol.h"
|
|
||||||
#import "SUUnarchiver.h"
|
#import "SUUnarchiver.h"
|
||||||
#import "SUUnarchiver_Private.h"
|
#import "SUUnarchiverProtocol.h"
|
||||||
|
#import "SUPipedUnarchiver.h"
|
||||||
|
#import "SUDiskImageUnarchiver.h"
|
||||||
|
#import "SUBinaryDeltaUnarchiver.h"
|
||||||
|
|
||||||
@implementation SUUnarchiver
|
@implementation SUUnarchiver
|
||||||
|
|
||||||
@synthesize archivePath;
|
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword
|
||||||
@synthesize updateHostBundlePath;
|
|
||||||
@synthesize delegate;
|
|
||||||
@synthesize decryptionPassword;
|
|
||||||
|
|
||||||
+ (SUUnarchiver *)unarchiverForPath:(NSString *)path updatingHostBundlePath:(NSString *)hostPath withPassword:(NSString *)decryptionPassword
|
|
||||||
{
|
{
|
||||||
for (id current in [self unarchiverImplementations]) {
|
if ([SUPipedUnarchiver canUnarchivePath:path]) {
|
||||||
if ([current canUnarchivePath:path]) {
|
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
|
||||||
return [[current alloc] initWithPath:path hostBundlePath:hostPath password:decryptionPassword];
|
|
||||||
}
|
} else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
|
||||||
|
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
|
||||||
|
|
||||||
|
} else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
|
||||||
|
assert(hostPath != nil);
|
||||||
|
NSString *nonNullHostPath = hostPath;
|
||||||
|
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], self.archivePath]; }
|
|
||||||
|
|
||||||
- (void)start
|
|
||||||
{
|
|
||||||
// No-op
|
|
||||||
}
|
|
||||||
|
|
||||||
- (instancetype)initWithPath:(NSString *)path hostBundlePath:(NSString *)hostPath password:(NSString *)password
|
|
||||||
{
|
|
||||||
if ((self = [super init]))
|
|
||||||
{
|
|
||||||
archivePath = [path copy];
|
|
||||||
updateHostBundlePath = hostPath;
|
|
||||||
decryptionPassword = password;
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (BOOL)canUnarchivePath:(NSString *)__unused path
|
|
||||||
{
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (BOOL)unsafeIfArchiveIsNotValidated
|
|
||||||
{
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)notifyDelegateOfProgress:(double)progress
|
|
||||||
{
|
|
||||||
if ([self.delegate respondsToSelector:@selector(unarchiver:extractedProgress:)]) {
|
|
||||||
[self.delegate unarchiver:self extractedProgress:progress];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)notifyDelegateOfSuccess
|
|
||||||
{
|
|
||||||
if ([self.delegate respondsToSelector:@selector(unarchiverDidFinish:)]) {
|
|
||||||
[self.delegate unarchiverDidFinish:self];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)notifyDelegateOfFailure
|
|
||||||
{
|
|
||||||
if ([self.delegate respondsToSelector:@selector(unarchiverDidFail:)]) {
|
|
||||||
[self.delegate unarchiverDidFail:self];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static NSMutableArray *gUnarchiverImplementations;
|
|
||||||
|
|
||||||
+ (void)registerImplementation:(Class)implementation
|
|
||||||
{
|
|
||||||
if (!gUnarchiverImplementations) {
|
|
||||||
gUnarchiverImplementations = [[NSMutableArray alloc] init];
|
|
||||||
}
|
|
||||||
[gUnarchiverImplementations addObject:implementation];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSArray *)unarchiverImplementations
|
|
||||||
{
|
|
||||||
return [NSArray arrayWithArray:gUnarchiverImplementations];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
+25
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// SUUnarchiverNotifier.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/21/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface SUUnarchiverNotifier : NSObject
|
||||||
|
|
||||||
|
- (instancetype)initWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock;
|
||||||
|
|
||||||
|
- (void)notifySuccess;
|
||||||
|
|
||||||
|
- (void)notifyFailureWithError:(NSError * _Nullable)reason;
|
||||||
|
|
||||||
|
- (void)notifyProgress:(double)progress;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+65
@@ -0,0 +1,65 @@
|
|||||||
|
//
|
||||||
|
// SUUnarchiverNotifier.m
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/21/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SUUnarchiverNotifier.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUErrors.h"
|
||||||
|
|
||||||
|
@interface SUUnarchiverNotifier ()
|
||||||
|
|
||||||
|
@property (nonatomic, readonly, copy) void (^completionBlock)(NSError * _Nullable);
|
||||||
|
@property (nonatomic, readonly, copy) void (^ _Nullable progressBlock)(double);
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation SUUnarchiverNotifier
|
||||||
|
|
||||||
|
@synthesize completionBlock = _completionBlock;
|
||||||
|
@synthesize progressBlock = _progressBlock;
|
||||||
|
|
||||||
|
- (instancetype)initWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_completionBlock = [completionBlock copy];
|
||||||
|
_progressBlock = [progressBlock copy];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)notifySuccess
|
||||||
|
{
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
self.completionBlock(nil);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)notifyFailureWithError:(NSError * _Nullable)reason
|
||||||
|
{
|
||||||
|
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) forKey:NSLocalizedDescriptionKey];
|
||||||
|
if (reason) {
|
||||||
|
[userInfo setObject:(NSError * _Nonnull)reason forKey:NSUnderlyingErrorKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
NSError *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfo];
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
self.completionBlock(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)notifyProgress:(double)progress
|
||||||
|
{
|
||||||
|
if (self.progressBlock != nil) {
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
self.progressBlock(progress);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+25
@@ -0,0 +1,25 @@
|
|||||||
|
//
|
||||||
|
// SUUnarchiverProtocol.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 3/26/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@protocol SUUnarchiverProtocol <NSObject>
|
||||||
|
|
||||||
|
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||||
|
|
||||||
|
+ (BOOL)unsafeIfArchiveIsNotValidated;
|
||||||
|
|
||||||
|
- (void)unarchiveWithCompletionBlock:(void (^)(NSError * _Nullable))completionBlock progressBlock:(void (^ _Nullable)(double))progressBlock;
|
||||||
|
|
||||||
|
- (NSString *)description;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
-26
@@ -1,26 +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)canUnarchivePath:(NSString *)path;
|
|
||||||
- (instancetype)initWithPath:(NSString *)archive hostBundlePath:(NSString *)host;
|
|
||||||
|
|
||||||
- (void)notifyDelegateOfProgress:(double)progress;
|
|
||||||
- (void)notifyDelegateOfSuccess;
|
|
||||||
- (void)notifyDelegateOfFailure;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Vendored
+2
-2
@@ -9,7 +9,7 @@
|
|||||||
#ifndef SUUPDATEALERT_H
|
#ifndef SUUPDATEALERT_H
|
||||||
#define SUUPDATEALERT_H
|
#define SUUPDATEALERT_H
|
||||||
|
|
||||||
#import "SUWindowController.h"
|
#import <Cocoa/Cocoa.h>
|
||||||
#import "SUVersionDisplayProtocol.h"
|
#import "SUVersionDisplayProtocol.h"
|
||||||
|
|
||||||
@protocol SUUpdateAlertDelegate;
|
@protocol SUUpdateAlertDelegate;
|
||||||
@@ -22,7 +22,7 @@ typedef NS_ENUM(NSInteger, SUUpdateAlertChoice) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@class SUAppcastItem, SUHost;
|
@class SUAppcastItem, SUHost;
|
||||||
@interface SUUpdateAlert : SUWindowController
|
@interface SUUpdateAlert : NSWindowController
|
||||||
|
|
||||||
@property (weak) id<SUVersionDisplay> versionDisplayer;
|
@property (weak) id<SUVersionDisplay> versionDisplayer;
|
||||||
|
|
||||||
|
|||||||
Vendored
+7
-3
@@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUAppcastItem.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
#import "SUSystemUpdateInfo.h"
|
||||||
|
|
||||||
// WebKit protocols are not explicitly declared until 10.11 SDK, so
|
// WebKit protocols are not explicitly declared until 10.11 SDK, so
|
||||||
// declare dummy protocols to keep the build working on earlier SDKs.
|
// declare dummy protocols to keep the build working on earlier SDKs.
|
||||||
@@ -167,7 +171,7 @@
|
|||||||
|
|
||||||
- (BOOL)allowsAutomaticUpdates
|
- (BOOL)allowsAutomaticUpdates
|
||||||
{
|
{
|
||||||
return self.host.allowsAutomaticUpdates;
|
return [SUSystemUpdateInfo systemAllowsAutomaticUpdatesForHost:self.host];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidLoad
|
- (void)windowDidLoad
|
||||||
@@ -176,7 +180,7 @@
|
|||||||
|
|
||||||
[self.window setFrameAutosaveName: showReleaseNotes ? @"SUUpdateAlert" : @"SUUpdateAlertSmall" ];
|
[self.window setFrameAutosaveName: showReleaseNotes ? @"SUUpdateAlert" : @"SUUpdateAlertSmall" ];
|
||||||
|
|
||||||
if ([self.host isBackgroundApplication]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[self.window setLevel:NSFloatingWindowLevel]; // This means the window will float over all other apps, if our app is switched out ?!
|
[self.window setLevel:NSFloatingWindowLevel]; // This means the window will float over all other apps, if our app is switched out ?!
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +220,7 @@
|
|||||||
|
|
||||||
- (NSImage *)applicationIcon
|
- (NSImage *)applicationIcon
|
||||||
{
|
{
|
||||||
return [self.host icon];
|
return [SUApplicationInfo bestIconForBundle:self.host.bundle];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)titleText
|
- (NSString *)titleText
|
||||||
|
|||||||
Vendored
+6
-2
@@ -14,12 +14,16 @@
|
|||||||
extern NSString *const SUUpdateDriverFinishedNotification;
|
extern NSString *const SUUpdateDriverFinishedNotification;
|
||||||
|
|
||||||
@class SUHost, SUUpdater;
|
@class SUHost, SUUpdater;
|
||||||
|
@protocol SUUpdaterPrivate;
|
||||||
@interface SUUpdateDriver : NSObject <NSURLDownloadDelegate>
|
@interface SUUpdateDriver : NSObject <NSURLDownloadDelegate>
|
||||||
|
|
||||||
@property (readonly, weak) SUUpdater *updater;
|
// We only have SUUpdater* forward declared intentionally (i.e, not #import'ing SUUpdater.h in the update drivers)
|
||||||
|
// This is so we can minimize what we can access using SUUpdaterPrivate
|
||||||
|
@property (readonly, weak) SUUpdater<SUUpdaterPrivate> *updater;
|
||||||
|
|
||||||
@property (strong) SUHost *host;
|
@property (strong) SUHost *host;
|
||||||
|
|
||||||
- (instancetype)initWithUpdater:(SUUpdater *)updater;
|
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)updater;
|
||||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||||
- (void)abortUpdate;
|
- (void)abortUpdate;
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-3
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdateDriver.h"
|
#import "SUUpdateDriver.h"
|
||||||
|
#import "SUUpdaterPrivate.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ NSString *const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
|||||||
|
|
||||||
@interface SUUpdateDriver ()
|
@interface SUUpdateDriver ()
|
||||||
|
|
||||||
@property (weak) SUUpdater *updater;
|
@property (weak) id<SUUpdaterPrivate> updater;
|
||||||
@property (copy) NSURL *appcastURL;
|
@property (copy) NSURL *appcastURL;
|
||||||
@property (getter=isInterruptible) BOOL interruptible;
|
@property (getter=isInterruptible) BOOL interruptible;
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ NSString *const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
|||||||
@synthesize appcastURL;
|
@synthesize appcastURL;
|
||||||
@synthesize automaticallyInstallUpdates;
|
@synthesize automaticallyInstallUpdates;
|
||||||
|
|
||||||
- (instancetype)initWithUpdater:(SUUpdater *)anUpdater
|
- (instancetype)initWithUpdater:(id<SUUpdaterPrivate>)anUpdater
|
||||||
{
|
{
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
self.updater = anUpdater;
|
self.updater = anUpdater;
|
||||||
@@ -37,7 +38,7 @@ NSString *const SUUpdateDriverFinishedNotification = @"SUUpdateDriverFinished";
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self.host bundlePath], [self.host installationPath]]; }
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||||
|
|
||||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)h
|
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)h
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+5
-8
@@ -9,7 +9,7 @@
|
|||||||
#ifndef SUUPDATEPERMISSIONPROMPT_H
|
#ifndef SUUPDATEPERMISSIONPROMPT_H
|
||||||
#define SUUPDATEPERMISSIONPROMPT_H
|
#define SUUPDATEPERMISSIONPROMPT_H
|
||||||
|
|
||||||
#import "SUWindowController.h"
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger, SUPermissionPromptResult) {
|
typedef NS_ENUM(NSInteger, SUPermissionPromptResult) {
|
||||||
SUAutomaticallyCheck,
|
SUAutomaticallyCheck,
|
||||||
@@ -18,16 +18,13 @@ typedef NS_ENUM(NSInteger, SUPermissionPromptResult) {
|
|||||||
|
|
||||||
@protocol SUUpdatePermissionPromptDelegate;
|
@protocol SUUpdatePermissionPromptDelegate;
|
||||||
|
|
||||||
@class SUHost;
|
@class SUHost, SUUpdatePermissionResponse;
|
||||||
@interface SUUpdatePermissionPrompt : SUWindowController
|
@interface SUUpdatePermissionPrompt : NSWindowController
|
||||||
|
|
||||||
|
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply;
|
||||||
|
|
||||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id<SUUpdatePermissionPromptDelegate>)d;
|
|
||||||
- (IBAction)toggleMoreInfo:(id)sender;
|
- (IBAction)toggleMoreInfo:(id)sender;
|
||||||
- (IBAction)finishPrompt:(id)sender;
|
- (IBAction)finishPrompt:(id)sender;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@protocol SUUpdatePermissionPromptDelegate <NSObject>
|
|
||||||
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+15
-13
@@ -7,9 +7,12 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdatePermissionPrompt.h"
|
#import "SUUpdatePermissionPrompt.h"
|
||||||
|
#import "SUUpdatePermissionResponse.h"
|
||||||
|
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
|
||||||
@interface SUUpdatePermissionPrompt ()
|
@interface SUUpdatePermissionPrompt ()
|
||||||
|
|
||||||
@@ -18,21 +21,22 @@
|
|||||||
|
|
||||||
@property (strong) SUHost *host;
|
@property (strong) SUHost *host;
|
||||||
@property (strong) NSArray *systemProfileInformationArray;
|
@property (strong) NSArray *systemProfileInformationArray;
|
||||||
@property (weak) id<SUUpdatePermissionPromptDelegate> delegate;
|
|
||||||
@property (weak) IBOutlet NSTextField *descriptionTextField;
|
@property (weak) IBOutlet NSTextField *descriptionTextField;
|
||||||
@property (weak) IBOutlet NSView *moreInfoView;
|
@property (weak) IBOutlet NSView *moreInfoView;
|
||||||
@property (weak) IBOutlet NSButton *moreInfoButton;
|
@property (weak) IBOutlet NSButton *moreInfoButton;
|
||||||
@property (weak) IBOutlet NSTableView *profileTableView;
|
@property (weak) IBOutlet NSTableView *profileTableView;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) void (^reply)(SUUpdatePermissionResponse *);
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation SUUpdatePermissionPrompt
|
@implementation SUUpdatePermissionPrompt
|
||||||
|
|
||||||
|
@synthesize reply = _reply;
|
||||||
@synthesize isShowingMoreInfo = _isShowingMoreInfo;
|
@synthesize isShowingMoreInfo = _isShowingMoreInfo;
|
||||||
@synthesize shouldSendProfile = _shouldSendProfile;
|
@synthesize shouldSendProfile = _shouldSendProfile;
|
||||||
@synthesize host;
|
@synthesize host;
|
||||||
@synthesize systemProfileInformationArray;
|
@synthesize systemProfileInformationArray;
|
||||||
@synthesize delegate;
|
|
||||||
@synthesize descriptionTextField;
|
@synthesize descriptionTextField;
|
||||||
@synthesize moreInfoView;
|
@synthesize moreInfoView;
|
||||||
@synthesize moreInfoButton;
|
@synthesize moreInfoButton;
|
||||||
@@ -43,13 +47,13 @@
|
|||||||
return [[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
return [[self.host objectForInfoDictionaryKey:SUEnableSystemProfilingKey] boolValue];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id<SUUpdatePermissionPromptDelegate>)d
|
- (instancetype)initWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||||
{
|
{
|
||||||
self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"];
|
self = [super initWithWindowNibName:@"SUUpdatePermissionPrompt"];
|
||||||
if (self)
|
if (self)
|
||||||
{
|
{
|
||||||
|
_reply = reply;
|
||||||
host = aHost;
|
host = aHost;
|
||||||
delegate = d;
|
|
||||||
self.isShowingMoreInfo = NO;
|
self.isShowingMoreInfo = NO;
|
||||||
self.shouldSendProfile = [self shouldAskAboutProfile];
|
self.shouldSendProfile = [self shouldAskAboutProfile];
|
||||||
systemProfileInformationArray = profile;
|
systemProfileInformationArray = profile;
|
||||||
@@ -58,17 +62,17 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)promptWithHost:(SUHost *)aHost systemProfile:(NSArray *)profile delegate:(id<SUUpdatePermissionPromptDelegate>)d
|
+ (void)promptWithHost:(SUHost *)host systemProfile:(NSArray *)profile reply:(void (^)(SUUpdatePermissionResponse *))reply
|
||||||
{
|
{
|
||||||
// If this is a background application we need to focus it in order to bring the prompt
|
// If this is a background application we need to focus it in order to bring the prompt
|
||||||
// to the user's attention. Otherwise the prompt would be hidden behind other applications and
|
// to the user's attention. Otherwise the prompt would be hidden behind other applications and
|
||||||
// the user would not know why the application was paused.
|
// the user would not know why the application was paused.
|
||||||
if ([aHost isBackgroundApplication]) {
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) {
|
||||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen
|
if (![NSApp modalWindow]) { // do not prompt if there is is another modal window on screen
|
||||||
SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initWithHost:aHost systemProfile:profile delegate:d];
|
SUUpdatePermissionPrompt *prompt = [[[self class] alloc] initWithHost:host systemProfile:profile reply:reply];
|
||||||
NSWindow *window = [prompt window];
|
NSWindow *window = [prompt window];
|
||||||
if (window) {
|
if (window) {
|
||||||
[NSApp runModalForWindow:window];
|
[NSApp runModalForWindow:window];
|
||||||
@@ -96,7 +100,7 @@
|
|||||||
|
|
||||||
- (NSImage *)icon
|
- (NSImage *)icon
|
||||||
{
|
{
|
||||||
return [self.host icon];
|
return [SUApplicationInfo bestIconForBundle:self.host.bundle];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)promptDescription
|
- (NSString *)promptDescription
|
||||||
@@ -149,11 +153,9 @@
|
|||||||
|
|
||||||
- (IBAction)finishPrompt:(id)sender
|
- (IBAction)finishPrompt:(id)sender
|
||||||
{
|
{
|
||||||
if (![self.delegate respondsToSelector:@selector(updatePermissionPromptFinishedWithResult:)]) {
|
SUUpdatePermissionResponse *response = [[SUUpdatePermissionResponse alloc] initWithAutomaticUpdateChecks:([sender tag] == 1) sendSystemProfile:self.shouldSendProfile];
|
||||||
[NSException raise:@"SUInvalidDelegate" format:@"SUUpdatePermissionPrompt's delegate (%@) doesn't respond to updatePermissionPromptFinishedWithResult:!", self.delegate];
|
self.reply(response);
|
||||||
}
|
|
||||||
[self.host setBool:self.shouldSendProfile forUserDefaultsKey:SUSendProfileInfoKey];
|
|
||||||
[self.delegate updatePermissionPromptFinishedWithResult:([sender tag] == 1 ? SUAutomaticallyCheck : SUDoNotAutomaticallyCheck)];
|
|
||||||
[[self window] close];
|
[[self window] close];
|
||||||
[NSApp stopModal];
|
[NSApp stopModal];
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+34
@@ -0,0 +1,34 @@
|
|||||||
|
//
|
||||||
|
// SUUpdatePermissionResponse.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/26/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
This class represents a response for permission to check updates.
|
||||||
|
*/
|
||||||
|
@interface SUUpdatePermissionResponse : NSObject
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Initializes a new update permission response instance.
|
||||||
|
|
||||||
|
@param automaticUpdateChecks Flag for whether to allow automatic update checks.
|
||||||
|
@param sendSystemProfile Flag for if system profile information should be sent to the server hosting the appcast.
|
||||||
|
*/
|
||||||
|
- (instancetype)initWithAutomaticUpdateChecks:(BOOL)automaticUpdateChecks sendSystemProfile:(BOOL)sendSystemProfile;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
A read-only property indicating whether automatic update checks are allowed or not.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) BOOL automaticUpdateChecks;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
A read-only property indicating if system profile should be sent or not.
|
||||||
|
*/
|
||||||
|
@property (nonatomic, readonly) BOOL sendSystemProfile;
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+26
@@ -0,0 +1,26 @@
|
|||||||
|
//
|
||||||
|
// SUUpdatePermissionResponse.m
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/26/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "SUUpdatePermissionResponse.h"
|
||||||
|
|
||||||
|
@implementation SUUpdatePermissionResponse
|
||||||
|
|
||||||
|
@synthesize automaticUpdateChecks = _automaticUpdateChecks;
|
||||||
|
@synthesize sendSystemProfile = _sendSystemProfile;
|
||||||
|
|
||||||
|
- (instancetype)initWithAutomaticUpdateChecks:(BOOL)automaticUpdateChecks sendSystemProfile:(BOOL)sendSystemProfile
|
||||||
|
{
|
||||||
|
self = [super init];
|
||||||
|
if (self != nil) {
|
||||||
|
_automaticUpdateChecks = automaticUpdateChecks;
|
||||||
|
_sendSystemProfile = sendSystemProfile;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
+46
-48
@@ -38,7 +38,7 @@
|
|||||||
BOOL prevalidatedDsaSignature;
|
BOOL prevalidatedDsaSignature;
|
||||||
if (performingPrevalidation) {
|
if (performingPrevalidation) {
|
||||||
NSString *publicDSAKey = host.publicDSAKey;
|
NSString *publicDSAKey = host.publicDSAKey;
|
||||||
|
|
||||||
if (publicDSAKey == nil) {
|
if (publicDSAKey == nil) {
|
||||||
prevalidatedDsaSignature = NO;
|
prevalidatedDsaSignature = NO;
|
||||||
SULog(@"Failed to validate update before unarchiving because no DSA key was found");
|
SULog(@"Failed to validate update before unarchiving because no DSA key was found");
|
||||||
@@ -51,13 +51,13 @@
|
|||||||
SULog(@"DSA signature validation before unarchiving failed for update %@", downloadPath);
|
SULog(@"DSA signature validation before unarchiving failed for update %@", downloadPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
canValidate = prevalidatedDsaSignature;
|
canValidate = prevalidatedDsaSignature;
|
||||||
} else {
|
} else {
|
||||||
prevalidatedDsaSignature = NO;
|
prevalidatedDsaSignature = NO;
|
||||||
canValidate = YES;
|
canValidate = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
_canValidate = canValidate;
|
_canValidate = canValidate;
|
||||||
_prevalidatedDsaSignature = prevalidatedDsaSignature;
|
_prevalidatedDsaSignature = prevalidatedDsaSignature;
|
||||||
_downloadPath = [downloadPath copy];
|
_downloadPath = [downloadPath copy];
|
||||||
@@ -70,56 +70,54 @@
|
|||||||
- (BOOL)validateWithUpdateDirectory:(NSString *)updateDirectory
|
- (BOOL)validateWithUpdateDirectory:(NSString *)updateDirectory
|
||||||
{
|
{
|
||||||
assert(self.canValidate);
|
assert(self.canValidate);
|
||||||
|
|
||||||
NSString *DSASignature = self.dsaSignature;
|
NSString *DSASignature = self.dsaSignature;
|
||||||
NSString *publicDSAKey = self.host.publicDSAKey;
|
NSString *publicDSAKey = self.host.publicDSAKey;
|
||||||
NSString *downloadPath = self.downloadPath;
|
NSString *downloadPath = self.downloadPath;
|
||||||
SUHost *host = self.host;
|
SUHost *host = self.host;
|
||||||
|
|
||||||
BOOL prevalidatedDsaSignature = self.prevalidatedDsaSignature;
|
BOOL prevalidatedDsaSignature = self.prevalidatedDsaSignature;
|
||||||
|
|
||||||
BOOL validationCheckSuccess;
|
|
||||||
BOOL isPackage = NO;
|
BOOL isPackage = NO;
|
||||||
|
|
||||||
// install source could point to a new bundle or a package
|
// install source could point to a new bundle or a package
|
||||||
NSString *installSource = [SUInstaller installSourcePathInUpdateFolder:updateDirectory forHost:host isPackage:&isPackage isGuided:NULL];
|
NSString *installSource = [SUInstaller installSourcePathInUpdateFolder:updateDirectory forHost:host isPackage:&isPackage isGuided:NULL];
|
||||||
if (installSource == nil) {
|
if (installSource == nil) {
|
||||||
SULog(@"No suitable install is found in the update. The update will be rejected.");
|
SULog(@"No suitable install is found in the update. The update will be rejected.");
|
||||||
validationCheckSuccess = NO;
|
return NO;
|
||||||
} else {
|
}
|
||||||
NSURL *installSourceURL = [NSURL fileURLWithPath:installSource];
|
|
||||||
|
NSURL *installSourceURL = [NSURL fileURLWithPath:installSource];
|
||||||
if (!prevalidatedDsaSignature) {
|
|
||||||
// Check to see if we have a package or bundle to validate
|
if (!prevalidatedDsaSignature) {
|
||||||
if (isPackage) {
|
// Check to see if we have a package or bundle to validate
|
||||||
// For package type updates, all we do is check if the DSA signature is valid
|
if (isPackage) {
|
||||||
validationCheckSuccess = [SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey];
|
// For package type updates, all we do is check if the DSA signature is valid
|
||||||
if (!validationCheckSuccess) {
|
BOOL validationCheckSuccess = [SUDSAVerifier validatePath:downloadPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey];
|
||||||
SULog(@"DSA signature validation of the package failed. The update contains an installer package, and valid DSA signatures are mandatory for all installer packages. The update will be rejected. Sign the installer with a valid DSA key or use an .app bundle update instead.");
|
if (!validationCheckSuccess) {
|
||||||
}
|
SULog(@"DSA signature validation of the package failed. The update contains an installer package, and valid DSA signatures are mandatory for all installer packages. The update will be rejected. Sign the installer with a valid DSA key or use an .app bundle update instead.");
|
||||||
} else {
|
|
||||||
// For application bundle updates, we check both the DSA and Apple code signing signatures
|
|
||||||
validationCheckSuccess = [self validateUpdateForHost:host downloadedToPath:downloadPath newBundleURL:installSourceURL DSASignature:DSASignature];
|
|
||||||
}
|
}
|
||||||
} else if (isPackage) {
|
return validationCheckSuccess;
|
||||||
// We shouldn't get here because we don't validate packages before extracting them currently
|
|
||||||
SULog(@"Error: not expecting to find package after being required to validate update before extraction");
|
|
||||||
validationCheckSuccess = NO;
|
|
||||||
} else {
|
} else {
|
||||||
// Because we already validated the DSA signature, this is just a consistency check to see
|
// For application bundle updates, we check both the DSA and Apple code signing signatures
|
||||||
// if the developer signed their application properly with their Apple ID
|
return [self validateUpdateForHost:host downloadedToPath:downloadPath newBundleURL:installSourceURL DSASignature:DSASignature];
|
||||||
// Currently, this case only gets hit for binary delta updates
|
}
|
||||||
NSError *error = nil;
|
} else if (isPackage) {
|
||||||
if ([SUCodeSigningVerifier bundleAtURLIsCodeSigned:installSourceURL] && ![SUCodeSigningVerifier codeSignatureIsValidAtBundleURL:installSourceURL error:&error]) {
|
// We shouldn't get here because we don't validate packages before extracting them currently
|
||||||
SULog(@"Failed to validate apple code sign signature on bundle after archive validation with error: %@", error);
|
SULog(@"Error: not expecting to find package after being required to validate update before extraction");
|
||||||
validationCheckSuccess = NO;
|
return NO;
|
||||||
} else {
|
} else {
|
||||||
validationCheckSuccess = YES;
|
// Because we already validated the DSA signature, this is just a consistency check to see
|
||||||
}
|
// if the developer signed their application properly with their Apple ID
|
||||||
|
// Currently, this case only gets hit for binary delta updates
|
||||||
|
NSError *error = nil;
|
||||||
|
if ([SUCodeSigningVerifier bundleAtURLIsCodeSigned:installSourceURL] && ![SUCodeSigningVerifier codeSignatureIsValidAtBundleURL:installSourceURL error:&error]) {
|
||||||
|
SULog(@"Failed to validate apple code sign signature on bundle after archive validation with error: %@", error);
|
||||||
|
return NO;
|
||||||
|
} else {
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return validationCheckSuccess;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,20 +135,20 @@
|
|||||||
SULog(@"No suitable bundle is found in the update. The update will be rejected.");
|
SULog(@"No suitable bundle is found in the update. The update will be rejected.");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *publicDSAKey = host.publicDSAKey;
|
NSString *publicDSAKey = host.publicDSAKey;
|
||||||
|
|
||||||
SUHost *newHost = [[SUHost alloc] initWithBundle:newBundle];
|
SUHost *newHost = [[SUHost alloc] initWithBundle:newBundle];
|
||||||
NSString *newPublicDSAKey = newHost.publicDSAKey;
|
NSString *newPublicDSAKey = newHost.publicDSAKey;
|
||||||
|
|
||||||
// Downgrade in DSA security should not be possible
|
// Downgrade in DSA security should not be possible
|
||||||
if (publicDSAKey != nil && newPublicDSAKey == nil) {
|
if (publicDSAKey != nil && newPublicDSAKey == nil) {
|
||||||
SULog(@"A public DSA key is found in the old bundle but no public DSA key is found in the new update. For security reasons, the update will be rejected.");
|
SULog(@"A public DSA key is found in the old bundle but no public DSA key is found in the new update. For security reasons, the update will be rejected.");
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL dsaKeysMatch = (publicDSAKey == nil || newPublicDSAKey == nil) ? NO : [publicDSAKey isEqualToString:newPublicDSAKey];
|
BOOL dsaKeysMatch = (publicDSAKey == nil || newPublicDSAKey == nil) ? NO : [publicDSAKey isEqualToString:newPublicDSAKey];
|
||||||
|
|
||||||
// If the new DSA key differs from the old, then this check is not a security measure, because the new key is not trusted.
|
// If the new DSA key differs from the old, then this check is not a security measure, because the new key is not trusted.
|
||||||
// In that case, the check ensures that the app author has correctly used DSA keys, so that the app will be updateable in the next version.
|
// In that case, the check ensures that the app author has correctly used DSA keys, so that the app will be updateable in the next version.
|
||||||
// However if the new and old DSA keys are the same, then this is a security measure.
|
// However if the new and old DSA keys are the same, then this is a security measure.
|
||||||
@@ -162,7 +160,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BOOL updateIsCodeSigned = [SUCodeSigningVerifier bundleAtURLIsCodeSigned:newHost.bundle.bundleURL];
|
BOOL updateIsCodeSigned = [SUCodeSigningVerifier bundleAtURLIsCodeSigned:newHost.bundle.bundleURL];
|
||||||
|
|
||||||
if (dsaKeysMatch) {
|
if (dsaKeysMatch) {
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if (updateIsCodeSigned && ![SUCodeSigningVerifier codeSignatureIsValidAtBundleURL:newHost.bundle.bundleURL error:&error]) {
|
if (updateIsCodeSigned && ![SUCodeSigningVerifier codeSignatureIsValidAtBundleURL:newHost.bundle.bundleURL error:&error]) {
|
||||||
@@ -171,21 +169,21 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BOOL hostIsCodeSigned = [SUCodeSigningVerifier bundleAtURLIsCodeSigned:host.bundle.bundleURL];
|
BOOL hostIsCodeSigned = [SUCodeSigningVerifier bundleAtURLIsCodeSigned:host.bundle.bundleURL];
|
||||||
|
|
||||||
NSString *dsaStatus = newPublicDSAKey ? @"has a new DSA key that doesn't match the previous one" : (publicDSAKey ? @"removes the DSA key" : @"isn't signed with a DSA key");
|
NSString *dsaStatus = newPublicDSAKey ? @"has a new DSA key that doesn't match the previous one" : (publicDSAKey ? @"removes the DSA key" : @"isn't signed with a DSA key");
|
||||||
if (!hostIsCodeSigned || !updateIsCodeSigned) {
|
if (!hostIsCodeSigned || !updateIsCodeSigned) {
|
||||||
NSString *acsStatus = !hostIsCodeSigned ? @"old app hasn't been signed with app Code Signing" : @"new app isn't signed with app Code Signing";
|
NSString *acsStatus = !hostIsCodeSigned ? @"old app hasn't been signed with app Code Signing" : @"new app isn't signed with app Code Signing";
|
||||||
SULog(@"The update archive %@, and the %@. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus, acsStatus);
|
SULog(@"The update archive %@, and the %@. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus, acsStatus);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if (![SUCodeSigningVerifier codeSignatureAtBundleURL:host.bundle.bundleURL matchesSignatureAtBundleURL:newHost.bundle.bundleURL error:&error]) {
|
if (![SUCodeSigningVerifier codeSignatureAtBundleURL:host.bundle.bundleURL matchesSignatureAtBundleURL:newHost.bundle.bundleURL error:&error]) {
|
||||||
SULog(@"The update archive %@, and the app is signed with a new Code Signing identity that doesn't match code signing of the original app: %@. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus, error);
|
SULog(@"The update archive %@, and the app is signed with a new Code Signing identity that doesn't match code signing of the original app: %@. At least one method of signature verification must be valid. The update will be rejected.", dsaStatus, error);
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-250
@@ -10,9 +10,9 @@
|
|||||||
#define SUUPDATER_H
|
#define SUUPDATER_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
#if __has_feature(modules)
|
||||||
@import Foundation;
|
@import Cocoa;
|
||||||
#else
|
#else
|
||||||
#import <Foundation/Foundation.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#endif
|
#endif
|
||||||
#import "SUExport.h"
|
#import "SUExport.h"
|
||||||
#import "SUVersionComparisonProtocol.h"
|
#import "SUVersionComparisonProtocol.h"
|
||||||
@@ -213,252 +213,4 @@ SU_EXPORT @interface SUUpdater : NSObject
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// SUUpdater Notifications for events that might be interesting to more than just the delegate
|
|
||||||
// The updater will be the notification object
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification;
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterDidFindValidUpdateNotification;
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterDidNotFindUpdateNotification;
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterWillRestartNotification;
|
|
||||||
#define SUUpdaterWillRelaunchApplicationNotification SUUpdaterWillRestartNotification;
|
|
||||||
#define SUUpdaterWillInstallUpdateNotification SUUpdaterWillRestartNotification;
|
|
||||||
|
|
||||||
// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification userInfo
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey;
|
|
||||||
// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo
|
|
||||||
SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
// SUUpdater Delegate:
|
|
||||||
// -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Provides methods to control the behavior of an SUUpdater object.
|
|
||||||
*/
|
|
||||||
@protocol SUUpdaterDelegate <NSObject>
|
|
||||||
@optional
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns whether to allow Sparkle to pop up.
|
|
||||||
|
|
||||||
For example, this may be used to prevent Sparkle from interrupting a setup assistant.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns additional parameters to append to the appcast URL's query string.
|
|
||||||
|
|
||||||
This is potentially based on whether or not Sparkle will also be sending along the system profile.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param sendingProfile Whether the system profile will also be sent.
|
|
||||||
|
|
||||||
\return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
|
|
||||||
*/
|
|
||||||
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns a custom appcast URL.
|
|
||||||
|
|
||||||
Override this to dynamically specify the entire URL.
|
|
||||||
|
|
||||||
An alternative may be to use SUUpdaterDelegate::feedParametersForUpdater:sendingSystemProfile:
|
|
||||||
and let the server handle what kind of feed to provide.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (NSString *)feedURLStringForUpdater:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns whether Sparkle should prompt the user about automatic update checks.
|
|
||||||
|
|
||||||
Use this to override the default behavior.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called after Sparkle has downloaded the appcast from the remote server.
|
|
||||||
|
|
||||||
Implement this if you want to do some special handling with the appcast once it finishes loading.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param appcast The appcast that was downloaded from the remote server.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns the item in the appcast corresponding to the update that should be installed.
|
|
||||||
|
|
||||||
If you're using special logic or extensions in your appcast,
|
|
||||||
implement this to use your own logic for finding a valid update, if any,
|
|
||||||
in the given appcast.
|
|
||||||
|
|
||||||
\param appcast The appcast that was downloaded from the remote server.
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called when a valid update is found by the update driver.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that is proposed to be installed.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called when a valid update is not found.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (void)updaterDidNotFindUpdate:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called immediately before downloading the specified update.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that is proposed to be downloaded.
|
|
||||||
\param request The mutable URL request that will be used to download the update.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called after the specified update failed to download.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that failed to download.
|
|
||||||
\param error The error generated by the failed download.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called when the user clicks the cancel button while and update is being downloaded.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (void)userDidCancelDownload:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called immediately before installing the specified update.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that is proposed to be installed.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns whether the relaunch should be delayed in order to perform other tasks.
|
|
||||||
|
|
||||||
This is not called if the user didn't relaunch on the previous update,
|
|
||||||
in that case it will immediately restart.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that is proposed to be installed.
|
|
||||||
\param invocation The invocation that must be completed with `[invocation invoke]` before continuing with the relaunch.
|
|
||||||
|
|
||||||
\return \c YES to delay the relaunch until \p invocation is invoked.
|
|
||||||
*/
|
|
||||||
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvoking:(NSInvocation *)invocation;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns whether the application should be relaunched at all.
|
|
||||||
|
|
||||||
Some apps \b cannot be relaunched under certain circumstances.
|
|
||||||
This method can be used to explicitly prevent a relaunch.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (BOOL)updaterShouldRelaunchApplication:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called immediately before relaunching.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns an object that compares version numbers to determine their arithmetic relation to each other.
|
|
||||||
|
|
||||||
This method allows you to provide a custom version comparator.
|
|
||||||
If you don't implement this method or return \c nil,
|
|
||||||
the standard version comparator will be used.
|
|
||||||
|
|
||||||
\sa SUStandardVersionComparator
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (id<SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns an object that formats version numbers for display to the user.
|
|
||||||
|
|
||||||
If you don't implement this method or return \c nil,
|
|
||||||
the standard version formatter will be used.
|
|
||||||
|
|
||||||
\sa SUUpdateAlert
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (id<SUVersionDisplay>)versionDisplayerForUpdater:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns the path which is used to relaunch the client after the update is installed.
|
|
||||||
|
|
||||||
The default is the path of the host bundle.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called before an updater shows a modal alert window,
|
|
||||||
to give the host the opportunity to hide attached windows that may get in the way.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (void)updaterWillShowModalAlert:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called after an updater shows a modal alert window,
|
|
||||||
to give the host the opportunity to hide attached windows that may get in the way.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
*/
|
|
||||||
- (void)updaterDidShowModalAlert:(SUUpdater *)updater;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called when an update is scheduled to be silently installed on quit.
|
|
||||||
This is after an update has been automatically downloaded in the background.
|
|
||||||
(i.e. SUUpdater::automaticallyDownloadsUpdates is YES)
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that is proposed to be installed.
|
|
||||||
\param invocation Can be used to trigger an immediate silent install and relaunch.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Calls after an update that was scheduled to be silently installed on quit has been canceled.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param item The appcast item corresponding to the update that was proposed to be installed.
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Called after an update is aborted due to an error.
|
|
||||||
|
|
||||||
\param updater The SUUpdater instance.
|
|
||||||
\param error The error that caused the abort
|
|
||||||
*/
|
|
||||||
- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Vendored
+26
-18
@@ -7,8 +7,11 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
#import "SUUpdater.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
|
#import "SUUpdaterPrivate.h"
|
||||||
|
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
|
#import "SUUpdatePermissionResponse.h"
|
||||||
#import "SUUpdatePermissionPrompt.h"
|
#import "SUUpdatePermissionPrompt.h"
|
||||||
|
|
||||||
#import "SUAutomaticUpdateDriver.h"
|
#import "SUAutomaticUpdateDriver.h"
|
||||||
@@ -18,7 +21,10 @@
|
|||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
#import "SULog.h"
|
#import "SULog.h"
|
||||||
#import "SUCodeSigningVerifier.h"
|
#import "SUCodeSigningVerifier.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
#include <SystemConfiguration/SystemConfiguration.h>
|
#include <SystemConfiguration/SystemConfiguration.h>
|
||||||
|
#import "SUSystemProfiler.h"
|
||||||
|
#import "SUSystemUpdateInfo.h"
|
||||||
|
|
||||||
NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification";
|
NSString *const SUUpdaterDidFinishLoadingAppCastNotification = @"SUUpdaterDidFinishLoadingAppCastNotification";
|
||||||
NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification";
|
NSString *const SUUpdaterDidFindValidUpdateNotification = @"SUUpdaterDidFindValidUpdateNotification";
|
||||||
@@ -27,7 +33,7 @@ NSString *const SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotific
|
|||||||
NSString *const SUUpdaterAppcastItemNotificationKey = @"SUUpdaterAppcastItemNotificationKey";
|
NSString *const SUUpdaterAppcastItemNotificationKey = @"SUUpdaterAppcastItemNotificationKey";
|
||||||
NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotificationKey";
|
NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotificationKey";
|
||||||
|
|
||||||
@interface SUUpdater () <SUUpdatePermissionPromptDelegate>
|
@interface SUUpdater () <SUUpdaterPrivate>
|
||||||
@property (strong) NSTimer *checkTimer;
|
@property (strong) NSTimer *checkTimer;
|
||||||
@property (strong) NSBundle *sparkleBundle;
|
@property (strong) NSBundle *sparkleBundle;
|
||||||
|
|
||||||
@@ -177,7 +183,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
return [self initForBundle:[NSBundle mainBundle]];
|
return [self initForBundle:[NSBundle mainBundle]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [self.host bundlePath], [self.host installationPath]]; }
|
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@>", [self class], [self.host bundlePath]]; }
|
||||||
|
|
||||||
- (void)startUpdateCycle
|
- (void)startUpdateCycle
|
||||||
{
|
{
|
||||||
@@ -204,12 +210,16 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldPrompt) {
|
if (shouldPrompt) {
|
||||||
NSArray *profileInfo = [self.host systemProfile];
|
NSArray *profileInfo = [SUSystemProfiler systemProfileArrayForHost:self.host];
|
||||||
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
|
// Always say we're sending the system profile here so that the delegate displays the parameters it would send.
|
||||||
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
if ([self.delegate respondsToSelector:@selector(feedParametersForUpdater:sendingSystemProfile:)]) {
|
||||||
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:YES]];
|
profileInfo = [profileInfo arrayByAddingObjectsFromArray:[self.delegate feedParametersForUpdater:self sendingSystemProfile:YES]];
|
||||||
}
|
}
|
||||||
[SUUpdatePermissionPrompt promptWithHost:self.host systemProfile:profileInfo delegate:self];
|
[SUUpdatePermissionPrompt promptWithHost:self.host systemProfile:profileInfo reply:^(SUUpdatePermissionResponse *response) {
|
||||||
|
[self updatePermissionRequestFinishedWithResponse:response];
|
||||||
|
// Schedule checks, but make sure we ignore the delayed call from KVO
|
||||||
|
[self resetUpdateCycle];
|
||||||
|
}];
|
||||||
// We start the update checks and register as observer for changes after the prompt finishes
|
// We start the update checks and register as observer for changes after the prompt finishes
|
||||||
} else {
|
} else {
|
||||||
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
|
// We check if the user's said they want updates, or they haven't said anything, and the default is set to checking.
|
||||||
@@ -217,11 +227,10 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updatePermissionPromptFinishedWithResult:(SUPermissionPromptResult)result
|
- (void)updatePermissionRequestFinishedWithResponse:(SUUpdatePermissionResponse *)response
|
||||||
{
|
{
|
||||||
[self setAutomaticallyChecksForUpdates:(result == SUAutomaticallyCheck)];
|
[self setAutomaticallyChecksForUpdates:response.automaticUpdateChecks];
|
||||||
// Schedule checks, but make sure we ignore the delayed call from KVO
|
[self setSendsSystemProfile:response.sendSystemProfile];
|
||||||
[self resetUpdateCycle];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateDriverDidFinish:(NSNotification *)note
|
- (void)updateDriverDidFinish:(NSNotification *)note
|
||||||
@@ -279,11 +288,6 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
[self checkForUpdatesWithDriver:theUpdateDriver];
|
[self checkForUpdatesWithDriver:theUpdateDriver];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)mayUpdateAndRestart
|
|
||||||
{
|
|
||||||
return (!self.delegate || ![self.delegate respondsToSelector:@selector(updaterShouldRelaunchApplication:)] || [self.delegate updaterShouldRelaunchApplication:self]);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (IBAction)checkForUpdates:(id)__unused sender
|
- (IBAction)checkForUpdates:(id)__unused sender
|
||||||
{
|
{
|
||||||
if (self.driver && [self.driver isInterruptible]) {
|
if (self.driver && [self.driver isInterruptible]) {
|
||||||
@@ -411,8 +415,8 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
|
|
||||||
- (BOOL)automaticallyDownloadsUpdates
|
- (BOOL)automaticallyDownloadsUpdates
|
||||||
{
|
{
|
||||||
// If the host doesn't allow automatic updates, don't ever let them happen
|
// If we aren't allowed automatic updates, don't ever let them happen
|
||||||
if (!self.host.allowsAutomaticUpdates) {
|
if (![SUSystemUpdateInfo systemAllowsAutomaticUpdatesForHost:self.host]) {
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,8 +439,12 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
|
|
||||||
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
|
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
|
||||||
NSString *appcastString = [self.host objectForKey:SUFeedURLKey];
|
NSString *appcastString = [self.host objectForKey:SUFeedURLKey];
|
||||||
if ([self.delegate respondsToSelector:@selector(feedURLStringForUpdater:)])
|
if ([self.delegate respondsToSelector:@selector(feedURLStringForUpdater:)]) {
|
||||||
appcastString = [self.delegate feedURLStringForUpdater:self];
|
NSString *delegateAppcastString = [self.delegate feedURLStringForUpdater:self];
|
||||||
|
if (delegateAppcastString != nil) {
|
||||||
|
appcastString = delegateAppcastString;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!appcastString) // Can't find an appcast string!
|
if (!appcastString) // Can't find an appcast string!
|
||||||
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the %@ key in either the Info.plist or the user defaults!", SUFeedURLKey];
|
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the %@ key in either the Info.plist or the user defaults!", SUFeedURLKey];
|
||||||
NSCharacterSet *quoteSet = [NSCharacterSet characterSetWithCharactersInString:@"\"\'"]; // Some feed publishers add quotes; strip 'em.
|
NSCharacterSet *quoteSet = [NSCharacterSet characterSetWithCharactersInString:@"\"\'"]; // Some feed publishers add quotes; strip 'em.
|
||||||
@@ -490,7 +498,7 @@ static NSString *const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaults
|
|||||||
}
|
}
|
||||||
if (sendingSystemProfile)
|
if (sendingSystemProfile)
|
||||||
{
|
{
|
||||||
parameters = [parameters arrayByAddingObjectsFromArray:[self.host systemProfile]];
|
parameters = [parameters arrayByAddingObjectsFromArray:[SUSystemProfiler systemProfileArrayForHost:self.host]];
|
||||||
[self.host setObject:[NSDate date] forUserDefaultsKey:SULastProfileSubmitDateKey];
|
[self.host setObject:[NSDate date] forUserDefaultsKey:SULastProfileSubmitDateKey];
|
||||||
}
|
}
|
||||||
if ([parameters count] == 0) { return baseFeedURL; }
|
if ([parameters count] == 0) { return baseFeedURL; }
|
||||||
|
|||||||
Vendored
+270
@@ -0,0 +1,270 @@
|
|||||||
|
//
|
||||||
|
// SUUpdaterDelegate.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Mayur Pawashe on 12/25/16.
|
||||||
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#if __has_feature(modules)
|
||||||
|
@import Foundation;
|
||||||
|
#else
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#import "SUExport.h"
|
||||||
|
|
||||||
|
@protocol SUVersionComparison, SUVersionDisplay;
|
||||||
|
@class SUUpdater, SUAppcast, SUAppcastItem;
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// SUUpdater Notifications for events that might be interesting to more than just the delegate
|
||||||
|
// The updater will be the notification object
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification;
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterDidFindValidUpdateNotification;
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterDidNotFindUpdateNotification;
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterWillRestartNotification;
|
||||||
|
#define SUUpdaterWillRelaunchApplicationNotification SUUpdaterWillRestartNotification;
|
||||||
|
#define SUUpdaterWillInstallUpdateNotification SUUpdaterWillRestartNotification;
|
||||||
|
|
||||||
|
// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification userInfo
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey;
|
||||||
|
// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo
|
||||||
|
SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// SUUpdater Delegate:
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Provides methods to control the behavior of an SUUpdater object.
|
||||||
|
*/
|
||||||
|
@protocol SUUpdaterDelegate <NSObject>
|
||||||
|
@optional
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether to allow Sparkle to pop up.
|
||||||
|
|
||||||
|
For example, this may be used to prevent Sparkle from interrupting a setup assistant.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns additional parameters to append to the appcast URL's query string.
|
||||||
|
|
||||||
|
This is potentially based on whether or not Sparkle will also be sending along the system profile.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param sendingProfile Whether the system profile will also be sent.
|
||||||
|
|
||||||
|
\return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
|
||||||
|
*/
|
||||||
|
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns a custom appcast URL.
|
||||||
|
|
||||||
|
Override this to dynamically specify the entire URL.
|
||||||
|
|
||||||
|
An alternative may be to use SUUpdaterDelegate::feedParametersForUpdater:sendingSystemProfile:
|
||||||
|
and let the server handle what kind of feed to provide.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (nullable NSString *)feedURLStringForUpdater:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether Sparkle should prompt the user about automatic update checks.
|
||||||
|
|
||||||
|
Use this to override the default behavior.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called after Sparkle has downloaded the appcast from the remote server.
|
||||||
|
|
||||||
|
Implement this if you want to do some special handling with the appcast once it finishes loading.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param appcast The appcast that was downloaded from the remote server.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the item in the appcast corresponding to the update that should be installed.
|
||||||
|
|
||||||
|
If you're using special logic or extensions in your appcast,
|
||||||
|
implement this to use your own logic for finding a valid update, if any,
|
||||||
|
in the given appcast.
|
||||||
|
|
||||||
|
\param appcast The appcast that was downloaded from the remote server.
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (nullable SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called when a valid update is found by the update driver.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that is proposed to be installed.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called when a valid update is not found.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (void)updaterDidNotFindUpdate:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called immediately before downloading the specified update.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that is proposed to be downloaded.
|
||||||
|
\param request The mutable URL request that will be used to download the update.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called after the specified update failed to download.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that failed to download.
|
||||||
|
\param error The error generated by the failed download.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called when the user clicks the cancel button while and update is being downloaded.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (void)userDidCancelDownload:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called immediately before installing the specified update.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that is proposed to be installed.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether the relaunch should be delayed in order to perform other tasks.
|
||||||
|
|
||||||
|
This is not called if the user didn't relaunch on the previous update,
|
||||||
|
in that case it will immediately restart.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that is proposed to be installed.
|
||||||
|
\param invocation The invocation that must be completed with `[invocation invoke]` before continuing with the relaunch.
|
||||||
|
|
||||||
|
\return \c YES to delay the relaunch until \p invocation is invoked.
|
||||||
|
*/
|
||||||
|
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvoking:(NSInvocation *)invocation;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns whether the application should be relaunched at all.
|
||||||
|
|
||||||
|
Some apps \b cannot be relaunched under certain circumstances.
|
||||||
|
This method can be used to explicitly prevent a relaunch.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (BOOL)updaterShouldRelaunchApplication:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called immediately before relaunching.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns an object that compares version numbers to determine their arithmetic relation to each other.
|
||||||
|
|
||||||
|
This method allows you to provide a custom version comparator.
|
||||||
|
If you don't implement this method or return \c nil,
|
||||||
|
the standard version comparator will be used.
|
||||||
|
|
||||||
|
\sa SUStandardVersionComparator
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (nullable id<SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns an object that formats version numbers for display to the user.
|
||||||
|
|
||||||
|
If you don't implement this method or return \c nil,
|
||||||
|
the standard version formatter will be used.
|
||||||
|
|
||||||
|
\sa SUUpdateAlert
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (nullable id<SUVersionDisplay>)versionDisplayerForUpdater:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Returns the path which is used to relaunch the client after the update is installed.
|
||||||
|
|
||||||
|
The default is the path of the host bundle.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (nullable NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called before an updater shows a modal alert window,
|
||||||
|
to give the host the opportunity to hide attached windows that may get in the way.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (void)updaterWillShowModalAlert:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called after an updater shows a modal alert window,
|
||||||
|
to give the host the opportunity to hide attached windows that may get in the way.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
*/
|
||||||
|
- (void)updaterDidShowModalAlert:(SUUpdater *)updater;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called when an update is scheduled to be silently installed on quit.
|
||||||
|
This is after an update has been automatically downloaded in the background.
|
||||||
|
(i.e. SUUpdater::automaticallyDownloadsUpdates is YES)
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that is proposed to be installed.
|
||||||
|
\param invocation Can be used to trigger an immediate silent install and relaunch.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Calls after an update that was scheduled to be silently installed on quit has been canceled.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param item The appcast item corresponding to the update that was proposed to be installed.
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Called after an update is aborted due to an error.
|
||||||
|
|
||||||
|
\param updater The SUUpdater instance.
|
||||||
|
\param error The error that caused the abort
|
||||||
|
*/
|
||||||
|
- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
Vendored
+23
@@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// SUUpdaterPrivate.h
|
||||||
|
// Sparkle
|
||||||
|
//
|
||||||
|
// Created by Andy Matuschak on 5/9/11.
|
||||||
|
// Copyright 2011 Andy Matuschak. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
@protocol SUUpdaterDelegate;
|
||||||
|
|
||||||
|
@protocol SUUpdaterPrivate <NSObject>
|
||||||
|
|
||||||
|
@property (unsafe_unretained) IBOutlet id<SUUpdaterDelegate> delegate;
|
||||||
|
|
||||||
|
@property (nonatomic, copy) NSString *userAgentString;
|
||||||
|
|
||||||
|
@property (copy) NSDictionary *httpHeaders;
|
||||||
|
|
||||||
|
@property (nonatomic, copy) NSString *decryptionPassword;
|
||||||
|
|
||||||
|
@property (strong, readonly) NSBundle *sparkleBundle;
|
||||||
|
|
||||||
|
@end
|
||||||
Vendored
-15
@@ -1,15 +0,0 @@
|
|||||||
//
|
|
||||||
// SUUpdater_Private.h
|
|
||||||
// Sparkle
|
|
||||||
//
|
|
||||||
// Created by Andy Matuschak on 5/9/11.
|
|
||||||
// Copyright 2011 Andy Matuschak. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "SUUpdater.h"
|
|
||||||
|
|
||||||
@interface SUUpdater (Private)
|
|
||||||
|
|
||||||
@property (readonly) BOOL mayUpdateAndRestart;
|
|
||||||
|
|
||||||
@end
|
|
||||||
-1
@@ -9,7 +9,6 @@
|
|||||||
#ifndef SUUSERINITIATEDUPDATEDRIVER_H
|
#ifndef SUUSERINITIATEDUPDATEDRIVER_H
|
||||||
#define SUUSERINITIATEDUPDATEDRIVER_H
|
#define SUUSERINITIATEDUPDATEDRIVER_H
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUUIBasedUpdateDriver.h"
|
#import "SUUIBasedUpdateDriver.h"
|
||||||
|
|
||||||
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver
|
@interface SUUserInitiatedUpdateDriver : SUUIBasedUpdateDriver
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#import "SUStatusController.h"
|
#import "SUStatusController.h"
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
|
#import "SULocalizations.h"
|
||||||
|
#import "SUApplicationInfo.h"
|
||||||
|
|
||||||
@interface SUUserInitiatedUpdateDriver ()
|
@interface SUUserInitiatedUpdateDriver ()
|
||||||
|
|
||||||
@@ -49,7 +51,7 @@
|
|||||||
|
|
||||||
// For background applications, obtain focus.
|
// For background applications, obtain focus.
|
||||||
// Useful if the update check is requested from another app like System Preferences.
|
// Useful if the update check is requested from another app like System Preferences.
|
||||||
if ([aHost isBackgroundApplication])
|
if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]])
|
||||||
{
|
{
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -10,12 +10,14 @@
|
|||||||
#define SUVERSIONCOMPARISONPROTOCOL_H
|
#define SUVERSIONCOMPARISONPROTOCOL_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
#if __has_feature(modules)
|
||||||
@import Cocoa;
|
@import Foundation;
|
||||||
#else
|
#else
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
#endif
|
||||||
#import "SUExport.h"
|
#import "SUExport.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Provides version comparison facilities for Sparkle.
|
Provides version comparison facilities for Sparkle.
|
||||||
*/
|
*/
|
||||||
@@ -31,4 +33,5 @@
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
#endif
|
#endif
|
||||||
Vendored
+3
-3
@@ -7,9 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#if __has_feature(modules)
|
#if __has_feature(modules)
|
||||||
@import Cocoa;
|
@import Foundation;
|
||||||
#else
|
#else
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#endif
|
#endif
|
||||||
#import "SUExport.h"
|
#import "SUExport.h"
|
||||||
|
|
||||||
@@ -24,6 +24,6 @@
|
|||||||
Both versions are provided so that important distinguishing information
|
Both versions are provided so that important distinguishing information
|
||||||
can be displayed while also leaving out unnecessary/confusing parts.
|
can be displayed while also leaving out unnecessary/confusing parts.
|
||||||
*/
|
*/
|
||||||
- (void)formatVersion:(NSString **)inOutVersionA andVersion:(NSString **)inOutVersionB;
|
- (void)formatVersion:(NSString *_Nonnull*_Nonnull)inOutVersionA andVersion:(NSString *_Nonnull*_Nonnull)inOutVersionB;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Vendored
-20
@@ -1,20 +0,0 @@
|
|||||||
//
|
|
||||||
// SUWindowController.h
|
|
||||||
// Sparkle
|
|
||||||
//
|
|
||||||
// Created by Andy Matuschak on 2/13/08.
|
|
||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef SUWINDOWCONTROLLER_H
|
|
||||||
#define SUWINDOWCONTROLLER_H
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
|
|
||||||
@class SUHost;
|
|
||||||
@interface SUWindowController : NSWindowController
|
|
||||||
// We use this instead of plain old NSWindowController initWithWindowNibName so that we'll be able to find the right path when running in a bundle loaded from another app.
|
|
||||||
- (instancetype)initWithWindowNibName:(NSString *)nibName;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Vendored
-20
@@ -1,20 +0,0 @@
|
|||||||
//
|
|
||||||
// SUWindowController.m
|
|
||||||
// Sparkle
|
|
||||||
//
|
|
||||||
// Created by Andy Matuschak on 2/13/08.
|
|
||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "SUWindowController.h"
|
|
||||||
#import "SUHost.h"
|
|
||||||
|
|
||||||
@implementation SUWindowController
|
|
||||||
|
|
||||||
- (instancetype)initWithWindowNibName:(NSString *)nibName
|
|
||||||
{
|
|
||||||
self = [super initWithWindowNibName:nibName owner:self];
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
Vendored
+1
-6
@@ -9,12 +9,6 @@
|
|||||||
#ifndef SPARKLE_H
|
#ifndef SPARKLE_H
|
||||||
#define SPARKLE_H
|
#define SPARKLE_H
|
||||||
|
|
||||||
#if __has_feature(modules)
|
|
||||||
@import Cocoa;
|
|
||||||
#else
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless
|
// This list should include the shared headers. It doesn't matter if some of them aren't shared (unless
|
||||||
// there are name-space collisions) so we can list all of them to start with:
|
// there are name-space collisions) so we can list all of them to start with:
|
||||||
|
|
||||||
@@ -22,6 +16,7 @@
|
|||||||
#import "SUAppcastItem.h"
|
#import "SUAppcastItem.h"
|
||||||
#import "SUStandardVersionComparator.h"
|
#import "SUStandardVersionComparator.h"
|
||||||
#import "SUUpdater.h"
|
#import "SUUpdater.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
#import "SUVersionComparisonProtocol.h"
|
#import "SUVersionComparisonProtocol.h"
|
||||||
#import "SUVersionDisplayProtocol.h"
|
#import "SUVersionDisplayProtocol.h"
|
||||||
#import "SUErrors.h"
|
#import "SUErrors.h"
|
||||||
|
|||||||
Vendored
-27
@@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// Sparkle.pch
|
|
||||||
// Sparkle
|
|
||||||
//
|
|
||||||
// Created by Andy Matuschak on 7/23/08.
|
|
||||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef __OBJC__
|
|
||||||
|
|
||||||
#if !defined(__clang_major__) || __clang_major__ < 7
|
|
||||||
#define __nonnull
|
|
||||||
#define __nullable
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import "SUConstants.h"
|
|
||||||
#import "SUErrors.h"
|
|
||||||
|
|
||||||
#define SULocalizedString(key, comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", (NSBundle *__nonnull)([NSBundle bundleWithIdentifier:SUBundleIdentifier] ? [NSBundle bundleWithIdentifier:SUBundleIdentifier] : [NSBundle mainBundle]), comment)
|
|
||||||
|
|
||||||
// Work around a warning generated by some versions of Xcode that we still support,
|
|
||||||
// when using NSParameterAssert
|
|
||||||
#define SUParameterAssert(condition) \
|
|
||||||
NSAssert((condition), @"Invalid parameter not satisfying: %@", @(#condition))
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1212" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment version="1060" identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<development version="5000" identifier="xcode"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||||
@@ -97,12 +96,14 @@
|
|||||||
<menuItem isSeparatorItem="YES" id="74">
|
<menuItem isSeparatorItem="YES" id="74">
|
||||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="Page Setup…" keyEquivalent="P" id="77">
|
<menuItem title="Page Setup…" keyEquivalent="p" id="77">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" control="YES" option="YES" command="YES"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="runPageLayout:" target="-1" id="87"/>
|
<action selector="runPageLayout:" target="-1" id="87"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem title="Print…" keyEquivalent="p" id="78">
|
<menuItem title="Print…" keyEquivalent="p" id="78">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask" shift="YES" control="YES" option="YES" command="YES"/>
|
||||||
<connections>
|
<connections>
|
||||||
<action selector="print:" target="-1" id="86"/>
|
<action selector="print:" target="-1" id="86"/>
|
||||||
</connections>
|
</connections>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
@interface SUTestApplicationDelegate : NSObject <NSApplicationDelegate>
|
@interface SUTestApplicationDelegate : NSObject <NSApplicationDelegate>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<key>SUEnableSystemProfiling</key>
|
<key>SUEnableSystemProfiling</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>SUFeedURL</key>
|
<key>SUFeedURL</key>
|
||||||
<string>http://0.0.0.0:1337/sparkletestcast.xml</string>
|
<string>http://localhost:1337/sparkletestcast.xml</string>
|
||||||
<key>SUPublicDSAKeyFile</key>
|
<key>SUPublicDSAKeyFile</key>
|
||||||
<string>test_app_only_dsa_pub.pem</string>
|
<string>test_app_only_dsa_pub.pem</string>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
]]>
|
]]>
|
||||||
</description>
|
</description>
|
||||||
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" sparkle:version="2.0" length="$INSERT_ARCHIVE_LENGTH" type="application/octet-stream" sparkle:dsaSignature="$INSERT_DSA_SIGNATURE" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="2.0" length="$INSERT_ARCHIVE_LENGTH" type="application/octet-stream" sparkle:dsaSignature="$INSERT_DSA_SIGNATURE" />
|
||||||
</item>
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
@@ -6,21 +6,21 @@
|
|||||||
<title>Version 2.0</title>
|
<title>Version 2.0</title>
|
||||||
<description>desc</description>
|
<description>desc</description>
|
||||||
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" sparkle:version="2.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="2.0" />
|
||||||
</item>
|
</item>
|
||||||
<!-- The best chosen release -->
|
<!-- The best chosen release -->
|
||||||
<item>
|
<item>
|
||||||
<title>Version 3.0</title>
|
<title>Version 3.0</title>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" sparkle:version="3.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="3.0" />
|
||||||
<sparkle:deltas>
|
<sparkle:deltas>
|
||||||
<enclosure url="http://0.0.0.0:1337/3.0_from_2.0.patch"
|
<enclosure url="http://localhost:1337/3.0_from_2.0.patch"
|
||||||
sparkle:version="3.0"
|
sparkle:version="3.0"
|
||||||
sparkle:deltaFrom="2.0"
|
sparkle:deltaFrom="2.0"
|
||||||
length="1235"
|
length="1235"
|
||||||
type="application/octet-stream"
|
type="application/octet-stream"
|
||||||
sparkle:dsaSignature="..." />
|
sparkle:dsaSignature="..." />
|
||||||
|
|
||||||
<enclosure url="http://0.0.0.0:1337/3.0_from_1.0.patch"
|
<enclosure url="http://localhost:1337/3.0_from_1.0.patch"
|
||||||
sparkle:version="3.0"
|
sparkle:version="3.0"
|
||||||
sparkle:deltaFrom="1.0"
|
sparkle:deltaFrom="1.0"
|
||||||
length="1485"
|
length="1485"
|
||||||
@@ -32,13 +32,13 @@
|
|||||||
<item>
|
<item>
|
||||||
<title>Version 4.0</title>
|
<title>Version 4.0</title>
|
||||||
<pubDate>Sat, 26 Jul 2014 15:20:13 +0000</pubDate>
|
<pubDate>Sat, 26 Jul 2014 15:20:13 +0000</pubDate>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" sparkle:version="4.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="4.0" />
|
||||||
<sparkle:minimumSystemVersion>17.0.0</sparkle:minimumSystemVersion>
|
<sparkle:minimumSystemVersion>17.0.0</sparkle:minimumSystemVersion>
|
||||||
</item>
|
</item>
|
||||||
<!-- A joke release testing maximumSystemVersion -->
|
<!-- A joke release testing maximumSystemVersion -->
|
||||||
<item>
|
<item>
|
||||||
<title>Version 5.0</title>
|
<title>Version 5.0</title>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" sparkle:version="5.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" sparkle:version="5.0" />
|
||||||
<sparkle:maximumSystemVersion>2.0.0</sparkle:maximumSystemVersion>
|
<sparkle:maximumSystemVersion>2.0.0</sparkle:maximumSystemVersion>
|
||||||
</item>
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
<title>Version 3.0</title>
|
<title>Version 3.0</title>
|
||||||
<pubDate>Sat, 26 Jul 2014 15:20:12 +0000</pubDate>
|
<pubDate>Sat, 26 Jul 2014 15:20:12 +0000</pubDate>
|
||||||
<customNS:releaseNotesLink>https://sparkle-project.org/#works</customNS:releaseNotesLink>
|
<customNS:releaseNotesLink>https://sparkle-project.org/#works</customNS:releaseNotesLink>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" customNS:version="3.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" customNS:version="3.0" />
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<title>Version 2.0</title>
|
<title>Version 2.0</title>
|
||||||
<description>desc</description>
|
<description>desc</description>
|
||||||
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
<pubDate>Sat, 26 Jul 2014 15:20:11 +0000</pubDate>
|
||||||
<enclosure url="http://0.0.0.0:1337/Sparkle_Test_App.zip" customNS:version="2.0" />
|
<enclosure url="http://localhost:1337/Sparkle_Test_App.zip" customNS:version="2.0" />
|
||||||
</item>
|
</item>
|
||||||
</channel>
|
</channel>
|
||||||
</rss>
|
</rss>
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright (c) 2014 Sparkle Project. All rights reserved.
|
// Copyright (c) 2014 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
#import "SUBinaryDeltaCommon.h"
|
#import "SUBinaryDeltaCommon.h"
|
||||||
#import "SUBinaryDeltaCreate.h"
|
#import "SUBinaryDeltaCreate.h"
|
||||||
@@ -69,7 +69,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
|||||||
NSError *applyDiffError = nil;
|
NSError *applyDiffError = nil;
|
||||||
BOOL appliedDiff = NO;
|
BOOL appliedDiff = NO;
|
||||||
if (createdDiff) {
|
if (createdDiff) {
|
||||||
if (applyBinaryDelta(sourceDirectory, patchDirectory, diffFile, NO, &applyDiffError)) {
|
if (applyBinaryDelta(sourceDirectory, patchDirectory, diffFile, NO, ^(__unused double progress){}, &applyDiffError)) {
|
||||||
appliedDiff = YES;
|
appliedDiff = YES;
|
||||||
} else {
|
} else {
|
||||||
NSLog(@"Applying binary diff failed with error: %@", applyDiffError);
|
NSLog(@"Applying binary diff failed with error: %@", applyDiffError);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
#import "SUCodeSigningVerifier.h"
|
#import "SUCodeSigningVerifier.h"
|
||||||
#import "SUFileManager.h"
|
#import "SUFileManager.h"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// Copyright (c) 2014 Sparkle Project. All rights reserved.
|
// Copyright (c) 2014 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
#import "SUDSAVerifier.h"
|
#import "SUDSAVerifier.h"
|
||||||
|
|
||||||
|
|||||||
@@ -14,28 +14,28 @@ class SUFileManagerTest: XCTestCase
|
|||||||
{
|
{
|
||||||
let fileManager = SUFileManager.default()
|
let fileManager = SUFileManager.default()
|
||||||
|
|
||||||
let tempDirectoryURL = try! fileManager?.makeTemporaryDirectory(withPreferredName: "Sparkle Unit Test Data", appropriateForDirectoryURL: URL(fileURLWithPath: NSHomeDirectory()))
|
let tempDirectoryURL = (try! fileManager.makeTemporaryDirectory(withPreferredName: "Sparkle Unit Test Data", appropriateForDirectoryURL: URL(fileURLWithPath: NSHomeDirectory())))
|
||||||
|
|
||||||
defer {
|
defer {
|
||||||
try! fileManager?.removeItem(at: tempDirectoryURL)
|
try! fileManager.removeItem(at: tempDirectoryURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
let ordinaryFileURL = tempDirectoryURL?.appendingPathComponent("a file written by sparkles unit tests")
|
let ordinaryFileURL = tempDirectoryURL.appendingPathComponent("a file written by sparkles unit tests")
|
||||||
try! "foo".data(using: String.Encoding.utf8)!.write(to: ordinaryFileURL!, options: .atomic)
|
try! "foo".data(using: String.Encoding.utf8)!.write(to: ordinaryFileURL, options: .atomic)
|
||||||
|
|
||||||
let directoryURL = tempDirectoryURL?.appendingPathComponent("a directory written by sparkles unit tests")
|
let directoryURL = tempDirectoryURL.appendingPathComponent("a directory written by sparkles unit tests")
|
||||||
try! FileManager.default.createDirectory(at: directoryURL!, withIntermediateDirectories: false, attributes: nil)
|
try! FileManager.default.createDirectory(at: directoryURL, withIntermediateDirectories: false, attributes: nil)
|
||||||
|
|
||||||
let fileInDirectoryURL = directoryURL?.appendingPathComponent("a file inside a directory written by sparkles unit tests")
|
let fileInDirectoryURL = directoryURL.appendingPathComponent("a file inside a directory written by sparkles unit tests")
|
||||||
try! "bar baz".data(using: String.Encoding.utf8)!.write(to: fileInDirectoryURL!, options: .atomic)
|
try! "bar baz".data(using: String.Encoding.utf8)!.write(to: fileInDirectoryURL, options: .atomic)
|
||||||
|
|
||||||
let validSymlinkURL = tempDirectoryURL?.appendingPathComponent("symlink test")
|
let validSymlinkURL = tempDirectoryURL.appendingPathComponent("symlink test")
|
||||||
try! FileManager.default.createSymbolicLink(at: validSymlinkURL!, withDestinationURL: directoryURL!)
|
try! FileManager.default.createSymbolicLink(at: validSymlinkURL, withDestinationURL: directoryURL)
|
||||||
|
|
||||||
let invalidSymlinkURL = tempDirectoryURL?.appendingPathComponent("symlink test 2")
|
let invalidSymlinkURL = tempDirectoryURL.appendingPathComponent("symlink test 2")
|
||||||
try! FileManager.default.createSymbolicLink(at: invalidSymlinkURL!, withDestinationURL: (tempDirectoryURL?.appendingPathComponent("does not exist"))!)
|
try! FileManager.default.createSymbolicLink(at: invalidSymlinkURL, withDestinationURL: (tempDirectoryURL.appendingPathComponent("does not exist")))
|
||||||
|
|
||||||
testBlock(fileManager!, tempDirectoryURL!, ordinaryFileURL!, directoryURL!, fileInDirectoryURL!, validSymlinkURL!, invalidSymlinkURL!)
|
testBlock(fileManager, tempDirectoryURL, ordinaryFileURL, directoryURL, fileInDirectoryURL, validSymlinkURL, invalidSymlinkURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testMoveFiles()
|
func testMoveFiles()
|
||||||
@@ -311,6 +311,6 @@ class SUFileManagerTest: XCTestCase
|
|||||||
func testAcquireBadAuthorization()
|
func testAcquireBadAuthorization()
|
||||||
{
|
{
|
||||||
let fileManager = SUFileManager.default()
|
let fileManager = SUFileManager.default()
|
||||||
XCTAssertNil(try? fileManager?._acquireAuthorization())
|
XCTAssertNil(try? fileManager._acquireAuthorization())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+20
-6
@@ -6,10 +6,11 @@
|
|||||||
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
// Copyright (c) 2015 Sparkle Project. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
#import "SUHost.h"
|
#import "SUHost.h"
|
||||||
#import "SUInstaller.h"
|
#import "SUInstaller.h"
|
||||||
|
#import "SUInstallerProtocol.h"
|
||||||
#import <unistd.h>
|
#import <unistd.h>
|
||||||
|
|
||||||
@interface SUInstallerTest : XCTestCase
|
@interface SUInstallerTest : XCTestCase
|
||||||
@@ -56,14 +57,27 @@
|
|||||||
NSString *fileOperationToolPath = [bundle pathForResource:@""SPARKLE_FILEOP_TOOL_NAME ofType:@""];
|
NSString *fileOperationToolPath = [bundle pathForResource:@""SPARKLE_FILEOP_TOOL_NAME ofType:@""];
|
||||||
XCTAssertNotNil(fileOperationToolPath);
|
XCTAssertNotNil(fileOperationToolPath);
|
||||||
|
|
||||||
[SUInstaller installFromUpdateFolder:[path stringByDeletingLastPathComponent] overHost:host installationPath:@"/tmp" fileOperationToolPath:fileOperationToolPath versionComparator:nil completionHandler:^(NSError *error) {
|
NSError *installerError = nil;
|
||||||
if (error != nil) {
|
id<SUInstallerProtocol> installer = [SUInstaller installerForHost:host fileOperationToolPath:fileOperationToolPath updateDirectory:[path stringByDeletingLastPathComponent] error:&installerError];
|
||||||
NSLog(@"Underlying error: %@", [error.userInfo objectForKey:NSUnderlyingErrorKey]);
|
|
||||||
|
if (installer == nil) {
|
||||||
|
XCTFail(@"Failed to retrieve installer: %@", installerError);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
|
NSError *initialInstallationError = nil;
|
||||||
|
if (![installer performInitialInstallation:&initialInstallationError]) {
|
||||||
|
XCTFail(@"Failed to perform initial installation: %@", initialInstallationError);
|
||||||
}
|
}
|
||||||
XCTAssertNil(error);
|
|
||||||
|
NSError *finalInstallationError = nil;
|
||||||
|
if (![installer performFinalInstallation:&finalInstallationError]) {
|
||||||
|
XCTFail(@"Failed to perform final installation with underlying error = %@ ; error = %@", [finalInstallationError.userInfo objectForKey:NSUnderlyingErrorKey], finalInstallationError);
|
||||||
|
}
|
||||||
|
|
||||||
XCTAssertTrue([fm fileExistsAtPath:expectedDestination isDirectory:nil]);
|
XCTAssertTrue([fm fileExistsAtPath:expectedDestination isDirectory:nil]);
|
||||||
[done fulfill];
|
[done fulfill];
|
||||||
}];
|
});
|
||||||
|
|
||||||
[self waitForExpectationsWithTimeout:40 handler:nil];
|
[self waitForExpectationsWithTimeout:40 handler:nil];
|
||||||
[fm removeItemAtPath:expectedDestination error:nil];
|
[fm removeItemAtPath:expectedDestination error:nil];
|
||||||
|
|||||||
@@ -13,48 +13,48 @@ class SUSpotlightImporterTest: XCTestCase
|
|||||||
func testUpdatingSpotlightBundles()
|
func testUpdatingSpotlightBundles()
|
||||||
{
|
{
|
||||||
let fileManager = SUFileManager.default()
|
let fileManager = SUFileManager.default()
|
||||||
let tempDirectoryURL = try! fileManager?.makeTemporaryDirectory(withPreferredName: "Sparkle Unit Test Data", appropriateForDirectoryURL: URL(fileURLWithPath: NSHomeDirectory()))
|
let tempDirectoryURL = try! fileManager.makeTemporaryDirectory(withPreferredName: "Sparkle Unit Test Data", appropriateForDirectoryURL: URL(fileURLWithPath: NSHomeDirectory()))
|
||||||
|
|
||||||
let bundleDirectory = tempDirectoryURL?.appendingPathComponent("bundle.app")
|
let bundleDirectory = tempDirectoryURL.appendingPathComponent("bundle.app")
|
||||||
try! fileManager?.makeDirectory(at: bundleDirectory)
|
try! fileManager.makeDirectory(at: bundleDirectory)
|
||||||
|
|
||||||
let innerDirectory = bundleDirectory?.appendingPathComponent("foo")
|
let innerDirectory = bundleDirectory.appendingPathComponent("foo")
|
||||||
try! fileManager?.makeDirectory(at: innerDirectory)
|
try! fileManager.makeDirectory(at: innerDirectory)
|
||||||
try! Data().write(to: (bundleDirectory?.appendingPathComponent("bar"))!, options: .atomicWrite)
|
try! Data().write(to: (bundleDirectory.appendingPathComponent("bar")), options: .atomicWrite)
|
||||||
|
|
||||||
let importerDirectory = innerDirectory?.appendingPathComponent("baz.mdimporter")
|
let importerDirectory = innerDirectory.appendingPathComponent("baz.mdimporter")
|
||||||
|
|
||||||
try! fileManager?.makeDirectory(at: importerDirectory)
|
try! fileManager.makeDirectory(at: importerDirectory)
|
||||||
try! fileManager?.makeDirectory(at: innerDirectory?.appendingPathComponent("flag"))
|
try! fileManager.makeDirectory(at: innerDirectory.appendingPathComponent("flag"))
|
||||||
|
|
||||||
try! Data().write(to: (importerDirectory?.appendingPathComponent("file"))!, options: .atomicWrite)
|
try! Data().write(to: (importerDirectory.appendingPathComponent("file")), options: .atomicWrite)
|
||||||
|
|
||||||
let oldFooDirectoryAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory!.path)
|
let oldFooDirectoryAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory.path)
|
||||||
let oldBarFileAttributes = try! FileManager.default.attributesOfItem(atPath: bundleDirectory!.appendingPathComponent("bar").path)
|
let oldBarFileAttributes = try! FileManager.default.attributesOfItem(atPath: bundleDirectory.appendingPathComponent("bar").path)
|
||||||
let oldImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory!.path)
|
let oldImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory.path)
|
||||||
let oldFlagAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory!.appendingPathComponent("flag").path)
|
let oldFlagAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory.appendingPathComponent("flag").path)
|
||||||
let oldFileInImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory!.appendingPathComponent("file").path)
|
let oldFileInImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory.appendingPathComponent("file").path)
|
||||||
|
|
||||||
sleep(1) // wait for clock to advance
|
sleep(1) // wait for clock to advance
|
||||||
|
|
||||||
// Update spotlight bundles
|
// Update spotlight bundles
|
||||||
SUBinaryDeltaUnarchiver.updateSpotlightImporters(atBundlePath: bundleDirectory!.path)
|
SUBinaryDeltaUnarchiver.updateSpotlightImporters(atBundlePath: bundleDirectory.path)
|
||||||
|
|
||||||
let newFooDirectoryAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory!.path)
|
let newFooDirectoryAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory.path)
|
||||||
XCTAssertEqual((newFooDirectoryAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFooDirectoryAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
XCTAssertEqual((newFooDirectoryAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFooDirectoryAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
||||||
|
|
||||||
let newBarFileAttributes = try! FileManager.default.attributesOfItem(atPath: bundleDirectory!.appendingPathComponent("bar").path)
|
let newBarFileAttributes = try! FileManager.default.attributesOfItem(atPath: bundleDirectory.appendingPathComponent("bar").path)
|
||||||
XCTAssertEqual((newBarFileAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldBarFileAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
XCTAssertEqual((newBarFileAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldBarFileAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
||||||
|
|
||||||
let newImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory!.path)
|
let newImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory.path)
|
||||||
XCTAssertGreaterThan((newImporterAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldImporterAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
XCTAssertGreaterThan((newImporterAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldImporterAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
||||||
|
|
||||||
let newFlagAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory!.appendingPathComponent("flag").path)
|
let newFlagAttributes = try! FileManager.default.attributesOfItem(atPath: innerDirectory.appendingPathComponent("flag").path)
|
||||||
XCTAssertEqual((newFlagAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFlagAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
XCTAssertEqual((newFlagAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFlagAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
||||||
|
|
||||||
let newFileInImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory!.appendingPathComponent("file").path)
|
let newFileInImporterAttributes = try! FileManager.default.attributesOfItem(atPath: importerDirectory.appendingPathComponent("file").path)
|
||||||
XCTAssertEqual((newFileInImporterAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFileInImporterAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
XCTAssertEqual((newFileInImporterAttributes[FileAttributeKey.modificationDate] as! Date).timeIntervalSince(oldFileInImporterAttributes[FileAttributeKey.modificationDate] as! Date), 0)
|
||||||
|
|
||||||
try! fileManager?.removeItem(at: tempDirectoryURL)
|
try! fileManager.removeItem(at: tempDirectoryURL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,30 +8,13 @@
|
|||||||
|
|
||||||
import XCTest
|
import XCTest
|
||||||
|
|
||||||
class SUUnarchiverTest: XCTestCase, SUUnarchiverDelegate
|
class SUUnarchiverTest: XCTestCase
|
||||||
{
|
{
|
||||||
var password: String? = nil
|
var password: String? = nil
|
||||||
var unarchivedExpectation: XCTestExpectation? = nil
|
var unarchivedSuccessExpectation: XCTestExpectation? = nil
|
||||||
var unarchivedResult: Bool = false
|
var unarchivedFailureExpectation: XCTestExpectation? = nil
|
||||||
|
|
||||||
func unarchiver(_ unarchiver: SUUnarchiver!, extractedProgress progress: Double)
|
func unarchiveTestAppWithExtension(_ archiveExtension: String) {
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
func unarchiverDidFail(_ unarchiver: SUUnarchiver!)
|
|
||||||
{
|
|
||||||
self.unarchivedResult = false
|
|
||||||
self.unarchivedExpectation!.fulfill()
|
|
||||||
}
|
|
||||||
|
|
||||||
func unarchiverDidFinish(_ unarchiver: SUUnarchiver!)
|
|
||||||
{
|
|
||||||
self.unarchivedResult = true
|
|
||||||
self.unarchivedExpectation!.fulfill()
|
|
||||||
}
|
|
||||||
|
|
||||||
func unarchiveTestAppWithExtension(_ archiveExtension: String)
|
|
||||||
{
|
|
||||||
let appName = "SparkleTestCodeSignApp"
|
let appName = "SparkleTestCodeSignApp"
|
||||||
let archiveResourceURL = Bundle(for: type(of: self)).url(forResource: appName, withExtension: archiveExtension)!
|
let archiveResourceURL = Bundle(for: type(of: self)).url(forResource: appName, withExtension: archiveExtension)!
|
||||||
|
|
||||||
@@ -42,26 +25,46 @@ class SUUnarchiverTest: XCTestCase, SUUnarchiverDelegate
|
|||||||
try! fileManager.removeItem(at: tempDirectoryURL)
|
try! fileManager.removeItem(at: tempDirectoryURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
|
||||||
|
self.unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
|
||||||
|
|
||||||
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
|
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
|
||||||
let extractedAppURL = tempDirectoryURL.appendingPathComponent(appName).appendingPathExtension("app")
|
let extractedAppURL = tempDirectoryURL.appendingPathComponent(appName).appendingPathExtension("app")
|
||||||
|
|
||||||
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
|
|
||||||
|
|
||||||
self.unarchivedExpectation = super.expectation(description: "Unarchived Application (format: \(archiveExtension))")
|
|
||||||
|
|
||||||
let unarchiver = SUUnarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, withPassword: self.password)
|
|
||||||
|
|
||||||
unarchiver?.delegate = self
|
self.unarchiveTestSuccessAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, tempArchiveURL: tempArchiveURL, archiveResourceURL: archiveResourceURL);
|
||||||
unarchiver?.start()
|
self.unarchiveTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL);
|
||||||
|
|
||||||
super.waitForExpectations(timeout: 7.0, handler: nil)
|
super.waitForExpectations(timeout: 7.0, handler: nil)
|
||||||
|
|
||||||
XCTAssertTrue(self.unarchivedResult)
|
|
||||||
XCTAssertTrue(fileManager.fileExists(atPath: extractedAppURL.path))
|
XCTAssertTrue(fileManager.fileExists(atPath: extractedAppURL.path))
|
||||||
|
|
||||||
XCTAssertEqual("6a60ab31430cfca8fb499a884f4a29f73e59b472", hashOfTree(extractedAppURL.path))
|
XCTAssertEqual("6a60ab31430cfca8fb499a884f4a29f73e59b472", hashOfTree(extractedAppURL.path))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func unarchiveTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL) {
|
||||||
|
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension);
|
||||||
|
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: self.password)!
|
||||||
|
|
||||||
|
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||||
|
XCTAssertNotNil(error);
|
||||||
|
self.unarchivedFailureExpectation!.fulfill()
|
||||||
|
}, progressBlock: nil);
|
||||||
|
}
|
||||||
|
|
||||||
|
func unarchiveTestSuccessAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, tempArchiveURL: URL, archiveResourceURL: URL) {
|
||||||
|
|
||||||
|
let fileManager = FileManager.default
|
||||||
|
|
||||||
|
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
|
||||||
|
|
||||||
|
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: self.password)!
|
||||||
|
|
||||||
|
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||||
|
XCTAssertNil(error);
|
||||||
|
self.unarchivedSuccessExpectation!.fulfill()
|
||||||
|
}, progressBlock: nil);
|
||||||
|
}
|
||||||
|
|
||||||
func testUnarchivingZip()
|
func testUnarchivingZip()
|
||||||
{
|
{
|
||||||
self.unarchiveTestAppWithExtension("zip")
|
self.unarchiveTestAppWithExtension("zip")
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
#import "SUConstants.h"
|
#import "SUConstants.h"
|
||||||
#import "SUUpdater.h"
|
#import "SUUpdater.h"
|
||||||
|
#import "SUUpdaterDelegate.h"
|
||||||
|
|
||||||
@interface SUUpdaterTest : XCTestCase <SUUpdaterDelegate>
|
@interface SUUpdaterTest : XCTestCase <SUUpdaterDelegate>
|
||||||
@property (strong) NSOperationQueue *queue;
|
@property (strong) NSOperationQueue *queue;
|
||||||
|
|||||||
Loaded 100 of 110 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user