diff --git a/Sparkle/Autoupdate/AppInstaller.m b/Sparkle/Autoupdate/AppInstaller.m index 2f9e8cda..ec5526dc 100644 --- a/Sparkle/Autoupdate/AppInstaller.m +++ b/Sparkle/Autoupdate/AppInstaller.m @@ -275,12 +275,15 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; - (void)unarchiverExtractedProgress:(double)progress { - NSData *data = [NSData dataWithBytes:&progress length:sizeof(progress)]; - [self.remotePort sendMessageWithIdentifier:SUExtractedArchiveWithProgress data:data completion:^(BOOL success) { - if (!success) { - SULog(@"Error sending extracted progress"); - } - }]; + if (sizeof(progress) == sizeof(uint64_t)) { + uint64_t progressValue = CFSwapInt64HostToLittle(*(uint64_t *)&progress); + NSData *data = [NSData dataWithBytes:&progressValue length:sizeof(progressValue)]; + [self.remotePort sendMessageWithIdentifier:SUExtractedArchiveWithProgress data:data completion:^(BOOL success) { + if (!success) { + SULog(@"Error sending extracted progress"); + } + }]; + } } - (void)unarchiverDidFail diff --git a/Sparkle/SUInstallerDriver.m b/Sparkle/SUInstallerDriver.m index f283f4f7..cc22885d 100644 --- a/Sparkle/SUInstallerDriver.m +++ b/Sparkle/SUInstallerDriver.m @@ -298,8 +298,9 @@ if (identifier == SURequestInstallationParameters) { [self sendInstallationData]; } else if (identifier == SUExtractedArchiveWithProgress) { - if (data.length == sizeof(double)) { - double progress = *(const double *)data.bytes; + if (data.length == sizeof(double) && sizeof(double) == sizeof(uint64_t)) { + uint64_t progressValue = CFSwapInt64LittleToHost(*(const uint64_t *)data.bytes); + double progress = *(double *)&progressValue; [self.delegate installerDidExtractUpdateWithProgress:progress]; self.currentStage = identifier; }