mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b328c499a3 | ||
|
|
00e6259c9d | ||
|
|
31b462f860 | ||
|
|
5264c01d37 | ||
|
|
0cff81740f | ||
|
|
e9989a8ae7 | ||
|
|
2e1bdb98f1 | ||
|
|
d30adc8407 | ||
|
|
0183bf2b3f | ||
|
|
2b7615fe5b | ||
|
|
9aece0259c | ||
|
|
8c7476f93d |
No files matched your search
@@ -61,7 +61,7 @@ jobs:
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild analyze -project Sparkle.xcodeproj -quiet -scheme Sparkle -configuration Release -derivedDataPath analyze > anaylze_output.txt
|
||||
xcodebuild analyze -project Sparkle.xcodeproj -quiet -scheme Sparkle -configuration Release -derivedDataPath analyze > analyze_output.txt
|
||||
|
||||
- name: Find Analyzed Warnings
|
||||
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' }}
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
if grep -q "warning:" anaylze_output.txt; then
|
||||
if grep -q "warning:" analyze_output.txt; then
|
||||
echo '::set-output name=analyzestatus::0'
|
||||
else
|
||||
echo '::set-output name=analyzestatus::1'
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
|
||||
id: warnings
|
||||
run: |
|
||||
echo ::set-output name=content::$(cat anaylze_output.txt)
|
||||
echo ::set-output name=content::$(cat analyze_output.txt)
|
||||
|
||||
- name: Post Analyzed Warnings
|
||||
if: ${{ success() && matrix.run-analyzer && github.event_name == 'pull_request' && steps.findwarnings.outputs.analyzestatus == '0' }}
|
||||
@@ -95,13 +95,13 @@ jobs:
|
||||
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
|
||||
- name: Archive Test Results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-logs
|
||||
path: build/Logs
|
||||
- name: Upload Distribution
|
||||
if: ${{ success() && matrix.upload-dist }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
|
||||
path: build/Build/Products/Release/sparkle-dist.tar.xz
|
||||
@@ -59,6 +59,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
NSString *_userName;
|
||||
SUHost *_host;
|
||||
NSString *_updateDirectoryPath;
|
||||
NSString *_extractionDirectory;
|
||||
NSString *_downloadName;
|
||||
NSString *_decryptionPassword;
|
||||
SUSignatures *_signatures;
|
||||
@@ -172,7 +173,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
[_communicator handleMessageWithIdentifier:SPUExtractionStarted data:[NSData data]];
|
||||
|
||||
NSString *archivePath = [_updateDirectoryPath stringByAppendingPathComponent:_downloadName];
|
||||
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath updatingHostBundlePath:_host.bundlePath decryptionPassword:_decryptionPassword expectingInstallationType:_installationType];
|
||||
|
||||
id<SUUnarchiverProtocol> unarchiver = [SUUnarchiver unarchiverForPath:archivePath extractionDirectory:_extractionDirectory updatingHostBundlePath:_host.bundlePath decryptionPassword:_decryptionPassword expectingInstallationType:_installationType];
|
||||
|
||||
NSError *unarchiverError = nil;
|
||||
BOOL success = NO;
|
||||
@@ -213,7 +215,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
[self->_communicator handleMessageWithIdentifier:SPUValidationStarted data:[NSData data]];
|
||||
|
||||
NSError *validationError = nil;
|
||||
BOOL validationSuccess = [self->_updateValidator validateWithUpdateDirectory:self->_updateDirectoryPath error:&validationError];
|
||||
BOOL validationSuccess = [self->_updateValidator validateWithUpdateDirectory:self->_extractionDirectory error:&validationError];
|
||||
|
||||
if (!validationSuccess) {
|
||||
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Update validation was a failure", NSUnderlyingErrorKey: validationError }]];
|
||||
@@ -263,6 +265,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
// but may as well set other fields to nil too
|
||||
[self clearUpdateDirectory];
|
||||
_downloadName = nil;
|
||||
_extractionDirectory = nil;
|
||||
_decryptionPassword = nil;
|
||||
_signatures = nil;
|
||||
_relaunchPath = nil;
|
||||
@@ -325,7 +328,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(RETRIEVE_PROCESS_IDENTIFIER_TIMEOUT * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (!receivedResponse) {
|
||||
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Timeout error: failed to retreive process identifier from agent" }]];
|
||||
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: @"Timeout error: failed to retrieve process identifier from agent" }]];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -453,13 +456,21 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
return;
|
||||
}
|
||||
|
||||
// Carry these properities separately rather than using the SUInstallationInputData object
|
||||
NSString *extractionDirectory = [SPULocalCacheDirectory createUniqueDirectoryInDirectory:cacheInstallationPath];
|
||||
if (extractionDirectory == nil) {
|
||||
[self cleanupAndExitWithStatus:EXIT_FAILURE error:[NSError errorWithDomain:SUSparkleErrorDomain code:SPUInstallerError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"Error: Failed to create installation extraction directory in %@", cacheInstallationPath] }]];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Carry these properties separately rather than using the SUInstallationInputData object
|
||||
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
|
||||
self->_installationType = installationType;
|
||||
self->_relaunchPath = installationData.relaunchPath;
|
||||
self->_downloadName = downloadName;
|
||||
self->_signatures = installationData.signatures;
|
||||
self->_updateDirectoryPath = cacheInstallationPath;
|
||||
self->_extractionDirectory = extractionDirectory;
|
||||
self->_host = [[SUHost alloc] initWithBundle:hostBundle];
|
||||
self->_verifierInformation = [[SPUVerifierInformation alloc] initWithExpectedVersion:installationData.expectedVersion expectedContentLength:installationData.expectedContentLength];
|
||||
|
||||
@@ -521,7 +532,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7;
|
||||
|
||||
dispatch_async(_installerQueue, ^{
|
||||
NSError *installerError = nil;
|
||||
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self->_host expectedInstallationType:self->_installationType updateDirectory:self->_updateDirectoryPath homeDirectory:self->_homeDirectory userName:self->_userName error:&installerError];
|
||||
id <SUInstallerProtocol> installer = [SUInstaller installerForHost:self->_host expectedInstallationType:self->_installationType updateDirectory:self->_extractionDirectory homeDirectory:self->_homeDirectory userName:self->_userName error:&installerError];
|
||||
|
||||
if (installer == nil) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SPUInstallationInfo : NSObject <NSSecureCoding>
|
||||
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem canSilentlyInstall:(BOOL)canSilentyInstall;
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)appcastItem canSilentlyInstall:(BOOL)canSilentlyInstall;
|
||||
|
||||
@property (nonatomic, readonly) SUAppcastItem *appcastItem;
|
||||
@property (nonatomic, readonly) BOOL canSilentlyInstall;
|
||||
|
||||
@@ -103,7 +103,7 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
|
||||
NSString *patchFile = _patchFile;
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
// Sparkle's XAR delta archives have been superceded by Sparkle's own format
|
||||
// Sparkle's XAR delta archives have been superseded by Sparkle's own format
|
||||
xar_t x = xar_open(patchFile.fileSystemRepresentation, READ);
|
||||
#pragma clang diagnostic pop
|
||||
if (x == NULL) {
|
||||
@@ -176,7 +176,7 @@ extern char *xar_get_safe_path(xar_file_t f) __attribute__((weak_import));
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
// Sparkle's XAR delta archives have been superceded by Sparkle's own format
|
||||
// Sparkle's XAR delta archives have been superseded by Sparkle's own format
|
||||
xar_t x = xar_open(patchFile.fileSystemRepresentation, WRITE);
|
||||
#pragma clang diagnostic pop
|
||||
if (x == NULL) {
|
||||
@@ -246,7 +246,7 @@ static xar_file_t _xarAddFile(NSMutableDictionary<NSString *, NSValue *> *fileTa
|
||||
// We store every file we add into a fileTable for easy referencing
|
||||
// Note if a diff has Contents/Resources/foo/ and Contents/Resources/foo/bar.txt,
|
||||
// due to sorting order we will add the foo directory first and won't end up with
|
||||
// mis-ordering bugs
|
||||
// misordering bugs
|
||||
xar_file_t lastParent = NULL;
|
||||
for (NSUInteger componentIndex = 0; componentIndex < relativePathComponentsCount; componentIndex++) {
|
||||
NSArray<NSString *> *subpathComponents = [relativePathComponents subarrayWithRange:NSMakeRange(0, componentIndex + 1)];
|
||||
|
||||
@@ -291,7 +291,7 @@ BOOL applyBinaryDelta(NSString *source, NSString *finalDestination, NSString *pa
|
||||
// Remove the file non-writable we're patching that may cause issues
|
||||
[fileManager removeItemAtPath:destinationFilePath error:NULL];
|
||||
|
||||
// We will need to preserve permissons if there is no need to make permission changes later on
|
||||
// We will need to preserve permissions if there is no need to make permission changes later on
|
||||
needsToCopyFilePermissions = (commands & SPUDeltaItemCommandModifyPermissions) == 0;
|
||||
} else {
|
||||
needsToCopyFilePermissions = ((commands & SPUDeltaItemCommandClone) != 0) && ((commands & SPUDeltaItemCommandModifyPermissions) == 0);
|
||||
|
||||
@@ -750,7 +750,7 @@ BOOL createBinaryDelta(NSString *source, NSString *destination, NSString *patchF
|
||||
return originalTreeState[key1] ? NSOrderedAscending : NSOrderedDescending;
|
||||
}];
|
||||
|
||||
// Using a couple of heursitics we track if files have been moved to other locations within the app bundle
|
||||
// Using a couple of heuristics we track if files have been moved to other locations within the app bundle
|
||||
NSMutableDictionary<NSString *, NSString *> *frameworkVersionsSubstitutes = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary<NSString *, NSString *> *fileSubstitutes = [NSMutableDictionary dictionary];
|
||||
if (MAJOR_VERSION_IS_AT_LEAST(majorVersion, SUBinaryDeltaMajorVersion3)) {
|
||||
|
||||
@@ -19,7 +19,7 @@ SPU_OBJC_DIRECT_MEMBERS
|
||||
#endif
|
||||
@interface SUBinaryDeltaUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
{
|
||||
NSString *_archivePath;
|
||||
NSString *_updateHostBundlePath;
|
||||
NSString *_extractionDirectory;
|
||||
}
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||
@@ -71,12 +72,13 @@ SPU_OBJC_DIRECT
|
||||
}
|
||||
}
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory updateHostBundlePath:(NSString *)updateHostBundlePath
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_archivePath = [archivePath copy];
|
||||
_updateHostBundlePath = [updateHostBundlePath copy];
|
||||
_extractionDirectory = [extractionDirectory copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -94,7 +96,7 @@ SPU_OBJC_DIRECT
|
||||
- (void)extractDeltaWithNotifier:(SUUnarchiverNotifier *)notifier
|
||||
{
|
||||
NSString *sourcePath = _updateHostBundlePath;
|
||||
NSString *targetPath = [[_archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
NSString *targetPath = [_extractionDirectory stringByAppendingPathComponent:[sourcePath lastPathComponent]];
|
||||
|
||||
NSError *applyDiffError = nil;
|
||||
BOOL success = applyBinaryDelta(sourcePath, targetPath, _archivePath, NO, ^(double progress){
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
// Note that kSecCSCheckNestedCode may not work with pre-Mavericks code signing.
|
||||
// See https://github.com/sparkle-project/Sparkle/issues/376#issuecomment-48824267 and https://developer.apple.com/library/mac/technotes/tn2206
|
||||
// Aditionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
|
||||
// Additionally, there are several reasons to stay away from deep verification and to prefer EdDSA signing the download archive instead.
|
||||
// See https://github.com/sparkle-project/Sparkle/pull/523#commitcomment-17549302 and https://github.com/sparkle-project/Sparkle/issues/543
|
||||
SecCSFlags flags = (SecCSFlags) (kSecCSDefaultFlags | kSecCSCheckAllArchitectures);
|
||||
result = SecStaticCodeCheckValidityWithErrors(staticCode, flags, requirement, &cfError);
|
||||
|
||||
@@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUDiskImageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
{
|
||||
NSString *_archivePath;
|
||||
NSString *_decryptionPassword;
|
||||
NSString *_extractionDirectory;
|
||||
}
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||
@@ -31,12 +32,13 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath decryptionPassword:(nullable NSString *)decryptionPassword
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory decryptionPassword:(nullable NSString *)decryptionPassword
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_archivePath = [archivePath copy];
|
||||
_decryptionPassword = [decryptionPassword copy];
|
||||
_extractionDirectory = [extractionDirectory copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -171,7 +173,7 @@
|
||||
for (NSString *item in contents)
|
||||
{
|
||||
NSString *fromPath = [mountPoint stringByAppendingPathComponent:item];
|
||||
NSString *toPath = [[_archivePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:item];
|
||||
NSString *toPath = [_extractionDirectory stringByAppendingPathComponent:item];
|
||||
|
||||
itemsCopied += 1.0;
|
||||
[notifier notifyProgress:0.5 + itemsCopied/(totalItems*2.0)];
|
||||
|
||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// An unarchiver for flat packages that doesn't really do any unarchiving
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUFlatPackageUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType;
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
{
|
||||
NSString *_flatPackagePath;
|
||||
NSString *_expectedInstallationType;
|
||||
NSString *_extractionDirectory;
|
||||
}
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path
|
||||
@@ -32,12 +33,13 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath expectingInstallationType:(NSString *)installationType
|
||||
- (instancetype)initWithFlatPackagePath:(NSString *)flatPackagePath extractionDirectory:(NSString *)extractionDirectory expectingInstallationType:(NSString *)installationType
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_flatPackagePath = [flatPackagePath copy];
|
||||
_expectedInstallationType = [installationType copy];
|
||||
_extractionDirectory = [extractionDirectory copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -53,8 +55,20 @@
|
||||
} else if (![[NSFileManager defaultManager] fileExistsAtPath:_flatPackagePath isDirectory:&isDirectory] || isDirectory) {
|
||||
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package does not exist at %@", _flatPackagePath]}]];
|
||||
} else {
|
||||
[notifier notifyProgress:1.0];
|
||||
[notifier notifySuccess];
|
||||
// Copying the flat package should be very fast, especially on APFS
|
||||
NSError *copyError = nil;
|
||||
if (![[NSFileManager defaultManager] copyItemAtPath:_flatPackagePath toPath:[_extractionDirectory stringByAppendingPathComponent:_flatPackagePath.lastPathComponent] error:©Error]) {
|
||||
NSMutableDictionary *userInfoDictionary = [NSMutableDictionary dictionaryWithDictionary:@{ NSLocalizedDescriptionKey:[NSString stringWithFormat:@"Flat package (%@) cannot be copied to extraction directory (%@)", _flatPackagePath, _extractionDirectory]}];
|
||||
|
||||
if (copyError != nil) {
|
||||
userInfoDictionary[NSUnderlyingErrorKey] = copyError;
|
||||
}
|
||||
|
||||
[notifier notifyFailureWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:userInfoDictionary]];
|
||||
} else {
|
||||
[notifier notifyProgress:1.0];
|
||||
[notifier notifySuccess];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-13
@@ -22,15 +22,6 @@
|
||||
|
||||
@implementation SUInstaller
|
||||
|
||||
+ (BOOL)isAliasFolderAtPath:(NSString *)path SPU_OBJC_DIRECT
|
||||
{
|
||||
NSNumber *aliasFlag = nil;
|
||||
[[NSURL fileURLWithPath:path] getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:nil];
|
||||
NSNumber *directoryFlag = nil;
|
||||
[[NSURL fileURLWithPath:path] getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:nil];
|
||||
return aliasFlag.boolValue && directoryFlag.boolValue;
|
||||
}
|
||||
|
||||
+ (nullable NSString *)installSourcePathInUpdateFolder:(NSString *)inUpdateFolder forHost:(SUHost *)host
|
||||
#if SPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
isPackage:(BOOL *)isPackagePtr isGuided:(BOOL *)isGuidedPtr
|
||||
@@ -55,6 +46,34 @@
|
||||
|
||||
while ((currentFile = [dirEnum nextObject])) {
|
||||
NSString *currentPath = [inUpdateFolder stringByAppendingPathComponent:currentFile];
|
||||
|
||||
// Ignore all symbolic links and aliases
|
||||
{
|
||||
NSURL *currentPathURL = [NSURL fileURLWithPath:currentPath];
|
||||
|
||||
NSNumber *symbolicLinkFlag = nil;
|
||||
[currentPathURL getResourceValue:&symbolicLinkFlag forKey:NSURLIsSymbolicLinkKey error:NULL];
|
||||
if (symbolicLinkFlag.boolValue) {
|
||||
// NSDirectoryEnumerator won't recurse into symlinked directories
|
||||
continue;
|
||||
}
|
||||
|
||||
NSNumber *aliasFlag = nil;
|
||||
[currentPathURL getResourceValue:&aliasFlag forKey:NSURLIsAliasFileKey error:NULL];
|
||||
|
||||
if (aliasFlag.boolValue) {
|
||||
NSNumber *directoryFlag = nil;
|
||||
[currentPathURL getResourceValue:&directoryFlag forKey:NSURLIsDirectoryKey error:NULL];
|
||||
|
||||
// Some DMGs have symlinks into /Applications! That's no good!
|
||||
if (directoryFlag.boolValue) {
|
||||
[dirEnum skipDescendents];
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
NSString *currentFilename = [currentFile lastPathComponent];
|
||||
#if SPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
NSString *currentExtension = [currentFile pathExtension];
|
||||
@@ -92,10 +111,6 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Some DMGs have symlinks into /Applications! That's no good!
|
||||
if ([self isAliasFolderAtPath:currentPath])
|
||||
[dirEnum skipDescendents];
|
||||
}
|
||||
|
||||
#if SPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
|
||||
@@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUPipedUnarchiver : NSObject <SUUnarchiverProtocol>
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath;
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory;
|
||||
|
||||
+ (BOOL)canUnarchivePath:(NSString *)path;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
@implementation SUPipedUnarchiver
|
||||
{
|
||||
NSString *_archivePath;
|
||||
NSString *_extractionDirectory;
|
||||
}
|
||||
|
||||
static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPath(NSString *path)
|
||||
@@ -59,11 +60,12 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath
|
||||
- (instancetype)initWithArchivePath:(NSString *)archivePath extractionDirectory:(NSString *)extractionDirectory
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_archivePath = [archivePath copy];
|
||||
_extractionDirectory = [extractionDirectory copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -89,7 +91,7 @@ static NSArray <NSString *> * _Nullable _commandAndArgumentsConformingToTypeOfPa
|
||||
{
|
||||
// *** GETS CALLED ON NON-MAIN THREAD!!!
|
||||
@autoreleasepool {
|
||||
NSString *destination = [_archivePath stringByDeletingLastPathComponent];
|
||||
NSString *destination = _extractionDirectory;
|
||||
|
||||
SULog(SULogLevelDefault, @"Extracting using '%@' '%@' < '%@' '%@'", command, [args componentsJoinedByString:@"' '"], _archivePath, destination);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
SPU_OBJC_DIRECT_MEMBERS @interface SUUnarchiver : NSObject
|
||||
|
||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
|
||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -18,27 +18,25 @@
|
||||
|
||||
@implementation SUUnarchiver
|
||||
|
||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
|
||||
+ (nullable id <SUUnarchiverProtocol>)unarchiverForPath:(NSString *)path extractionDirectory:(NSString *)extractionDirectory updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword expectingInstallationType:(NSString *)installationType
|
||||
{
|
||||
if ([SUPipedUnarchiver canUnarchivePath:path]) {
|
||||
return [[SUPipedUnarchiver alloc] initWithArchivePath:path];
|
||||
|
||||
return [[SUPipedUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory];
|
||||
}
|
||||
#if SPARKLE_BUILD_DMG_SUPPORT
|
||||
else if ([SUDiskImageUnarchiver canUnarchivePath:path]) {
|
||||
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path decryptionPassword:decryptionPassword];
|
||||
|
||||
return [[SUDiskImageUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory decryptionPassword:decryptionPassword];
|
||||
}
|
||||
#endif
|
||||
else if ([SUBinaryDeltaUnarchiver canUnarchivePath:path]) {
|
||||
assert(hostPath != nil);
|
||||
NSString *nonNullHostPath = hostPath;
|
||||
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path updateHostBundlePath:nonNullHostPath];
|
||||
return [[SUBinaryDeltaUnarchiver alloc] initWithArchivePath:path extractionDirectory:extractionDirectory updateHostBundlePath:nonNullHostPath];
|
||||
}
|
||||
#if SPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
else if ([SUFlatPackageUnarchiver canUnarchivePath:path]) {
|
||||
// Flat packages are only supported for guided packaage installs
|
||||
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path expectingInstallationType:installationType];
|
||||
return [[SUFlatPackageUnarchiver alloc] initWithFlatPackagePath:path extractionDirectory:extractionDirectory expectingInstallationType:installationType];
|
||||
}
|
||||
#endif
|
||||
return nil;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ int main(int __unused argc, const char __unused *argv[])
|
||||
// Don't clear the update directory because the installer may be in middle of installing an update
|
||||
// We still need to set an event handler for receiving SIGTERM though, otherwise our job may not terminate
|
||||
// (This is also recommended from the developer documentation).
|
||||
// Simply exit with SIGTERM if we recieve this signal
|
||||
// Simply exit with SIGTERM if we receive this signal
|
||||
exit(SIGTERM);
|
||||
});
|
||||
dispatch_resume(sigtermSource);
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
# 2.6.1
|
||||
|
||||
* Extract archives in a separate directory from the input archive (#2550) (Zorg)
|
||||
* Fix the release notes WebKit view not updating background when transitioning from light to dark mode (#2542) (Zorg)
|
||||
* Add NN (Norwegian Nynorsk) locale (#2532) (Sjur N Moshagen, Zorg)
|
||||
* Create tar.xz files with built-in tar and remove bzip2 fallback for creating a release distribution (#2535) (Zorg)
|
||||
* Add fallback in case SULocalizedStringFromTableInBundle() fails (#2533) (Zorg)
|
||||
* Remove assert on download response being available fixing rare crash (#2547) (Zorg)
|
||||
* Clarify when authoriation prompt may show in SPUUserDriver documentation (#2531, #2534) (Zorg)
|
||||
* Fix typos in codebase (#2537) (Viktor Szépe)
|
||||
|
||||
# 2.6.0
|
||||
|
||||
* Perform Gatekeeper scan to pre-warm app launch (#2505) (Zorg)
|
||||
@@ -400,7 +411,7 @@ If you are migrating from earlier beta versions of Sparkle 2 and use sandboxing,
|
||||
# 1.20.0
|
||||
|
||||
* `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik)
|
||||
* Add delegate callbacks for fininshed download and extraction related events (Csaba Horony)
|
||||
* Add delegate callbacks for finished download and extraction related events (Csaba Horony)
|
||||
* Don't check for updates if Do Not Disturb is on (Kornel)
|
||||
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
|
||||
* Threading fixes:
|
||||
@@ -750,7 +761,7 @@ Important security fixes:
|
||||
* All the user defaults keys are now private; instead, SUUpdater is KVC-compliant for automaticallyChecksForUpdates, updateCheckInterval, and feedURL.
|
||||
* Reduced the size of the English-only framework by 25%.
|
||||
* System profiling information is now only submitted to the server once per week; this will help normalize your statistics across users with different interval preferences.
|
||||
* The feedParamatersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
|
||||
* The feedParametersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
|
||||
* Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
|
||||
* Added support for xml:lang to pick localized nodes in appcasts (for release notes, etc).
|
||||
* Fixed a bug which would cause the "checking for updates" window to not disappear in certain extraordinary error conditions.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz", "2.6.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.2/Sparkle-2.6.0-beta.2.tar.xz", "2.6.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0/Sparkle-2.6.0.tar.xz"}
|
||||
{"1.27.1": "https://github.com/sparkle-project/Sparkle/releases/download/1.27.1/Sparkle-1.27.1.tar.xz", "2.0.0-beta.6": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-beta.6/Sparkle-2.0.0-beta.6.tar.xz", "2.0.0-rc.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0-rc.1/Sparkle-2.0.0-rc.1.tar.xz", "2.0.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.0.0/Sparkle-2.0.0.tar.xz", "2.1.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.1/Sparkle-2.1.0-beta.1.tar.xz", "2.1.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0-beta.2/Sparkle-2.1.0-beta.2.tar.xz", "2.1.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.1.0/Sparkle-2.1.0.tar.xz", "2.2.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.1/Sparkle-2.2.0-beta.1.tar.xz", "2.2.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0-beta.2/Sparkle-2.2.0-beta.2.tar.xz", "2.2.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.0/Sparkle-2.2.0.tar.xz", "2.2.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.1/Sparkle-2.2.1.tar.xz", "2.2.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.2.2/Sparkle-2.2.2.tar.xz", "2.3.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.1/Sparkle-2.3.0-beta.1.tar.xz", "2.3.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0-beta.2/Sparkle-2.3.0-beta.2.tar.xz", "2.3.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.0/Sparkle-2.3.0.tar.xz", "2.3.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.1/Sparkle-2.3.1.tar.xz", "2.3.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.3.2/Sparkle-2.3.2.tar.xz", "2.4.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.1/Sparkle-2.4.0-beta.1.tar.xz", "2.4.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0-beta.2/Sparkle-2.4.0-beta.2.tar.xz", "2.4.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.0/Sparkle-2.4.0.tar.xz", "2.4.1-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1-beta.1/Sparkle-2.4.1-beta.1.tar.xz", "2.4.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.1/Sparkle-2.4.1.tar.xz", "2.4.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.4.2/Sparkle-2.4.2.tar.xz", "2.5.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.1/Sparkle-2.5.0-beta.1.tar.xz", "2.5.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0-beta.2/Sparkle-2.5.0-beta.2.tar.xz", "2.5.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.0/Sparkle-2.5.0.tar.xz", "2.5.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.1/Sparkle-2.5.1.tar.xz", "2.5.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.5.2/Sparkle-2.5.2.tar.xz", "2.6.0-beta.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.1/Sparkle-2.6.0-beta.1.tar.xz", "2.6.0-beta.2": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0-beta.2/Sparkle-2.6.0-beta.2.tar.xz", "2.6.0": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.0/Sparkle-2.6.0.tar.xz", "2.6.1": "https://github.com/sparkle-project/Sparkle/releases/download/2.6.1/Sparkle-2.6.1.tar.xz"}
|
||||
@@ -99,12 +99,12 @@ SPARKLE_ICON_NAME = AppIcon
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_MAJOR = 2
|
||||
SPARKLE_VERSION_MINOR = 6
|
||||
SPARKLE_VERSION_PATCH = 0
|
||||
SPARKLE_VERSION_PATCH = 1
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-beta.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
CURRENT_PROJECT_VERSION = 2036
|
||||
CURRENT_PROJECT_VERSION = 2037
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
@@ -169,4 +169,4 @@ GCC_WARN_UNUSED_PARAMETER = YES
|
||||
GCC_WARN_UNUSED_VARIABLE = YES
|
||||
|
||||
// Turn on all warnings, then disable a few which are almost impossible to avoid
|
||||
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Werror=undef
|
||||
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso -Wno-direct-ivar-access -Wno-declaration-after-statement -Wno-gnu-conditional-omitted-operand -Werror=undef
|
||||
@@ -77,31 +77,17 @@ if [ "$ACTION" = "" ] ; then
|
||||
|
||||
cd "$CONFIGURATION_BUILD_DIR/staging"
|
||||
|
||||
if [ -x "$(command -v xz)" ]; then
|
||||
XZ_EXISTS=1
|
||||
else
|
||||
XZ_EXISTS=0
|
||||
fi
|
||||
|
||||
rm -rf "/tmp/sparkle-extract"
|
||||
mkdir -p "/tmp/sparkle-extract"
|
||||
|
||||
# Sorted file list groups similar files together, which improves tar compression
|
||||
if [ "$XZ_EXISTS" -eq 1 ] ; then
|
||||
find . \! -type d | rev | sort | rev | tar cv --files-from=- | xz -9 > "../Sparkle-$MARKETING_VERSION.tar.xz"
|
||||
find . \! -type d | rev | sort | rev | tar --no-xattrs -cJvf "../Sparkle-$MARKETING_VERSION.tar.xz" --files-from=-
|
||||
|
||||
# Copy archived distribution for CI
|
||||
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
|
||||
|
||||
# Copy archived distribution for CI
|
||||
cp -f "../Sparkle-$MARKETING_VERSION.tar.xz" "../sparkle-dist.tar.xz"
|
||||
|
||||
# Extract archive for testing binary validity
|
||||
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
|
||||
else
|
||||
# Fallback to bz2 compression if xz utility is not available
|
||||
find . \! -type d | rev | sort | rev | tar cjvf "../Sparkle-$MARKETING_VERSION.tar.bz2" --files-from=-
|
||||
|
||||
# Extract archive for testing binary validity
|
||||
tar -xf "../Sparkle-$MARKETING_VERSION.tar.bz2" -C "/tmp/sparkle-extract"
|
||||
fi
|
||||
# Extract archive for testing binary validity
|
||||
tar -xf "../Sparkle-$MARKETING_VERSION.tar.xz" -C "/tmp/sparkle-extract"
|
||||
|
||||
# Test code signing validity of the extracted products
|
||||
# This guards against our archives being corrupt / created incorrectly
|
||||
@@ -172,9 +158,5 @@ if [ "$ACTION" = "" ] ; then
|
||||
echo "warning: Xcode version $XCODE_VERSION_ACTUAL does not support computing checksums for Swift Packages. Please update the Package manifest manually."
|
||||
fi
|
||||
|
||||
if [ "$XZ_EXISTS" -ne 1 ] ; then
|
||||
echo "WARNING: xz compression is used for official releases but bz2 is being used instead because xz tool is not installed on your system."
|
||||
fi
|
||||
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
fi
|
||||
@@ -10,15 +10,15 @@ The protocols used in XPC services must also not adopt other protocols (i.e, one
|
||||
|
||||
Singletons and other global mutable variables have been either removed entirely or completely avoided with an exception to backwards compatibility. They have no place in a well architectured framework.
|
||||
|
||||
`SPUUpdater` doesn't maintain singleton instances and can now be properly deconstructed. Note because a caller is not expected to explicitly invalidate an updater, this means that the updater needs to avoid geting into a retain cycle. Intermediate clasess were created for the update cycle and schedule timer to avoid just this.
|
||||
`SPUUpdater` doesn't maintain singleton instances and can now be properly deconstructed. Note because a caller is not expected to explicitly invalidate an updater, this means that the updater needs to avoid getting into a retain cycle. Intermediate clasess were created for the update cycle and schedule timer to avoid just this.
|
||||
|
||||
One may argue that we shouldn't allow multiple live updaters running at the same bundle simutaneously, but I disagree and I think that is missing the point. It also does not account for updaters running external to the process. For example, it may be perfectly reasonable to start an update from `sparkle-cli` that defers the installation until quit, and have the application that is being updated be able to resume that installation and relaunch immediately.
|
||||
One may argue that we shouldn't allow multiple live updaters running at the same bundle simultaneously, but I disagree and I think that is missing the point. It also does not account for updaters running external to the process. For example, it may be perfectly reasonable to start an update from `sparkle-cli` that defers the installation until quit, and have the application that is being updated be able to resume that installation and relaunch immediately.
|
||||
|
||||
The original `SUUpdater` may have also been created to assist plug-ins and other non-app bundles. My advice there is in order to be truely safe, you must not inject a framework like Sparkle into the host application anyway. An external tool that is bundled like `sparkle-cli` may be more appropriate to use here.
|
||||
The original `SUUpdater` may have also been created to assist plug-ins and other non-app bundles. My advice there is in order to be truly safe, you must not inject a framework like Sparkle into the host application anyway. An external tool that is bundled like `sparkle-cli` may be more appropriate to use here.
|
||||
|
||||
## Extensibility
|
||||
|
||||
Sparkle 2.0 does not support subclassing classes internal (not exported) to Sparkle anymore. Doing so would be almost impossible to maintain into the future. Subclassing in general has been banned. Composition is prefered everywhere, even amongst the internal update drivers which were rewritten to follow a protocol oriented approach. The reason why composition is preferred is because it's easier to follow the flow of logic.
|
||||
Sparkle 2.0 does not support subclassing classes internal (not exported) to Sparkle anymore. Doing so would be almost impossible to maintain into the future. Subclassing in general has been banned. Composition is preferred everywhere, even amongst the internal update drivers which were rewritten to follow a protocol oriented approach. The reason why composition is preferred is because it's easier to follow the flow of logic.
|
||||
|
||||
I hope the user driver API gives enough extensibility without someone wanting to create another fork.
|
||||
|
||||
@@ -32,7 +32,7 @@ You may notice that the delegate and user driver are not accessible as propertie
|
||||
|
||||
## Decoupling
|
||||
|
||||
Two software components should not directly know about each other. Preferrably they wouldn't know about each other at all, but if they must, they can use the delegation pattern with a declared protocol.
|
||||
Two software components should not directly know about each other. Preferably they wouldn't know about each other at all, but if they must, they can use the delegation pattern with a declared protocol.
|
||||
|
||||
See `Documentation/graph-of-sparkle.png` for a graph of how the code looks like currently. This was generated via [objc_dep](https://github.com/nst/objc_dep) (great tool). Note that there are no red edges which would mean that two nodes know of each other.
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ After extraction starts, one or more `SPUExtractedArchiveWithProgress` messages
|
||||
### Post Validation
|
||||
If the unarchiving succeeds, a `SPUValidationStarted` message is sent back to the updater, and the installer begins post validating the update.
|
||||
|
||||
If validation was already done before extraction, just the code signature is checked on the extracted bundle to make sure it's valid (if there's a code signature on the bundle). This is just a consistency check to make sure the developer didn't make a careless erorr.
|
||||
If validation was already done before extraction, just the code signature is checked on the extracted bundle to make sure it's valid (if there's a code signature on the bundle). This is just a consistency check to make sure the developer didn't make a careless error.
|
||||
|
||||
If validation fails, the installer aborts, causing the updater to abort the update as well. Otherwise, the installer sends a message `SPUInstallationStartedStage1` to the updater and begins the installation.
|
||||
|
||||
@@ -92,7 +92,7 @@ For automatic based drivers, if the update is not going to be installed immediat
|
||||
|
||||
Otherwise if the updater delegate doesn't handle immediate installation for automatic based drivers (assuming still the update is not going to be installed immediately), the update driver is aborted; the installer will still wait for the target to terminate however. If the update cannot be silently installed or if the update is marked as critical from the appcast, the update procedure is actually 'resumed' as a scheduled UI based update driver immediately. The update driver can also be 'resumed' later when the user initiates for an update manually or when a long duration (I think a week) has passed by without the user terminating the application. Note automatic based drivers are unable to do a resume, so only UI based ones can.
|
||||
|
||||
If an update driver is resumed (which cannot happen if the target applicaton is already terminated by the way), then the updater first requests the installer for the appcast item data that the installer received before. The updater does this by creating a temporary distinct connection for the purpose of querying for the installation status. The connection will give up if a short timeout passes. If the updater fails to retrieve resume data, it assumes that there's no update to resume and will start back from the beginning. The updater can use this data for showing release notes, etc. Note the updater and target application don't have to live in the same process, and the updater could choose to terminate and resume later as a new process - so having the installer keep the appcast item data is nice.
|
||||
If an update driver is resumed (which cannot happen if the target application is already terminated by the way), then the updater first requests the installer for the appcast item data that the installer received before. The updater does this by creating a temporary distinct connection for the purpose of querying for the installation status. The connection will give up if a short timeout passes. If the updater fails to retrieve resume data, it assumes that there's no update to resume and will start back from the beginning. The updater can use this data for showing release notes, etc. Note the updater and target application don't have to live in the same process, and the updater could choose to terminate and resume later as a new process - so having the installer keep the appcast item data is nice.
|
||||
|
||||
Afterwards the resumed update driver then allows the user driver to decide whether to a) install the update now, b) install & relaunch the update, or to c) delay the update installation and abort the update driver. Note we are now back to the same options discussed earlier.
|
||||
|
||||
@@ -134,4 +134,4 @@ When the progress agent exits, it cleans up by removing itself from disk. The in
|
||||
|
||||
* When we terminate the application before doing final installation work, we send an Apple quit event to all running application instances we find under the agent's GUI login session. This does not include running instances from other logged in sessions -- that may require authenticating all the time, so trade off is not worthwhile. Also currently the installer only handles a single process identifier to watch for until termination, and certainly doesn't handle the case if more instances are launched afterwards. Note all of this only applies to instances being launched from the same bundle path, and the consequence may rarely be updating a bundle when a running instance is still left alive.
|
||||
|
||||
* SMJobBless() would be interesting to explore and perhaps more suitable for sparkle-cli than ordinary application updaters because using this API is less approriate for one-off installations. Furthermore, the installer would have to change to persist rather than be a one-time install, and may have to handle mutliple connections for installing multiple bundles simutaneously.
|
||||
* SMJobBless() would be interesting to explore and perhaps more suitable for sparkle-cli than ordinary application updaters because using this API is less appropriate for one-off installations. Furthermore, the installer would have to change to persist rather than be a one-time install, and may have to handle multiple connections for installing multiple bundles simultaneously.
|
||||
@@ -20,7 +20,7 @@ For XPC Services, it's significant to understand they can be used independent of
|
||||
|
||||
We have code that detects whether or not XPC services are available and enabled by the main application bundle. This is simpler and more efficient than attempting to create a connection and wait for a timeout. We don't have *any* checks for seeing if the "current process" is sandboxed; doing so is a rather broken behavior. The XPC Services are important, not the sandboxing.
|
||||
|
||||
I said above that XPC services are looked up in the main bundle. One may think this assumption doesn't hold for helpers or plug-ins inside applications. My response to that is they probably don't need the services, and they probably shoudn't be injecting Sparkle inside the host application anyway due to unintended conflicts and other consequences. A more appropriate approach may be to bundle a separate tool such as the sparkle command line utility.
|
||||
I said above that XPC services are looked up in the main bundle. One may think this assumption doesn't hold for helpers or plug-ins inside applications. My response to that is they probably don't need the services, and they probably shouldn't be injecting Sparkle inside the host application anyway due to unintended conflicts and other consequences. A more appropriate approach may be to bundle a separate tool such as the sparkle command line utility.
|
||||
|
||||
The `InstallerLauncher` XPC service needs a `JoinExistingSession` key set to `YES` otherwise authorization will not work properly, and even less so on older systems. It took me forever to debug this, so it's worth mentioning.
|
||||
|
||||
|
||||
@@ -249,7 +249,6 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
|
||||
NSData *data = [NSData dataWithContentsOfFile:_downloadFilename];
|
||||
if (data != nil) {
|
||||
NSURLResponse *response = _download.response;
|
||||
assert(response != nil);
|
||||
|
||||
NSURL *responseURL = response.URL;
|
||||
if (responseURL == nil) {
|
||||
@@ -290,7 +289,7 @@ static NSString *SUDownloadingReason = @"Downloading update related file";
|
||||
}
|
||||
}
|
||||
|
||||
// NSURLDownload has a [downlaod:shouldDecodeSourceDataOfMIMEType:] to determine if the data should be decoded.
|
||||
// NSURLDownload has a [download:shouldDecodeSourceDataOfMIMEType:] to determine if the data should be decoded.
|
||||
// This does not exist for NSURLSessionDownloadTask and appears unnecessary. Data tasks will decode data, but not download tasks.
|
||||
|
||||
@end
|
||||
@@ -447,7 +447,7 @@ static BOOL SPUUsesSystemDomainForBundlePath(NSString *path, BOOL rootUser
|
||||
return;
|
||||
}
|
||||
|
||||
// We do however have to copy the progress tool app somewhere safe due to its external depedencies
|
||||
// We do however have to copy the progress tool app somewhere safe due to its external dependencies
|
||||
NSString *progressToolResourcePath = [self pathForBundledTool:@""SPARKLE_INSTALLER_PROGRESS_TOOL_NAME extension:@"app" fromBundle:ourBundle];
|
||||
|
||||
if (progressToolResourcePath == nil) {
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "2.6.0"
|
||||
let version = "2.6.1"
|
||||
// Tag is required to point towards the right asset. SPM requires the tag to follow semantic versioning to be able to resolve it.
|
||||
let tag = "2.6.0"
|
||||
let checksum = "a5088d48a37ba415081335502e009dece75acae9d130705fee6c6988b90d0877"
|
||||
let tag = "2.6.1"
|
||||
let checksum = "f37b84ffdb79f1afef627ab23ddb2c2e3ce1ca496adf3e5b39428fec13af4b62"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ If you are adding a symbol to the public API you must decorate the declaration w
|
||||
|
||||
You do not usually need to build a Sparkle distribution unless you're making changes to Sparkle itself.
|
||||
|
||||
To build a Sparkle distribution, `cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.xz (or .bz2) will be created and revealed in Finder after the build has completed.
|
||||
To build a Sparkle distribution, `cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.xz will be created and revealed in Finder after the build has completed.
|
||||
|
||||
Alternatively, build the Distribution scheme in the Xcode UI.
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Sparkle"
|
||||
s.version = "2.6.0"
|
||||
s.version = "2.6.1"
|
||||
s.summary = "A software update framework for macOS"
|
||||
s.description = "Sparkle is an easy-to-use software update framework for macOS."
|
||||
s.homepage = "https://sparkle-project.org"
|
||||
|
||||
@@ -1339,6 +1339,10 @@
|
||||
7286EE5E28CEC84900163C1D /* SUPlainTextReleaseNotesView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SUPlainTextReleaseNotesView.m; sourceTree = "<group>"; };
|
||||
728ED348277DA23400D9238F /* SPUSparkleDeltaArchive.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SPUSparkleDeltaArchive.h; path = Autoupdate/SPUSparkleDeltaArchive.h; sourceTree = SOURCE_ROOT; };
|
||||
728ED349277DA23400D9238F /* SPUSparkleDeltaArchive.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SPUSparkleDeltaArchive.m; path = Autoupdate/SPUSparkleDeltaArchive.m; sourceTree = SOURCE_ROOT; };
|
||||
728FBA192BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/SUUpdatePermissionPrompt.strings; sourceTree = "<group>"; };
|
||||
728FBA1A2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/SUUpdateAlert.strings; sourceTree = "<group>"; };
|
||||
728FBA1B2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/MainMenu.strings; sourceTree = "<group>"; };
|
||||
728FBA1C2BB5013300651EDF /* nn */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nn; path = nn.lproj/Sparkle.strings; sourceTree = "<group>"; };
|
||||
729924921DF4A45000DBCDF5 /* SUUpdateValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUUpdateValidator.h; path = Sparkle/SUUpdateValidator.h; sourceTree = SOURCE_ROOT; };
|
||||
729924931DF4A45000DBCDF5 /* SUUpdateValidator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUUpdateValidator.m; path = Sparkle/SUUpdateValidator.m; sourceTree = SOURCE_ROOT; };
|
||||
729BB3D11D503826007C4276 /* Downloader.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = Downloader.entitlements; path = Downloader/Downloader.entitlements; sourceTree = SOURCE_ROOT; };
|
||||
@@ -3117,6 +3121,7 @@
|
||||
hr,
|
||||
fa,
|
||||
zh_HK,
|
||||
nn,
|
||||
);
|
||||
mainGroup = 0867D691FE84028FC02AAC07 /* Sparkle */;
|
||||
packageReferences = (
|
||||
@@ -3969,6 +3974,7 @@
|
||||
F67C9B7B281410B600740813 /* hu */,
|
||||
F6E11510281410D10003736C /* ar */,
|
||||
37A5F28528E9219000891504 /* zh_HK */,
|
||||
728FBA1C2BB5013300651EDF /* nn */,
|
||||
);
|
||||
name = Sparkle.strings;
|
||||
sourceTree = "<group>";
|
||||
@@ -4010,6 +4016,7 @@
|
||||
72E1DAB625B3E8AE0001BA6D /* hr */,
|
||||
F67C9B7C281410B600740813 /* hu */,
|
||||
37A5F28728E9219000891504 /* zh_HK */,
|
||||
728FBA1A2BB5013300651EDF /* nn */,
|
||||
);
|
||||
name = SUUpdateAlert.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -4049,6 +4056,7 @@
|
||||
723ABDA0259A9D6300BDB4FA /* uk */,
|
||||
72E1DAB525B3E8AE0001BA6D /* hr */,
|
||||
37A5F28628E9219000891504 /* zh_HK */,
|
||||
728FBA192BB5013300651EDF /* nn */,
|
||||
);
|
||||
name = SUUpdatePermissionPrompt.xib;
|
||||
sourceTree = "<group>";
|
||||
@@ -4099,6 +4107,7 @@
|
||||
72E1DAB725B3E8AE0001BA6D /* hr */,
|
||||
726FD2CB25F4BE5F00123BC6 /* fa */,
|
||||
37A5F28828E9219000891504 /* zh_HK */,
|
||||
728FBA1B2BB5013300651EDF /* nn */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
|
||||
Vendored
+1
-1
@@ -230,7 +230,7 @@
|
||||
}
|
||||
} else {
|
||||
// When no updates are found in the appcast
|
||||
// We will need to assume the user is up to date if the feed doen't have any applicable update items
|
||||
// We will need to assume the user is up to date if the feed doesn't have any applicable update items
|
||||
// There could be update items on channels the updater is not subscribed to for example. But we can't tell the user about them.
|
||||
// There could also only be update items available for other platforms or none at all.
|
||||
localizedDescription = SULocalizedStringFromTableInBundle(@"You’re up to date!", SPARKLE_TABLE, sparkleBundle, "Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates.");
|
||||
|
||||
Vendored
+1
-1
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)downloadDriverWillBeginDownload;
|
||||
|
||||
// For persitent update downloads
|
||||
// For persistent update downloads
|
||||
- (void)downloadDriverDidDownloadUpdate:(SPUDownloadedUpdate *)downloadedUpdate;
|
||||
|
||||
// For temporary downloads
|
||||
|
||||
+3
-3
@@ -28,10 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/**
|
||||
A controller class that instantiates a `SPUUpdater` and allows binding UI to its updater settings.
|
||||
|
||||
This class can be instantiated in a nib or created programatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
|
||||
This class can be instantiated in a nib or created programmatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
|
||||
|
||||
The controller's updater targets the application's main bundle and uses Sparkle's standard user interface.
|
||||
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programatically too.
|
||||
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programmatically too.
|
||||
|
||||
The controller creates an `SPUUpdater` instance using a `SPUStandardUserDriver` and allows hooking up the check for updates action and handling menu item validation.
|
||||
It also allows hooking up the updater's and user driver's delegates.
|
||||
@@ -71,7 +71,7 @@ SU_EXPORT @interface SPUStandardUpdaterController : NSObject
|
||||
|
||||
You cannot call this initializer directly. You must instantiate a `SPUStandardUpdaterController` inside of a nib (typically the MainMenu nib) to use it.
|
||||
|
||||
To create a `SPUStandardUpdaterController` programatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
|
||||
To create a `SPUStandardUpdaterController` programmatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
|
||||
*/
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -52,7 +52,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
|
||||
Related: See `SPUStandardUpdaterController` which wraps a `SPUUpdater` instance and is suitable for instantiating inside of nib files.
|
||||
|
||||
@param hostBundle The bundle that should be targetted for updating.
|
||||
@param hostBundle The bundle that should be targeted for updating.
|
||||
@param applicationBundle The application bundle that should be waited for termination and relaunched (unless overridden). Usually this can be the same as hostBundle. This may differ when updating a plug-in or other non-application bundle.
|
||||
@param userDriver The user driver that Sparkle uses for user update interaction.
|
||||
@param delegate The delegate for `SPUUpdater`.
|
||||
@@ -114,7 +114,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
to ask the user's permission to check for updates automatically and `automaticallyChecksForUpdates` is `NO`.
|
||||
If you want to reset the updater's cycle after an updater setting change, see `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
|
||||
|
||||
This is meant for programmatically initating a check for updates in the background without the user initiating it.
|
||||
This is meant for programmatically initiating a check for updates in the background without the user initiating it.
|
||||
This check will not show UI if no new updates are found.
|
||||
|
||||
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
|
||||
@@ -307,7 +307,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
|
||||
|
||||
Note if Sparkle is being used to update another application, the bundle information retrieved is from the main application performing the updating.
|
||||
|
||||
This default implementation can be overrided.
|
||||
This default implementation can be overridden.
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userAgentString;
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -722,7 +722,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
}
|
||||
|
||||
// Notify host app that update driver has finished
|
||||
// As long as we're not going to immmediately kick off a new check
|
||||
// As long as we're not going to immediately kick off a new check
|
||||
if (!shouldShowUpdateImmediately && [delegate respondsToSelector:@selector((updater:didFinishUpdateCycleForUpdateCheck:error:))]) {
|
||||
[delegate updater:self didFinishUpdateCycleForUpdateCheck:updateCheck error:error];
|
||||
}
|
||||
@@ -977,7 +977,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
|
||||
if (![NSThread isMainThread]) {
|
||||
SULog(SULogLevelError, @"Error: -[SPUUpdater retrieveFeedURL:error:] must be called on the main thread.");
|
||||
if (error != NULL) {
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUIncorrectAPIUsageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"SUUpdater -retriveFeedURL:error: must be called on the main thread for %@", hostName]}];
|
||||
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUIncorrectAPIUsageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"SUUpdater -retrieveFeedURL:error: must be called on the main thread for %@", hostName]}];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -288,7 +288,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
|
||||
- (void)updater:(SPUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
|
||||
|
||||
/**
|
||||
Called immediately after succesfull download of the specified update.
|
||||
Called immediately after successful download of the specified update.
|
||||
|
||||
@param updater The SUUpdater instance.
|
||||
@param item The appcast item corresponding to the update that has been downloaded.
|
||||
|
||||
Vendored
+11
-7
@@ -46,7 +46,7 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply;
|
||||
|
||||
/**
|
||||
* Show the user initating an update check
|
||||
* Show the user initiating an update check
|
||||
*
|
||||
* Respond to the user initiating an update check. Sparkle uses this to show the user a window with an indeterminate progress bar.
|
||||
*
|
||||
@@ -64,11 +64,11 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
*
|
||||
* `SPUUpdateStateNotDownloaded` - Update has not been downloaded yet.
|
||||
*
|
||||
* `SPUUpdateStateDownloaded` - Update has already been downloaded but not started installing yet.
|
||||
* `SPUUpdateStateDownloaded` - Update has already been downloaded in the background automatically (via `SUAutomaticallyUpdate`) but not started installing yet.
|
||||
*
|
||||
* `SPUUpdateStateInstalling` - Update has been downloaded and already started installing.
|
||||
*
|
||||
* The `userIntiated` property on the @c state indicates if the update was initiated by the user or if it was automatically scheduled in the background.
|
||||
* The `userInitiated` property on the @c state indicates if the update was initiated by the user or if it was automatically scheduled in the background.
|
||||
*
|
||||
* Additionally, these properties on the @c appcastItem are of importance:
|
||||
*
|
||||
@@ -78,9 +78,10 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
*
|
||||
* @c appcastItem.criticalUpdate indicates if the update is a critical update.
|
||||
*
|
||||
* A reply of `SPUUserUpdateChoiceInstall` begins or resumes downloading or installing the update.
|
||||
* A reply of `SPUUserUpdateChoiceInstall` begins or resumes downloading, extracting, or installing the update.
|
||||
* If the state.stage is `SPUUserUpdateStateInstalling`, this may send a quit event to the application and relaunch it immediately (in this state, this behaves as a fast "install and Relaunch").
|
||||
* Do not use this reply if @c appcastItem.informationOnlyUpdate is YES.
|
||||
* If the state.stage is `SPUUpdateStateNotDownloaded` or `SPUUpdateStateDownloaded` the user may be presented an authorization prompt to install the update after `-showDownloadDidStartExtractingUpdate` is called if authorization is required for installation. For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
|
||||
* Do not use a reply of `SPUUserUpdateChoiceInstall` if @c appcastItem.informationOnlyUpdate is YES.
|
||||
*
|
||||
* A reply of `SPUUserUpdateChoiceDismiss` dismisses the update for the time being. The user may be reminded of the update at a later point.
|
||||
* If the state.stage is `SPUUserUpdateStateDownloaded`, the downloaded update is kept after dismissing until the next time an update is shown to the user.
|
||||
@@ -183,8 +184,11 @@ SU_EXPORT @protocol SPUUserDriver <NSObject>
|
||||
*
|
||||
* Sparkle uses this to show an indeterminate progress bar.
|
||||
*
|
||||
* Note that an update can resume at this point after having been downloaded before,
|
||||
* so this may be called without any of the download callbacks being invoked prior.
|
||||
* Before this point, `showDownloadDidReceiveDataOfLength:` or `showUpdateFoundWithAppcastItem:state:reply:` may be called.
|
||||
* An update can potentially resume at this point after having been automatically downloaded in the background (without the user driver) before.
|
||||
*
|
||||
* After extraction starts, the user may be shown an authorization prompt to install the update if authorization is required for installation.
|
||||
* For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
|
||||
*/
|
||||
- (void)showDownloadDidStartExtractingUpdate;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -49,7 +49,7 @@ static NSString *SUAppcastItemDeltaFromSparkleLocalesKey = @"SUAppcastItemDeltaF
|
||||
|
||||
@implementation SUAppcastItem
|
||||
{
|
||||
// Auxillary appcast item state that needs to be evaluated based on the host state
|
||||
// Auxiliary appcast item state that needs to be evaluated based on the host state
|
||||
// This may be nil if the client creates an SUAppcastItem with a deprecated initializer
|
||||
// In that case we will need to fallback to safe behavior
|
||||
SPUAppcastItemState *_state;
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@
|
||||
|
||||
// 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)
|
||||
// this assumption 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 = [host.bundle isEqualTo:[NSBundle mainBundle]];
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -17,7 +17,8 @@
|
||||
|
||||
#define SPARKLE_TABLE @"Sparkle"
|
||||
|
||||
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment)
|
||||
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) (NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) ?: key)
|
||||
|
||||
#else
|
||||
#define SULocalizedStringFromTableInBundle(key, tbl, bundle, comment) key
|
||||
#endif
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ typedef NS_ENUM(uint8_t, SULogLevel) {
|
||||
SULogLevelError
|
||||
};
|
||||
|
||||
// Logging utlity function that is thread-safe and uses os_log
|
||||
// Logging utility function that is thread-safe and uses os_log
|
||||
// For debugging command line tools, you may have to use Console.app or log(1) to view log messages
|
||||
// Try to keep log messages as compact/short as possible
|
||||
void SULog(SULogLevel level, NSString *format, ...) NS_FORMAT_FUNCTION(2, 3);
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@ void SULog(SULogLevel level, NSString *format, ...)
|
||||
switch (level) {
|
||||
case SULogLevelDefault:
|
||||
// See docs for OS_LOG_TYPE_DEFAULT
|
||||
// By default, OS_LOG_TYPE_DEFAULT seems to be more noticable than OS_LOG_TYPE_INFO
|
||||
// By default, OS_LOG_TYPE_DEFAULT seems to be more noticeable than OS_LOG_TYPE_INFO
|
||||
os_log(logger, "%{public}@", logMessage);
|
||||
break;
|
||||
case SULogLevelError:
|
||||
|
||||
Vendored
+4
-4
@@ -14,7 +14,7 @@
|
||||
#import "SULocalizations.h"
|
||||
#import "SUTouchBarButtonGroup.h"
|
||||
|
||||
static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUStatusController";
|
||||
static NSString *const SUStatusControllerTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUStatusController";
|
||||
|
||||
@interface SUStatusController () <NSTouchBarDelegate>
|
||||
|
||||
@@ -162,15 +162,15 @@ static NSString *const SUStatusControllerTouchBarIndentifier = @"" SPARKLE_BUNDL
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUStatusControllerTouchBarIndentifier;
|
||||
touchBar.defaultItemIdentifiers = @[ SUStatusControllerTouchBarIdentifier,];
|
||||
touchBar.principalItemIdentifier = SUStatusControllerTouchBarIdentifier;
|
||||
touchBar.delegate = self;
|
||||
return touchBar;
|
||||
}
|
||||
|
||||
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
{
|
||||
if ([identifier isEqualToString:SUStatusControllerTouchBarIndentifier]) {
|
||||
if ([identifier isEqualToString:SUStatusControllerTouchBarIdentifier]) {
|
||||
NSCustomTouchBarItem *item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
|
||||
SUTouchBarButtonGroup *group = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_actionButton,]];
|
||||
item.viewController = group;
|
||||
|
||||
Vendored
+21
-63
@@ -31,7 +31,7 @@
|
||||
#import "SPUXPCServiceInfo.h"
|
||||
#import "SPUUserUpdateState.h"
|
||||
|
||||
static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdateAlert";
|
||||
static NSString *const SUUpdateAlertTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdateAlert";
|
||||
|
||||
@interface SUUpdateAlert () <NSTouchBarDelegate>
|
||||
@end
|
||||
@@ -42,7 +42,7 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
SUHost *_host;
|
||||
SPUUserUpdateState *_state;
|
||||
NSProgressIndicator *_releaseNotesSpinner;
|
||||
NSBox *_darkBackgroundView;
|
||||
NSBox *_backgroundView;
|
||||
id<SUReleaseNotesView> _releaseNotesView;
|
||||
id<SUVersionDisplay> _versionDisplayer;
|
||||
|
||||
@@ -58,7 +58,6 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
void(^_completionBlock)(SPUUserUpdateChoice, NSRect, BOOL);
|
||||
|
||||
BOOL _allowsAutomaticUpdates;
|
||||
BOOL _observingAppearance;
|
||||
}
|
||||
|
||||
- (instancetype)initWithAppcastItem:(SUAppcastItem *)item state:(SPUUserUpdateState *)state host:(SUHost *)aHost versionDisplayer:(id<SUVersionDisplay>)versionDisplayer completionBlock:(void (^)(SPUUserUpdateChoice, NSRect, BOOL))completionBlock didBecomeKeyBlock:(void (^)(void))didBecomeKeyBlock
|
||||
@@ -183,62 +182,6 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
}
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(__attribute__((unused)) NSDictionary<NSKeyValueChangeKey,id> *)change context:(__attribute__((unused)) void *)context {
|
||||
if (@available(macOS 10.14, *)) {
|
||||
if (object == _releaseNotesView.view && [keyPath isEqualToString:@"effectiveAppearance"]) {
|
||||
[self adaptReleaseNotesAppearance];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
if (@available(macOS 10.14, *)) {
|
||||
if (_observingAppearance) {
|
||||
[_releaseNotesView.view removeObserver:self forKeyPath:@"effectiveAppearance"];
|
||||
_observingAppearance = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)adaptReleaseNotesAppearance SPU_OBJC_DIRECT
|
||||
{
|
||||
if (@available(macOS 10.14, *)) {
|
||||
NSAppearanceName bestAppearance = [_releaseNotesView.view.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]];
|
||||
if ([bestAppearance isEqualToString:NSAppearanceNameDarkAqua])
|
||||
{
|
||||
// Remove web view background...
|
||||
[_releaseNotesView setDrawsBackground:NO];
|
||||
// ... and use NSBox to get the dynamically colored background
|
||||
if (_darkBackgroundView == nil)
|
||||
{
|
||||
_darkBackgroundView = [[NSBox alloc] initWithFrame:_releaseNotesView.view.frame];
|
||||
_darkBackgroundView.boxType = NSBoxCustom;
|
||||
_darkBackgroundView.fillColor = [NSColor textBackgroundColor];
|
||||
_darkBackgroundView.borderColor = [NSColor clearColor];
|
||||
// Using auto-resizing mask instead of contraints works well enough
|
||||
_darkBackgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
[_releaseNotesView.view.superview addSubview:_darkBackgroundView positioned:NSWindowBelow relativeTo:_releaseNotesView.view];
|
||||
|
||||
// The release note user stylesheet will not adjust to the user changing the theme until adaptReleaseNoteAppearance is called again.
|
||||
// So lock the appearance of the background to keep the text readable if the system theme changes.
|
||||
_darkBackgroundView.appearance = _darkBackgroundView.effectiveAppearance;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Restore standard dark on light appearance
|
||||
[_darkBackgroundView removeFromSuperview];
|
||||
_darkBackgroundView = nil;
|
||||
[_releaseNotesView setDrawsBackground:YES];
|
||||
}
|
||||
|
||||
if (!_observingAppearance) {
|
||||
[_releaseNotesView.view addObserver:self forKeyPath:@"effectiveAppearance" options:0 context:nil];
|
||||
_observingAppearance = YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData
|
||||
{
|
||||
if (![self showsReleaseNotes]) {
|
||||
@@ -372,7 +315,22 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
_releaseNotesView.view.frame = boxContentView.bounds;
|
||||
_releaseNotesView.view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
|
||||
[self adaptReleaseNotesAppearance];
|
||||
if (@available(macOS 10.14, *)) {
|
||||
// We need a transparent background
|
||||
// This avoids a "white flash" that may be present when the webview initially loads in dark mode
|
||||
// This also is necessary for macOS 10.14, otherwise the background may stay white on 10.14 (but not in later OS's)
|
||||
[_releaseNotesView setDrawsBackground:NO];
|
||||
|
||||
// Use NSBox to get the proper dynamically colored background behind the release notes view when
|
||||
// the release notes view background is transparent
|
||||
_backgroundView = [[NSBox alloc] initWithFrame:_releaseNotesView.view.frame];
|
||||
_backgroundView.boxType = NSBoxCustom;
|
||||
_backgroundView.fillColor = [NSColor textBackgroundColor];
|
||||
_backgroundView.borderColor = [NSColor clearColor];
|
||||
// Using auto-resizing mask instead of constraints works well enough
|
||||
_backgroundView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
|
||||
[_releaseNotesView.view.superview addSubview:_backgroundView positioned:NSWindowBelow relativeTo:_releaseNotesView.view];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidLoad
|
||||
@@ -531,15 +489,15 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIndentifier;
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdateAlertTouchBarIdentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdateAlertTouchBarIdentifier;
|
||||
touchBar.delegate = self;
|
||||
return touchBar;
|
||||
}
|
||||
|
||||
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
{
|
||||
if ([identifier isEqualToString:SUUpdateAlertTouchBarIndentifier]) {
|
||||
if ([identifier isEqualToString:SUUpdateAlertTouchBarIdentifier]) {
|
||||
NSCustomTouchBarItem* item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
|
||||
item.viewController = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_installButton, _laterButton, _skipButton]];
|
||||
return item;
|
||||
|
||||
Vendored
+4
-4
@@ -18,7 +18,7 @@
|
||||
#import "SUApplicationInfo.h"
|
||||
#import "SUTouchBarButtonGroup.h"
|
||||
|
||||
static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdatePermissionPrompt";
|
||||
static NSString *const SUUpdatePermissionPromptTouchBarIdentifier = @"" SPARKLE_BUNDLE_IDENTIFIER ".SUUpdatePermissionPrompt";
|
||||
|
||||
@interface SUUpdatePermissionPrompt () <NSTouchBarDelegate>
|
||||
|
||||
@@ -166,15 +166,15 @@ static NSString *const SUUpdatePermissionPromptTouchBarIndentifier = @"" SPARKLE
|
||||
- (NSTouchBar *)makeTouchBar
|
||||
{
|
||||
NSTouchBar *touchBar = [[NSTouchBar alloc] init];
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIndentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIndentifier;
|
||||
touchBar.defaultItemIdentifiers = @[SUUpdatePermissionPromptTouchBarIdentifier,];
|
||||
touchBar.principalItemIdentifier = SUUpdatePermissionPromptTouchBarIdentifier;
|
||||
touchBar.delegate = self;
|
||||
return touchBar;
|
||||
}
|
||||
|
||||
- (NSTouchBarItem *)touchBar:(NSTouchBar * __unused)touchBar makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
{
|
||||
if ([identifier isEqualToString:SUUpdatePermissionPromptTouchBarIndentifier]) {
|
||||
if ([identifier isEqualToString:SUUpdatePermissionPromptTouchBarIdentifier]) {
|
||||
NSCustomTouchBarItem* item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
|
||||
item.viewController = [[SUTouchBarButtonGroup alloc] initByReferencingButtons:@[_checkButton, _cancelButton]];
|
||||
return item;
|
||||
|
||||
Vendored
+2
-2
@@ -83,7 +83,7 @@ SU_EXPORT @interface SUUpdater : NSObject
|
||||
/*!
|
||||
Checks for updates, but does not display any UI unless an update is found.
|
||||
|
||||
This is meant for programmatically initating a check for updates. That is,
|
||||
This is meant for programmatically initiating a check for updates. That is,
|
||||
it will display no UI unless it actually finds an update, in which case it
|
||||
proceeds as usual.
|
||||
|
||||
@@ -160,7 +160,7 @@ SU_EXPORT @interface SUUpdater : NSObject
|
||||
/*!
|
||||
The user agent used when checking for and downloading updates.
|
||||
|
||||
The default implementation can be overrided.
|
||||
The default implementation can be overridden.
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *userAgentString;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -196,7 +196,7 @@ static NSMutableDictionary *sharedUpdaters = nil;
|
||||
{
|
||||
if (_delayShowingUserUpdate) {
|
||||
// We don't know if SUUpdater delegate will call checkForUpdates: or checkForUpdatesInBackground
|
||||
// to bring a deffered update alert back in 1.x.
|
||||
// to bring a deferred update alert back in 1.x.
|
||||
// So if checkForUpdatesInBackground is called we will bring the update back in focus
|
||||
[self checkForUpdates:nil];
|
||||
} else {
|
||||
|
||||
Vendored
+1
-1
@@ -156,7 +156,7 @@ __deprecated_msg("Deprecated in Sparkle 2. See SPUUpdaterDelegate instead")
|
||||
- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
|
||||
|
||||
/*!
|
||||
Called immediately after succesfull download of the specified update.
|
||||
Called immediately after successful download of the specified update.
|
||||
|
||||
\param updater The SUUpdater instance.
|
||||
\param item The appcast item corresponding to the update that has been downloaded.
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */
|
||||
"5.title" = "Programoppdatering";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */
|
||||
"170.title" = "Om oppdateringen:";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */
|
||||
"171.title" = "Utsett";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Skip This Version"; ObjectID = "172"; */
|
||||
"172.title" = "Hopp over";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Install Update"; ObjectID = "173"; */
|
||||
"173.title" = "Installer";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */
|
||||
"175.title" = "Last ned og installer automatisk i framtida";
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "43"; */
|
||||
"43.title" = "Text Cell";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Text Cell"; ObjectID = "45"; */
|
||||
"45.title" = "Text Cell";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Anonymous system profile information is used to help us plan future development work. Please contact us if you have any questions about this.\n\nThis is the information that would be sent:"; ObjectID = "183"; */
|
||||
"183.title" = "Den anonyme systemprofilen hjelper oss med å planleggja framtidig utviklingsarbeid. Ta gjerne kontakt med oss om du har spørsmål om dette.
\nFølgjande innhald vil bli sendt:";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Don’t Check"; ObjectID = "cCJ-V0-aTi"; */
|
||||
"cCJ-V0-aTi.title" = "Ikkje sjå etter";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Check for updates automatically?"; ObjectID = "gmh-T4-BO0"; */
|
||||
"gmh-T4-BO0.title" = "Sjå etter etter oppdateringar automatisk?";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Include anonymous system profile"; ObjectID = "gz7-LM-gNf"; */
|
||||
"gz7-LM-gNf.title" = "Inkluder anonym systemprofil";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Automatically download and install updates"; ObjectID = "AUc-33-qGN"; */
|
||||
"AUc-33-qGN.title" = "Last ned og installer automatisk";
|
||||
|
||||
/* Class = "NSButtonCell"; title = "Check Automatically"; ObjectID = "OhZ-1K-DmA"; */
|
||||
"OhZ-1K-DmA.title" = "Sjå etter automatisk";
|
||||
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available." = "%1$@ %2$@ er nyaste versjon.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%1$@ %2$@ er nyaste versjon.\n(Du køyrer versjon %3$@ akkurat no.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%1$@ %2$@ er no tilgjengeleg — du har %3$@. Ynskjer du å lasta ned og installera no?";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ nedlasta";
|
||||
|
||||
/* The download progress in units of bytes, e.g. 100 KB of 1,0 MB */
|
||||
"%@ of %@" = "%1$@ av %2$@";
|
||||
|
||||
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er lasta ned og er klar til bruk! Dette er ei viktig oppdatering; ynskjer du å installera og starta om att %1$@ no?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er lasta ned og er klar til bruk! Ynskjer du å installera og starta om att %1$@ no?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan ikkje oppdaterast frå ei eining som berre kan lesast, t.d. frå ein cd";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"A new version of %@ is available!" = "Ein ny versjon av %@ er tilgjengeleg!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"A new version of %@ is ready to install!" = "Ein ny versjon av %@ er klar for installering!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred in retrieving update information. Please try again later." = "Ein feil oppstod ved henting av oppdateringsinformasjon. Ver greid og prøv igjen seinare.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while downloading the update. Please try again later." = "Ein feil oppstod under nedlasting av oppdateringa. Ver greid og prøv igjen seinare.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while extracting the archive. Please try again later." = "Ein feil oppstod under utpakking av oppdateringa. Ver greid og prøv igjen seinare.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An error occurred while parsing the update feed." = "Ein feil oppstod under lesing av oppdateringsstraumen.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"An important update to %@ is ready to install" = "Ei viktig oppdatering for %@ er klar til å verta installert";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Cancel" = "Avbryt";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Cancel Update" = "Avbryt oppdateringa";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Checking for updates…" = "Ser etter oppdateringar…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Downloading update…" = "Lastar ned oppdateringa…";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Extracting update…" = "Pakkar ut oppdateringa…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Install and Relaunch" = "Installer og start på nytt";
|
||||
|
||||
/* Take care not to overflow the status window. */
|
||||
"Installing update…" = "Installerer oppdateringa…";
|
||||
|
||||
/* Alternate title for 'Install Update' button when there's no download in RSS feed. */
|
||||
"Learn More…" = "Meir info…";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"OK" = "Greitt";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Ready to Install" = "Klar til å installera";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Should %1$@ automatically check for updates? You can always check for updates manually from the %1$@ menu." = "Skal %1$@ sjå automatisk etter oppdateringar? Du kan når som helst sjå etter manuelt i %1$@-menyen.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Update Error!" = "Feil ved oppdateringa!";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Updating %@" = "Oppdaterer %@";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again." = "Flytt %1$@ til Programmer-mappa, start på nytt og prøv igjen.";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You’re up to date!" = "Ingen nye oppdateringar";
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */
|
||||
"5.title" = "Bring All to Front";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */
|
||||
"19.title" = "Window";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */
|
||||
"23.title" = "Minimize";
|
||||
|
||||
/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */
|
||||
"24.title" = "Window";
|
||||
|
||||
/* Class = "NSMenu"; title = "MainMenu"; ObjectID = "29"; */
|
||||
"29.title" = "MainMenu";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Sparkle Test App"; ObjectID = "56"; */
|
||||
"56.title" = "Sparkle Test App";
|
||||
|
||||
/* Class = "NSMenu"; title = "Sparkle Test App"; ObjectID = "57"; */
|
||||
"57.title" = "Sparkle Test App";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "About Sparkle Test App"; ObjectID = "58"; */
|
||||
"58.title" = "About Sparkle Test App";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Open..."; ObjectID = "72"; */
|
||||
"72.title" = "Open...";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
|
||||
"73.title" = "Close";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Save"; ObjectID = "75"; */
|
||||
"75.title" = "Save";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Page Setup…"; ObjectID = "77"; */
|
||||
"77.title" = "Page Setup…";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "78"; */
|
||||
"78.title" = "Print…";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Save As…"; ObjectID = "80"; */
|
||||
"80.title" = "Save As…";
|
||||
|
||||
/* Class = "NSMenu"; title = "File"; ObjectID = "81"; */
|
||||
"81.title" = "File";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "New"; ObjectID = "82"; */
|
||||
"82.title" = "New";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
|
||||
"83.title" = "File";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Help"; ObjectID = "103"; */
|
||||
"103.title" = "Help";
|
||||
|
||||
/* Class = "NSMenu"; title = "Help"; ObjectID = "106"; */
|
||||
"106.title" = "Help";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Sparkle Test App Help"; ObjectID = "111"; */
|
||||
"111.title" = "Sparkle Test App Help";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Revert"; ObjectID = "112"; */
|
||||
"112.title" = "Revert";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Open Recent"; ObjectID = "124"; */
|
||||
"124.title" = "Open Recent";
|
||||
|
||||
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
|
||||
"125.title" = "Open Recent";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Clear Menu"; ObjectID = "126"; */
|
||||
"126.title" = "Clear Menu";
|
||||
|
||||
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
|
||||
"130.title" = "Services";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
|
||||
"131.title" = "Services";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Hide Sparkle Test App"; ObjectID = "134"; */
|
||||
"134.title" = "Hide Sparkle Test App";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Quit Sparkle Test App"; ObjectID = "136"; */
|
||||
"136.title" = "Quit Sparkle Test App";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
|
||||
"145.title" = "Hide Others";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
|
||||
"150.title" = "Show All";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Find…"; ObjectID = "154"; */
|
||||
"154.title" = "Find…";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Jump to Selection"; ObjectID = "155"; */
|
||||
"155.title" = "Jump to Selection";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "157"; */
|
||||
"157.title" = "Copy";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "158"; */
|
||||
"158.title" = "Undo";
|
||||
|
||||
/* Class = "NSMenu"; title = "Find"; ObjectID = "159"; */
|
||||
"159.title" = "Find";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "160"; */
|
||||
"160.title" = "Cut";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Use Selection for Find"; ObjectID = "161"; */
|
||||
"161.title" = "Use Selection for Find";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Find Previous"; ObjectID = "162"; */
|
||||
"162.title" = "Find Previous";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "163"; */
|
||||
"163.title" = "Edit";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "164"; */
|
||||
"164.title" = "Delete";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Find Next"; ObjectID = "167"; */
|
||||
"167.title" = "Find Next";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Find"; ObjectID = "168"; */
|
||||
"168.title" = "Find";
|
||||
|
||||
/* Class = "NSMenu"; title = "Edit"; ObjectID = "169"; */
|
||||
"169.title" = "Edit";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "171"; */
|
||||
"171.title" = "Paste";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "172"; */
|
||||
"172.title" = "Select All";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "173"; */
|
||||
"173.title" = "Redo";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Spelling"; ObjectID = "184"; */
|
||||
"184.title" = "Spelling";
|
||||
|
||||
/* Class = "NSMenu"; title = "Spelling"; ObjectID = "185"; */
|
||||
"185.title" = "Spelling";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Spelling…"; ObjectID = "187"; */
|
||||
"187.title" = "Spelling…";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Check Spelling"; ObjectID = "189"; */
|
||||
"189.title" = "Check Spelling";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Check Spelling as You Type"; ObjectID = "191"; */
|
||||
"191.title" = "Check Spelling as You Type";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "197"; */
|
||||
"197.title" = "Zoom";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "204"; */
|
||||
"204.title" = "Paste and Match Style";
|
||||
|
||||
/* Class = "NSMenuItem"; title = "Check for Updates…"; ObjectID = "207"; */
|
||||
"207.title" = "Check for Updates…";
|
||||
@@ -71,10 +71,10 @@ class SUAppcastTest: XCTestCase {
|
||||
XCTAssertEqual(latestDeltaItem!.fileURL!.lastPathComponent, "3.0_from_2.0.patch")
|
||||
|
||||
// Test a delta item that does not exist
|
||||
var nonexistantDeltaItem: SUAppcastItem?
|
||||
SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcastItems, getDeltaItem: &nonexistantDeltaItem, withHostVersion: "2.1", comparator: SUStandardVersionComparator())
|
||||
var nonexistentDeltaItem: SUAppcastItem?
|
||||
SUAppcastDriver.bestItem(fromAppcastItems: supportedAppcastItems, getDeltaItem: &nonexistentDeltaItem, withHostVersion: "2.1", comparator: SUStandardVersionComparator())
|
||||
|
||||
XCTAssertNil(nonexistantDeltaItem)
|
||||
XCTAssertNil(nonexistentDeltaItem)
|
||||
} catch let err as NSError {
|
||||
NSLog("%@", err)
|
||||
XCTFail(err.localizedDescription)
|
||||
|
||||
@@ -225,7 +225,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testSameNonexistantSymlinkDiff
|
||||
- (void)testSameNonexistentSymlinkDiff
|
||||
{
|
||||
[self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
|
||||
@@ -246,7 +246,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testDifferentNonexistantSymlinkDiff
|
||||
- (void)testDifferentNonexistentSymlinkDiff
|
||||
{
|
||||
[self createAndApplyPatchWithHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
|
||||
@@ -267,7 +267,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testNonexistantSymlinkPermissionDiff
|
||||
- (void)testNonexistentSymlinkPermissionDiff
|
||||
{
|
||||
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
NSString *sourceFile = [sourceDirectory stringByAppendingPathComponent:@"A"];
|
||||
@@ -309,7 +309,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)testNonexistantSymlinkPermissionBadDiff
|
||||
- (void)testNonexistentSymlinkPermissionBadDiff
|
||||
{
|
||||
// Even though destination has a 0777 symlink permission, we only respect 0755 for symlinks
|
||||
[self createAndApplyPatchWithBeforeDiffHandler:^(NSFileManager *fileManager, NSString *sourceDirectory, NSString *destinationDirectory) {
|
||||
@@ -962,7 +962,7 @@ typedef void (^SUDeltaHandler)(NSFileManager *fileManager, NSString *sourceDirec
|
||||
NSNumber *permissionAttribute = attributes[NSFilePosixPermissions];
|
||||
XCTAssertNotNil(permissionAttribute);
|
||||
|
||||
// Test default symlink permissons are correct
|
||||
// Test default symlink permissions are correct
|
||||
unsigned short permissions = permissionAttribute.unsignedShortValue & PERMISSION_FLAGS;
|
||||
XCTAssertEqual(permissions, VALID_SYMBOLIC_LINK_PERMISSIONS);
|
||||
}];
|
||||
|
||||
@@ -24,10 +24,9 @@ class SUUnarchiverTest: XCTestCase
|
||||
let unarchivedSuccessExpectation = super.expectation(description: "Unarchived Success (format: \(archiveExtension))")
|
||||
let unarchivedFailureExpectation = super.expectation(description: "Unarchived Failure (format: \(archiveExtension))")
|
||||
|
||||
let tempArchiveURL = tempDirectoryURL.appendingPathComponent(archiveResourceURL.lastPathComponent)
|
||||
let extractedAppURL = tempDirectoryURL.appendingPathComponent(extractedAppName).appendingPathExtension("app")
|
||||
|
||||
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, tempArchiveURL: tempArchiveURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
|
||||
self.unarchiveTestAppWithExtension(archiveExtension, appName: appName, tempDirectoryURL: tempDirectoryURL, archiveResourceURL: archiveResourceURL, password: password, expectingInstallationType: installationType, expectingSuccess: expectingSuccess, testExpectation: unarchivedSuccessExpectation)
|
||||
self.unarchiveNonExistentFileTestFailureAppWithExtension(archiveExtension, tempDirectoryURL: tempDirectoryURL, password: password, expectingInstallationType: installationType, testExpectation: unarchivedFailureExpectation)
|
||||
|
||||
super.waitForExpectations(timeout: 30.0, handler: nil)
|
||||
@@ -40,7 +39,7 @@ class SUUnarchiverTest: XCTestCase
|
||||
|
||||
func unarchiveNonExistentFileTestFailureAppWithExtension(_ archiveExtension: String, tempDirectoryURL: URL, password: String?, expectingInstallationType installationType: String, testExpectation: XCTestExpectation) {
|
||||
let tempArchiveURL = tempDirectoryURL.appendingPathComponent("error-invalid").appendingPathExtension(archiveExtension)
|
||||
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||
|
||||
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||
XCTAssertNotNil(error)
|
||||
@@ -49,13 +48,9 @@ class SUUnarchiverTest: XCTestCase
|
||||
}
|
||||
|
||||
// swiftlint:disable function_parameter_count
|
||||
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, tempArchiveURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
|
||||
|
||||
let fileManager = FileManager.default
|
||||
|
||||
try! fileManager.copyItem(at: archiveResourceURL, to: tempArchiveURL)
|
||||
|
||||
let unarchiver = SUUnarchiver.unarchiver(forPath: tempArchiveURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||
func unarchiveTestAppWithExtension(_ archiveExtension: String, appName: String, tempDirectoryURL: URL, archiveResourceURL: URL, password: String?, expectingInstallationType installationType: String, expectingSuccess: Bool, testExpectation: XCTestExpectation) {
|
||||
|
||||
let unarchiver = SUUnarchiver.unarchiver(forPath: archiveResourceURL.path, extractionDirectory: tempDirectoryURL.path, updatingHostBundlePath: nil, decryptionPassword: password, expectingInstallationType: installationType)!
|
||||
|
||||
unarchiver.unarchive(completionBlock: {(error: Error?) -> Void in
|
||||
if expectingSuccess {
|
||||
@@ -133,7 +128,7 @@ class SUUnarchiverTest: XCTestCase
|
||||
#endif
|
||||
|
||||
#if SPARKLE_BUILD_PACKAGE_SUPPORT
|
||||
func testUnarchivingFlatPackage()
|
||||
func testUnarchivingBarePackage()
|
||||
{
|
||||
self.unarchiveTestAppWithExtension("pkg", resourceName: "test", expectingInstallationType: SPUInstallationTypeGuidedPackage)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ extension FileHandle {
|
||||
|
||||
extension URL {
|
||||
|
||||
/// Calculates the SHA-256 hash of the file referened by the URL.
|
||||
/// Calculates the SHA-256 hash of the file referenced by the URL.
|
||||
///
|
||||
/// - Returns: The SHA-256 hash of the file (as a hexadecimal string), or `nil` if
|
||||
/// the URL doesn't point to a file.
|
||||
|
||||
@@ -6,40 +6,17 @@
|
||||
import Foundation
|
||||
|
||||
func unarchive(itemPath: URL, archiveDestDir: URL, callback: @escaping (Error?) -> Void) {
|
||||
let fileManager = FileManager.default
|
||||
let tempDir = archiveDestDir.appendingPathExtension("tmp")
|
||||
let itemCopy = tempDir.appendingPathComponent(itemPath.lastPathComponent)
|
||||
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemPath.path, extractionDirectory: archiveDestDir.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
|
||||
unarchiver.unarchive(completionBlock: { (error: Error?) in
|
||||
if error != nil {
|
||||
callback(error)
|
||||
return
|
||||
}
|
||||
|
||||
_ = try? fileManager.createDirectory(at: tempDir, withIntermediateDirectories: true, attributes: [:])
|
||||
|
||||
do {
|
||||
do {
|
||||
try fileManager.linkItem(at: itemPath, to: itemCopy)
|
||||
} catch {
|
||||
try fileManager.copyItem(at: itemPath, to: itemCopy)
|
||||
}
|
||||
if let unarchiver = SUUnarchiver.unarchiver(forPath: itemCopy.path, updatingHostBundlePath: nil, decryptionPassword: nil, expectingInstallationType: SPUInstallationTypeApplication) {
|
||||
unarchiver.unarchive(completionBlock: { (error: Error?) in
|
||||
if error != nil {
|
||||
callback(error)
|
||||
return
|
||||
}
|
||||
|
||||
_ = try? fileManager.removeItem(at: itemCopy)
|
||||
do {
|
||||
try fileManager.moveItem(at: tempDir, to: archiveDestDir)
|
||||
callback(nil)
|
||||
} catch {
|
||||
callback(error)
|
||||
}
|
||||
}, progressBlock: nil)
|
||||
} else {
|
||||
_ = try? fileManager.removeItem(at: itemCopy)
|
||||
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemCopy)"))
|
||||
}
|
||||
} catch {
|
||||
_ = try? fileManager.removeItem(at: tempDir)
|
||||
callback(error)
|
||||
callback(nil)
|
||||
}, progressBlock: nil)
|
||||
} else {
|
||||
callback(makeError(code: .unarchivingError, "Not a supported archive format: \(itemPath)"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ struct GenerateKeys: ParsableCommand {
|
||||
failure("Failed to write exported file: \(error)")
|
||||
}
|
||||
} else if let importedPrivateKeyFile = importedPrivateKeyFile {
|
||||
/// Import mode - import the specifed key-pair file
|
||||
/// Import mode - import the specified key-pair file
|
||||
let secretBase64File = importedPrivateKeyFile
|
||||
let secretBase64: String
|
||||
do {
|
||||
|
||||
Reference in new issue
Block a user