Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22c0ab2329 | ||
|
|
7e2ecc8703 | ||
|
|
2410388796 | ||
|
|
ff13de9ddc | ||
|
|
7c7f1e4955 | ||
|
|
4935893311 | ||
|
|
b0e543de4e | ||
|
|
2a356d4a2a | ||
|
|
99b2514752 | ||
|
|
5b1f7fc88d | ||
|
|
f50dde6a50 | ||
|
|
efe2a7db68 | ||
|
|
bd365be8b2 | ||
|
|
374a62495b | ||
|
|
71228f248c | ||
|
|
731321f861 | ||
|
|
333098985b | ||
|
|
891be09d49 | ||
|
|
8f1e63c8d3 | ||
|
|
7021e4356f | ||
|
|
f9fd4d16c8 | ||
|
|
5c22d0e46e | ||
|
|
c4de5e38a8 | ||
|
|
1ad1373357 | ||
|
|
a5ea60b5a8 | ||
|
|
9b05410c95 | ||
|
|
6fd2fc832b | ||
|
|
7a1dc310d6 | ||
|
|
6d967e8641 | ||
|
|
36b35865fb |
No files matched your search
@@ -1,45 +0,0 @@
|
||||
AccessModifierOffset: -4
|
||||
AlignEscapedNewlinesLeft: true
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackParameters: true
|
||||
BreakBeforeBinaryOperators: true
|
||||
BreakBeforeBraces: Linux
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
ColumnLimit: 0
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
#DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
#ForEachMacros: foreach,Q_FOREACH
|
||||
IndentCaseLabels: true
|
||||
IndentFunctionDeclarationAfterType: true
|
||||
IndentWidth: 4
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
#PointerAlignment: Right
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
Standard: Cpp03
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
name: Enhancements and Bug Fixes
|
||||
about: Found a bug? Want to implement a new feature?
|
||||
title: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
[provide general summary to the issue or enhancement and its rationale]
|
||||
|
||||
## Possible Fix
|
||||
|
||||
[not obligatory, but suggest fixes or reasons for the bug]
|
||||
|
||||
## Version
|
||||
|
||||
[please specify versions of Sparkle this is applicable to; note new pull requests must be developed and landed in 2.x development branch first]
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Sparkle 1.x doesn't work in my app
|
||||
about: Problems with integration, unexpected errors
|
||||
title: ''
|
||||
labels: '1.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
The answer to your issue is probably already in Console.app on your computer.
|
||||
Please use Console.app and search for Sparkle.
|
||||
|
||||
Please try troubleshooting steps:
|
||||
https://github.com/sparkle-project/Sparkle#troubleshooting
|
||||
|
||||
-->
|
||||
|
||||
### Description of the problem
|
||||
|
||||
|
||||
### Do you use Sandboxing in your app?
|
||||
|
||||
### Version of `Sparkle.framework` in the latest version of your app
|
||||
|
||||
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
|
||||
|
||||
### Sparkle's output from Console.app
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Sparkle 2.x doesn't work in my app
|
||||
about: Problems with using the beta version of Sparkle 2
|
||||
title: ''
|
||||
labels: '2.x'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
The answer to your issue is probably already in Console.app on your computer.
|
||||
Please use Console.app and search for Sparkle.
|
||||
|
||||
Please try troubleshooting steps:
|
||||
https://github.com/sparkle-project/Sparkle#troubleshooting
|
||||
|
||||
-->
|
||||
|
||||
### Description of the problem
|
||||
|
||||
|
||||
### Do you use Sandboxing in your app?
|
||||
|
||||
### Version of `Sparkle.framework` in the latest version of your app
|
||||
|
||||
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
|
||||
|
||||
### Sparkle's output from Console.app
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### Steps to reproduce the behavior
|
||||
@@ -1,29 +0,0 @@
|
||||
(Insert summary of your pull request here)
|
||||
|
||||
Fixes # (issue)
|
||||
|
||||
## Checklist:
|
||||
|
||||
- [ ] My change is being tested and reviewed against the Sparkle 2.x branch. New changes must be developed on the 2.x development branch first.
|
||||
- [ ] My change is being backported to master branch (Sparkle 1.x), if deemed necessary. Please create a separate pull request for 1.x, should it be backported.
|
||||
- [ ] I have reviewed and commented my code, particularly in hard-to-understand areas.
|
||||
|
||||
## Type of change
|
||||
|
||||
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||
- [ ] New feature (non-breaking change which adds functionality)
|
||||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||
- [ ] My change is or requires a documentation or localization update
|
||||
|
||||
## Testing
|
||||
|
||||
I tested and verified my change by using one or multiple of these methods:
|
||||
|
||||
- [ ] Sparkle Test App
|
||||
- [ ] Unit Tests
|
||||
- [ ] My own app
|
||||
- [ ] Other (please specify)
|
||||
|
||||
(Describe all the cases that were tested)
|
||||
|
||||
macOS version tested: [place version here]
|
||||
@@ -1,67 +0,0 @@
|
||||
name: Build & Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 2.x, master ]
|
||||
pull_request:
|
||||
branches: [ 2.x, master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
xcode: ['xcode12.5.1', 'xcode13.1']
|
||||
include:
|
||||
- xcode: 'xcode12.5.1'
|
||||
xcode-path: '/Applications/Xcode_12.5.1.app/Contents/Developer'
|
||||
upload-dist: false
|
||||
- xcode: 'xcode13.1'
|
||||
xcode-path: '/Applications/Xcode_13.1.app/Contents/Developer'
|
||||
upload-dist: true
|
||||
|
||||
name: Build and Test Sparkle
|
||||
runs-on: macos-11
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
- name: Build Unit Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
|
||||
- name: Run Unit Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme Distribution -enableCodeCoverage YES -derivedDataPath build
|
||||
- name: Build UI Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build-for-testing -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
|
||||
- name: Run UI Tests
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild test-without-building -project Sparkle.xcodeproj -scheme UITests -configuration Debug -derivedDataPath build
|
||||
- name: Build Release Distribution
|
||||
env:
|
||||
DEVELOPER_DIR: ${{ matrix.xcode-path }}
|
||||
run: |
|
||||
xcodebuild build -project Sparkle.xcodeproj -scheme Distribution -configuration Release -derivedDataPath build
|
||||
- name: Archive Test Results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: build-logs
|
||||
path: build/Logs
|
||||
- name: Upload Distribution
|
||||
if: ${{ success() && matrix.upload-dist }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Sparkle-distribution-${{ matrix.xcode }}.tar.xz
|
||||
path: build/Build/Products/Release/sparkle-dist.tar.xz
|
||||
@@ -1,100 +0,0 @@
|
||||
name: "Create Draft Release"
|
||||
|
||||
env:
|
||||
BUILDDIR: "build"
|
||||
DEVELOPER_DIR: "/Applications/Xcode_13.1.app/Contents/Developer"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
marketingVersion:
|
||||
description: "Marketing Version"
|
||||
required: true
|
||||
default: ""
|
||||
|
||||
prereleaseSuffix:
|
||||
description: "Pre-release Suffix"
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
buildVersion:
|
||||
description: "Product Build"
|
||||
required: true
|
||||
default: ""
|
||||
|
||||
concurrency:
|
||||
group: publish-release-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: "Publish binaries for release"
|
||||
runs-on: macos-11
|
||||
|
||||
steps:
|
||||
- name: "Checkout sources"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Extract latest changes from CHANGELOG"
|
||||
run: |
|
||||
./Configurations/generate_latest_changes.py > latest-changes.txt
|
||||
|
||||
- name: "Overwrite project versions in project"
|
||||
run: |
|
||||
IFS='.' read major minor patch <<< "${{ github.event.inputs.marketingVersion }}"
|
||||
sed -E -i '' "s/SPARKLE_VERSION_MAJOR =.+/SPARKLE_VERSION_MAJOR = $major/g" ./Configurations/ConfigCommon.xcconfig
|
||||
sed -E -i '' "s/SPARKLE_VERSION_MINOR =.+/SPARKLE_VERSION_MINOR = $minor/g" ./Configurations/ConfigCommon.xcconfig
|
||||
sed -E -i '' "s/SPARKLE_VERSION_PATCH =.+/SPARKLE_VERSION_PATCH = $patch/g" ./Configurations/ConfigCommon.xcconfig
|
||||
|
||||
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
|
||||
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX = ${{ github.event.inputs.prereleaseSuffix }}/g" ./Configurations/ConfigCommon.xcconfig
|
||||
else
|
||||
sed -E -i '' "s/SPARKLE_VERSION_SUFFIX =.*/SPARKLE_VERSION_SUFFIX =/g" ./Configurations/ConfigCommon.xcconfig
|
||||
fi
|
||||
|
||||
sed -E -i '' "s/CURRENT_PROJECT_VERSION =.+/CURRENT_PROJECT_VERSION = ${{ github.event.inputs.buildVersion }}/g" ./Configurations/ConfigCommon.xcconfig
|
||||
git add ./Configurations/ConfigCommon.xcconfig
|
||||
|
||||
- name: "Determine if this is a pre-release version"
|
||||
run: |
|
||||
if [[ ! -z "${{ github.event.inputs.prereleaseSuffix }}" ]]; then
|
||||
echo "PRERELEASE_VERSION=true" >> $GITHUB_ENV
|
||||
else
|
||||
echo "PRERELEASE_VERSION=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: "Set up git and create tag"
|
||||
run: |
|
||||
git config user.name Sparkle-Bot
|
||||
git config user.email sparkle.project.bot@gmail.com
|
||||
git tag "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
|
||||
- name: "Build release distribution"
|
||||
run: make release
|
||||
env:
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
|
||||
- name: "Push the updated Swift package description"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
run: git push
|
||||
|
||||
- name: "Draft a release"
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
prerelease: ${{ env.PRERELEASE_VERSION }}
|
||||
name: "Sparkle ${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
tag_name: "${{ github.event.inputs.marketingVersion }}${{ github.event.inputs.prereleaseSuffix }}"
|
||||
fail_on_unmatched_files: true
|
||||
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}
|
||||
body_path: latest-changes.txt
|
||||
files: |
|
||||
build/Build/Products/Release/Sparkle-*.tar.xz
|
||||
build/Build/Products/Release/Sparkle-for-Swift-Package-Manager.zip
|
||||
@@ -1,47 +0,0 @@
|
||||
build/
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
xcuserdata
|
||||
*.xccheckout
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
*.xcuserstate
|
||||
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear on external disk
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
|
||||
# With Carthage, if Sparkle is included as a Git submodule (e.g. with the
|
||||
# --use-submodules option), the main module's .gitignore can't reach all the
|
||||
# way inside the submodule to ignore the added Carthage/Build symlink, and Git
|
||||
# keeps complaining about untracked changes in the submodule forever, which
|
||||
# is very annoying. To avoid that issue, ignore here in Sparkle instead.
|
||||
Carthage/Build
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Swift Package Manager
|
||||
/.build
|
||||
.swiftpm
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "Vendor/ed25519"]
|
||||
path = Vendor/ed25519
|
||||
url = https://github.com/orlp/ed25519
|
||||
@@ -1,20 +0,0 @@
|
||||
excluded:
|
||||
- Vendor
|
||||
disabled_rules:
|
||||
- opening_brace
|
||||
- empty_parentheses_with_trailing_closure
|
||||
- function_body_length
|
||||
- line_length
|
||||
- cyclomatic_complexity
|
||||
- large_tuple
|
||||
|
||||
# Rule-specific config
|
||||
trailing_comma:
|
||||
mandatory_comma: true
|
||||
force_try:
|
||||
severity: warning
|
||||
force_cast:
|
||||
severity: warning
|
||||
identifier_name:
|
||||
min_length:
|
||||
warning: 2
|
||||
@@ -1,711 +0,0 @@
|
||||
# 1.27.3
|
||||
|
||||
* Create and use temp extraction directory in generate_appcast again (#2556) (Zorg)
|
||||
|
||||
# 1.27.2
|
||||
|
||||
* Extract archives in a separate directory from the input archive (#2552) (Zorg)
|
||||
* Fix incorrect xz log warning in make release (#2044) (trss)
|
||||
|
||||
# 1.27.1
|
||||
|
||||
* Use px instead of pt when specifying font size to fix default font size in WebView from #1962 (regressed in 1.25.0 with WKWebView adoption) (Daniel Jalkut)
|
||||
* Fix to prevent Sparkle manipulating the host app's high level WebView defaults from #1961 (affecting only macOS versions before 10.11 in 1.x branch) (Daniel Jalkut)
|
||||
* Add safer handling of applying binary delta files from #1990 (Zorg)
|
||||
* Don't use current date unless necessary when scheduling next update from #1991 (Zorg)
|
||||
* Whitelist about:srcdoc as a safe web URL from #1938, #2007 (Louis Pontoise, Zorg)
|
||||
* Backport not hiding update window on deactivation from #2008 (Zorg)
|
||||
|
||||
# 1.27.0
|
||||
|
||||
* Deprecate not using EdDSA and skip DSA verification when possible in #1892 (Zorg)
|
||||
* Pass http headers and user agent when downloading release notes from #1873 (Zorg)
|
||||
* Fix project warnings from #1893 (Zorg)
|
||||
* Update sample appcast from #1895 (Zorg)
|
||||
* Fix appcast pubDate tag generation in different locales from #1898 (Sungbin Jo)
|
||||
* Create valid xar archives for generating binary delta files from #1906 (Zorg)
|
||||
* Fix a few issues with German localization from #1931 (J-rg)
|
||||
* Fix issues with Russian localizations from #1947 (Konstantin Zamyakin)
|
||||
* Fix issues with Czech localizations from #1943 (Vojtěch Koňařík)
|
||||
* Add an automated workflow that builds and publishes official Sparkle releases (Tony Arnold, Zorg)
|
||||
|
||||
# 1.26.0
|
||||
|
||||
* Flat package support from #1745 (Zorg)
|
||||
* Correct generate_appcast -s command line argument usage help (Lance Lovette)
|
||||
* Fix -f command line argument handling (Lance Lovette)
|
||||
* Fix progress for guided pkg install (Zorg)
|
||||
* Fix XQuartz update failing because NSLog caused issues (Zorg)
|
||||
* Update localization (Vojtěch Koňařík)
|
||||
* Various fixes to SPM logic (Jonas Zaugg)
|
||||
|
||||
# 1.25.0
|
||||
|
||||
* Raise minimum system version to 10.9 (Kornel)
|
||||
* Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter)
|
||||
* UI fixes
|
||||
* Show check for updates button only when automatic updates are enabled (Lorena Rangel)
|
||||
* Don't initialize the webview if we don't show release notes (Tobias Fonfara)
|
||||
* Keep skip button available if there is a minimum autoupdate version (Zorg)
|
||||
* Fix automatic updates checkbox state when not showing release notes (Zorg)
|
||||
* Fix edge cases with hiding alert buttons and using "Install Later" (Zorg)
|
||||
* Re-add setting WebUIDelegate fix for legacy web view (Zorg)
|
||||
* Adopt WKWebView for 1.x (Zorg)
|
||||
* Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg)
|
||||
* Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter)
|
||||
* Remove max size from update alert. (George Nachman)
|
||||
* Integrate generate_keys export/import options changes from #1730 (Zorg)
|
||||
* Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani)
|
||||
* Translations
|
||||
* Enable base internalization for alert xibs (Zorg)
|
||||
* Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore)
|
||||
* Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg)
|
||||
* Remove non-english localizations from TestApplication (Zorg)
|
||||
* Fix catch-22 Swift Package Manager binary target (Jonas Zaugg)
|
||||
* Add explicit dependencies to fix Xcode linking errors (Kornel)
|
||||
* Add phased rollouts feature to automatic update driver too (Zorg)
|
||||
* Remove hiding skip button and retitling later button (Zorg)
|
||||
* Deprecate installUpdatesIfAvailable (Zorg)
|
||||
* Apply custom headers to app download (Geraint White)
|
||||
|
||||
# 1.24.0
|
||||
|
||||
* Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi)
|
||||
* Improve best appcast item selection handling (Ian Bytchek)
|
||||
* Create lockfile for improved compatibility with 3rd party updaters (CoreCode)
|
||||
* Enable SPM support via binary target (Jonas Zaugg)
|
||||
* `generate_appcast` improvements:
|
||||
* follow symbolic links (Denis Dzyubenko)
|
||||
* update the release notes element’s URL when required (Brad Andalman)
|
||||
* Added output filename option to generate_appcast (Brad Andalman)
|
||||
* Added —release-notes-url-prefix to generate_appcast (Brad Andalman)
|
||||
* Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H)
|
||||
* Added help command line option (Dominik H)
|
||||
* Locale updates:
|
||||
* Update zh_CN localization (柳东原 · Dongyuan Liu)
|
||||
* Update Sparkle.strings (Vojtěch Koňařík)
|
||||
* Update Croatian (#1603) (milotype)
|
||||
* Update SUUpdateAlert.xib (DanielFirlej)
|
||||
* fix: read SUAutomaticallyUpdate from Info.plist (Trevor DeVore)
|
||||
* Fix casting Boolean to BOOL on Apple Silicon (Kevin Wojniak)
|
||||
* Use build matrix to test on multiple Xcode versions (Rajiv Shah)
|
||||
* Set UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. (Micah Moore)
|
||||
* Fixed error about "about:blank" release notes (Louis Pontoise)
|
||||
* Support App Store URL scheme in release note webview (Bi11)
|
||||
* Use the SHA-256 hash of the archive as the cache path (Nate Weaver)
|
||||
* Don't return an optional from the FileHandle method (Nate Weaver)
|
||||
* Added URL+Hashing (Nate Weaver)
|
||||
|
||||
# 1.23.0
|
||||
|
||||
* Support generating appcast with localizations (#1499) (Alik Vovkotrub)
|
||||
* Support versions with git commit SHA (#1504) (Alec Larson)
|
||||
* Hide "Skip..." and "Remind..." buttons when they're not relevant (#1480) (Kenneth Johnsen)
|
||||
* Preserve Finder tags while updating apps (#1512) (CoreCode)
|
||||
* Read-only update alert dialog formatting improvements (#1515) (Quinn Taylor)
|
||||
* Check if `SUBundleName` is set before normalizing (Jake Fenton)
|
||||
* `NSInteger` cast warning on Xcode 11 (Marga Keuvelaar)
|
||||
* Correct appcast file extension (Tom Vos)
|
||||
* Update Sparkle.strings (Emir Sarı)
|
||||
* Fix spelling (#1508) (Frank Chiarulli Jr)
|
||||
|
||||
# 1.22.0
|
||||
|
||||
* Enabled "Hardened Runtime" build option for Apple's notarization requirement
|
||||
* Add delegate methods to suppress update alerts (George Nachman)
|
||||
* Improved error when running from translocated location (Michael Buckley)
|
||||
* Add phased rollout feature (#1381) (Fabian Jäger)
|
||||
* Ignore non-standard permissions in delta updates instead of failing the build (Kornel Lesiński)
|
||||
* Notify user when installed version is newer than the latest in the appcast (CoreCode)
|
||||
* Reset timers after computer sleep (CoreCode)
|
||||
* Block-based alternatives to `NSInvocation`-based delegate methods (Fabian Jäger)
|
||||
* Add delegate `userDidSkipThisVersion` (BobZombie, Leo Natan, bono yusuke)
|
||||
* Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method (George Nachman)
|
||||
* Support providing private key as argument in `generate_appcast` (Yakuhzi, marchyang)
|
||||
* Separate the ed25519 sources into a new static library (Tony Arnold)
|
||||
* Disambiguate signing error messages (Nate Weaver)
|
||||
* Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually (fumoboy007)
|
||||
* Annotate SUHost for nullability (Michael Buckley)
|
||||
* Use SUAVAILABLE macro (Christiaan Hofman)
|
||||
* Fix warnings when using modules (nivekkagicom)
|
||||
* Correction of Czech localization inconsistency (#1403) (vojtakonarik)
|
||||
* BR locale fix (BR Lingo)
|
||||
* Update Japanese localization (fujisoft)
|
||||
* French Sparkle.strings (Jean-Baptiste)
|
||||
|
||||
# 1.21.3
|
||||
|
||||
* Losslessly reduced the size of PNG (Barijaona Ramaholimihaso)
|
||||
* Catch exceptions from subcommands (Julian Mayer)
|
||||
* `generate_appcast` can sign any bundles instead of just apps (Nate Weaver)
|
||||
* Check that effectiveAppearance is being observed before calling removeObserver (Pierluigi)
|
||||
|
||||
# 1.21.2
|
||||
|
||||
* Allow EdDSA for delta updates, too (Kornel)
|
||||
* Warning fixes (Brian Bergstrand)
|
||||
* Improvements to release notes view context menu and dark mode (Bi11)
|
||||
|
||||
# 1.21.0
|
||||
|
||||
* Added support EdDSA (ed25519) signatures (Kornel)
|
||||
* DSA signatures are considered outdated, and Apple's `Security.framework` only supports weaker SHA-1-based DSA.
|
||||
* Both old DSA and new EdDSA are still supported (and one app can use both), but new applications should use EdDSA only, and we recommend migrating away from DSA signatures.
|
||||
* `generate_keys` is now a Swift tool that stores EdDSA private keys in the Keychain
|
||||
* Existing apps can continue using their old DSA keys, but we've dropped support for generation of old DSA keys
|
||||
* `sign_update` is now a Swift tool that signs using EdDSA from private keys in the Keychain
|
||||
* The old DSA-based signing script has been moved to `bin/old_dsa_scripts`
|
||||
* The old DSA-based signing script has been fixed to work on pre-10.13 systems (Thomas Tempelmann)
|
||||
* `generate_appcast` has been updated to support EdDSA signatures
|
||||
* It can sign both DSA (if `dsa_priv.pem` file is specified) and EdDSA (from Keychain)
|
||||
* The tool now uses Caches directory and doesn't generate unnecessary delta files
|
||||
* Fixed verification of delta updates on filesystems that change permissions of symlinks
|
||||
* Fixed `NSURLSession` leak (Michael Ehrmann)
|
||||
|
||||
# 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)
|
||||
* Don't check for updates if Do Not Disturb is on (Kornel)
|
||||
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
|
||||
* Threading fixes:
|
||||
* Fix potential hang with `dispatch_sync` to main thread (Brian Bergstrand)
|
||||
* Fix closeCheckingWindow called from background thread (Alexey Martemyanov)
|
||||
* Improve 'read-only' error message (#1192) (Adrian Thomas)
|
||||
* New Spanish localisation (Ken Arroyo Ohori)
|
||||
* Updated Finnish language resources (Jason Pollack)
|
||||
* Hungarian localization (Csaba Horony)
|
||||
* Log more information about authentication requests (Kornel)
|
||||
* Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings. (Kent Sutherland)
|
||||
* Fix binary delta creation on network drives (sagecook)
|
||||
* Fix compilation issues on Xcode 10 with new build system (Leo Natan)
|
||||
|
||||
# 1.19.0
|
||||
|
||||
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
|
||||
* Changes to which methods run on the main thread.
|
||||
Note: some delegate methods may be called on non-main thread now. (Kornel)
|
||||
* Update Japanese localization (1024jp)
|
||||
* Update Sparkle.strings (Stefan Paychère)
|
||||
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
|
||||
* Handle SecTransformExecute errors (Kornel)
|
||||
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
|
||||
* 10.11 SDK compatibility (David Fuhrmann)
|
||||
|
||||
# 1.18.1
|
||||
|
||||
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
|
||||
* Implemented sparkle:os attribute as documented (Memphiz)
|
||||
* Additional termination detection in case kpoll fails. (fujisoft)
|
||||
* Included bin files in CocoaPods installation (Keith Smiley)
|
||||
* Updated Dutch localization (Eitot)
|
||||
* Updated German localization (Eitot)
|
||||
* Updated Japanese translation (1024jp)
|
||||
* Updated Portuguese translation (Victor)
|
||||
* Updated to Xcode 9/Swift 4
|
||||
|
||||
# 1.18.0
|
||||
|
||||
* Name of the host app is used in authorization prompt (the `SPARKLE_RELAUNCH_TOOL_NAME` setting is now obsolete)
|
||||
* More detailed progress bar for package installers (Kornel Lesiński)
|
||||
* Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman)
|
||||
* generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker)
|
||||
* Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker)
|
||||
* Fixed Japanese localization (1024jp)
|
||||
* Fixed escaping of system profile URLs
|
||||
* Added more logging in various failure cases (Kornel Lesiński)
|
||||
* Better error message for quarantined apps that can't be updated
|
||||
|
||||
# 1.17.0
|
||||
|
||||
* Added Touch Bar support (Bi11)
|
||||
* Upgraded SULog to use logging APIs that Apple provides built-in (Zorg)
|
||||
* Skip buttons are disabled if the update is marked as critical (Kornel Lesiński)
|
||||
* Background updates ask OS for lower-priority networking (Kornel Lesiński)
|
||||
* Refactorings to sync with upcoming 2.0
|
||||
* Added kqueue based termination listener (Zorg)
|
||||
* Added AppKit prevention guards to modules that shouldn't import it (Zorg)
|
||||
* Added Obj-C generics where applicable (Zorg)
|
||||
* Made SUBundleIcon & SUApplicationInfo take SUHost, not NSBundle (Zorg)
|
||||
* Improved -[SUHost objectForInfoDictionaryKey:] (Zorg)
|
||||
* Detect and fail if any two-way dependencies exist in the project (Zorg)
|
||||
* generate_appcast:
|
||||
* fixed handling of multiple directories in an archive
|
||||
* percent encode the filename used in the delta url (Brett Walker)
|
||||
* Update Sparkle.strings (BR Lingo)
|
||||
* Improved handling of non-ASCII names in delta archives (Kornel Lesiński)
|
||||
* Don't touch Info.plist unless git version changes (Václav Slavík)
|
||||
|
||||
# 1.16.0
|
||||
|
||||
* Guided package installs are now the default for updating packages (Zorg)
|
||||
- `pkg` installers won't show any UI. If you require the old behavior of showing a full installer window, rename the `*.pkg` file to `*.sparkle_interactive.pkg`
|
||||
* Previous version of the app is now deleted instead of staying in the trash (Zorg)
|
||||
* Added `generate_appcast` helper tool (Kornel Lesiński)
|
||||
* Made manual check resume pending automatic updates instead of starting a new update (Kornel Lesiński)
|
||||
* Started using `length` value from RSS if HTTP doesn't give one (Zorg)
|
||||
* Hidden automatic updates checkbox for information only updates (Bi11)
|
||||
* Added progressbar for DMG and binary delta extraction (Kornel Lesiński)
|
||||
* Fixed showing of download status if we attempt a 2nd download (Zorg)
|
||||
* Refactorings to sync with upcoming 2.0
|
||||
* Decoupled and simplified installation code using protocols (Zorg)
|
||||
* Added nullability annotations (Zorg)
|
||||
* Allowed delegate methods that return an object to return nil (Zorg)
|
||||
* Decreased responsibility of SUHost and moved code into other components (Zorg)
|
||||
* Removed Sparkle.pch and many file #includes (Zorg)
|
||||
|
||||
# 1.15.0
|
||||
|
||||
* A new icon! Thanks to 1024jp
|
||||
* Show alert when an update is sent over insecure HTTP with no DSA key (Zorg)
|
||||
- If you can't use HTTPS, you must at least sign updates with a DSA key.
|
||||
* Improved binary delta implementation (Zorg)
|
||||
* Added improved -validateMenuItem: as a method in SUUpdater.h for public use (Zorg)
|
||||
* Removed reachability preflight check (Zorg)
|
||||
* Clear update caches directory before downloading new update (Zorg)
|
||||
* Check the bundle's parent directory for writability too (Zorg)
|
||||
* Don't follow symbolic links for file operations (Zorg)
|
||||
* Don't bring up an authorized dialog during cleanup (Zorg)
|
||||
* Made Sparkle look for the highest compatible version regardless of timestamps (Zorg)
|
||||
* Fixed compatibility with 10.7
|
||||
* Fixed crash on 10.7 - subscript operator not available (kleuter)
|
||||
* Fixed warnings caused by -Wpartial-availability (Zorg)
|
||||
* Fixed german l10n. (Sebastian Volland)
|
||||
* Error code for download errors (Kornel Lesiński)
|
||||
* Update last update check date when the update driver finishes (Zorg)
|
||||
* Scale app icon up if needed in Software Update window (Nicholas Riley)
|
||||
* Don't register for termination notifications more than once (Zorg)
|
||||
* Don't terminate the app if we're already terminating (Zorg)
|
||||
* Removed SUEnableAutomaticChecksKeyOld and SUCheckAtStartup constants (Eitot)
|
||||
* Updated Sparkle framework headers to use modules if modules are available (B. Kevin Hardman)
|
||||
* Fixed warnings, fixed uses of SULocalizedString (Jerry Krinock)
|
||||
* Improved signing verifier to take any host and s/application/bundle/ (Zorg)
|
||||
* Improved Spotlight updates after delta extraction (Zorg)
|
||||
|
||||
# 1.14.0 (Mar 11, 2016)
|
||||
|
||||
* Disable javascript by default and make it opt-in (Zorg)
|
||||
* URL-encoding of appcast URLs is preserved (Kornel Lesiński)
|
||||
* Delegate is asked for fallback updates if delta update fails (Kornel Lesiński)
|
||||
* Fixed crash on 10.7 - subscript operator not available (kleuter)
|
||||
* Fixed check of feed URL before delegate had a chance to set it (Kornel Lesiński)
|
||||
* Re-added support for password-protected dmg images (Andrew K. Boyd)
|
||||
* Added warning about ATS blocking (Kornel Lesiński)
|
||||
* Translation fixes for pt-BR. (vitu)
|
||||
* Add some Japanese lozalized strings (1024jp)
|
||||
* Made test app available in all languages #695 (LIU Dongyuan / 柳东原)
|
||||
* Czech localizations update (Frantisek Erben)
|
||||
* Removed a test resource from the framework bundle (Karl Moskowski)
|
||||
* Test if the updated app is the frontmost one (Zorg)
|
||||
* UI Tests for the Test Application (Zorg)
|
||||
|
||||
# 1.13.1 (Jan 31, 2016)
|
||||
|
||||
Important security fixes:
|
||||
|
||||
* Prevent inclusion of local files via file:// XML entities
|
||||
* Disable redirects to non-HTTP URLs in release notes webview
|
||||
|
||||
# 1.13.0 (Dec 18, 2015)
|
||||
|
||||
* Changed framework's bundle ID from `org.andymatuschak.Sparkle` to `org.sparkle-project.Sparkle`.
|
||||
|
||||
# 1.12.0 (Dec 13, 2015)
|
||||
|
||||
* Rewritten file operations for updating an app (Zorg)
|
||||
- Ensuring atomic move operations, robust error handling.
|
||||
- Faster.
|
||||
- Using modern APIs where possible (no FSPathMakeRef, FSGetCatalogInfo, FSFindFolder, etc.)
|
||||
- Strong documentation, easier to read code.
|
||||
* Automatic updates won't be installed if the system is about to shut off (Zorg)
|
||||
* Deprecated serving over HTTP without DSA (Zorg)
|
||||
- Note that Apple has deprecated insecure HTTP in macOS 10.11
|
||||
* Improved Autoupdate application (Zorg)
|
||||
* Do all the installation work after the runloop is set up
|
||||
* TerminationListener only does termination listening now
|
||||
* Handle cases where host path is not installation path and host path is not desired executable path
|
||||
* Don't show Autoupdate dock icon if we shouldn't show UI
|
||||
* Update modification & access time for new update
|
||||
* Added installUpdatesIfAvailable (Ian Langworth)
|
||||
* Removed extensions from shell scripts (Jake Petroules)
|
||||
* Rewritten test app so it works again, and from a local web server (Zorg)
|
||||
* Replaced use of Python with built-in web server (Kevin Wojniak)
|
||||
* Set LD_RUNPATH_SEARCH_PATHS in Podspec (Jake Petroules)
|
||||
* Don't install automatic updates if the system might shut off (Zorg)
|
||||
* Don't show Autoupdate dock icon if we shouldn't show UI (Zorg)
|
||||
* Updated layout constraints when removing release notes (Zorg)
|
||||
* Improved BinaryDelta error handling & logging (Zorg)
|
||||
* Refactored quarantine removal (Zorg)
|
||||
* Fixed German localization (1024jp)
|
||||
* Updated zh_CN translation (LIU Dongyuan / 柳东原)
|
||||
* Updated Mac models list until July 2015 (Gabriel Ulici)
|
||||
* Updated Polish translation (Kornel Lesiński)
|
||||
* Updated Xcode project languages for which we have translations (Jake Petroules)
|
||||
* Updated XIB files (Kornel Lesiński)
|
||||
* Use NSByteCountFormatter if available (Jake Petroules)
|
||||
* Declared protocols on SUUpdateAlert for the 10.11 SDK (Daniel Jalkut)
|
||||
* Silenced warning about casting away const-ness and -Wassign-enum (Daniel Jalkut)
|
||||
* Added script to generate a report comparing the Sparkle.strings files (Kevin Wojniak)
|
||||
* Check for empty strings (as well as nil) in SUHost's -name method (Karl Moskowski)
|
||||
* Don't follow symlinks for checking file existence (Zorg)
|
||||
* Unit tests in Swift (Zorg, Jake Petroules)
|
||||
* Fixed framework imports (Felix Schulze)
|
||||
* Fixed issues with copying files from different mounted drives (Zorg)
|
||||
* Disallowed automatic updates when user can't write to the bundle (Zorg)
|
||||
* Set the task working directories instead of changing the process working directory (Kevin Wojniak)
|
||||
|
||||
# 1.11.1 (Nov 9, 2015)
|
||||
|
||||
* Don't install automatic updates when system is about to shut down
|
||||
|
||||
# 1.11.0 (Aug 24, 2015)
|
||||
|
||||
* Big improvements to code signing and DSA verification
|
||||
- Sparkle now checks not only whether an update is correctly signed, but also whether the updated version will be able to verify future updates. Updates now must either use DSA keys correctly, or not try to use them at all. Same goes for Apple Code Signing.
|
||||
- Rely on code signing and the DSA key in the new app instead of appcast. If the new app has a public DSA key, then the appcast item must have a DSA signature for the app, even if the app is code signed. (Zorg)
|
||||
* More verbose error message when DSA keys don't match (Kornel Lesiński)
|
||||
* Added delegate methods for pre-download and immediately post-failed-download (Isaac Greenspan)
|
||||
* Fix Lucida Grande is always used for release notes (LIU Dongyuan / 柳东原)
|
||||
* Only remove quarantine with setResourceValue: when it's present. Fixes "Unable to quarantine: 93" messages from showing up in the console. (Zorg)
|
||||
* Fixed const and nullability warnings (Jake Petroules, Kornel Lesiński)
|
||||
* Replaced deprecated NSRunAlertPanel/alertWithMessageText (Kevin Wojniak)
|
||||
* Imported the Foundation umbrella header in all the public headers (C.W. Betts)
|
||||
* pt-BR localization update (Victor Figueiredo)
|
||||
* Reject unsupported code-signing xattrs in binary delta (Zorg)
|
||||
* Fixed crash while applying delta update (antonc27)
|
||||
* Added logging of appcast/download URL on error (Kornel Lesiński)
|
||||
* More robust reading of Autoupdate.app path from Sparkle bundle
|
||||
|
||||
# 1.10.0 (Apr 26, 2015)
|
||||
|
||||
* Massive improvements to the BinaryDelta tool (Zorg)
|
||||
- Ability to track file permissions (Zorg)
|
||||
- Nicely formatted log output (Zorg)
|
||||
- Numerous bug fixes in handling of symlinks, empty directories, case-insensitive names, etc. (Zorg)
|
||||
- Refactored and modernized code (Zorg)
|
||||
- libxar is no longer weak-linked (C.W. Betts)
|
||||
* Double-check the code signature of the the app after installation (Isaac Wankerl)
|
||||
* Added headless guided package installation (Graham Miln)
|
||||
* Added ability to inject custom HTTP headers in appcast request (Mattias Gunneras)
|
||||
* Changes to make unarching more reliable (Zorg, Kornel Lesiński)
|
||||
* Have Sparkle build a framework module (C.W. Betts)
|
||||
* Stdout used for non error outputs (JDuquennoy)
|
||||
* French locale update (Kent Sutherland)
|
||||
|
||||
# 1.9.0 (Jan 26, 2015)
|
||||
|
||||
* Added SUUpdater delegate method for failures. (Benjamin Gordon)
|
||||
* Make the error definitions public (C.W. Betts)
|
||||
* Add support for lzma compressed tarballs (Kyle Fuller)
|
||||
* Back to SKIP_INSTALL=YES by default (Tony Arnold)
|
||||
* Properly set install names and rpaths for targets (Jake Petroules)
|
||||
* Use Library/Caches rather than app support directory (Kornel Lesiński)
|
||||
* Check for a modal window being onscreen before trying to put up the Sparkle prompt (Alf Watt)
|
||||
* Fixed crashes on 10.7 (Chris Campbell, Ger Teunis)
|
||||
* Fixed Sparkle tags parsing (Tamás Lustyik)
|
||||
* SULog code cleanups (Kevin Wojniak)
|
||||
* Make sure CFBundleVersion is a semantic version number. (Jake Petroules)
|
||||
* Replace typedef enums with typedef NS_ENUM to make Swift happier (C.W. Betts)
|
||||
* Fix warnings under Xcode 6.1 relating the SUUpdateAlert XIB (Tony Arnold)
|
||||
* Prefer string constants to strings (Jake Petroules)
|
||||
* Use Info.plist keys instead of macros (Jake Petroules)
|
||||
* Only export public symbols. (Jake Petroules)
|
||||
* BinaryDelta: avoid crash with bad paths (Jake Petroules)
|
||||
* Fixing Swedish translations (Erik Vikström)
|
||||
* Turkish localization fixes (Emir)
|
||||
* Proofing of Ukrainian localization (Vera Tkachenko)
|
||||
|
||||
# 1.8.0 (Jul 26, 2014)
|
||||
|
||||
* New SUDSAVerifier based on up-to-date macOS APIs (Zachary Waldowski)
|
||||
* Detailed error log for failed signature checks (Kornel Lesiński)
|
||||
* Converted Sparkle to ARC (C.W. Betts)
|
||||
* Converted ivars to properties. (Jake Petroules)
|
||||
* Cocoapod support (Xhacker Liu)
|
||||
* Quarantine removal on macOS 10.10 (C.W. Betts)
|
||||
* Updated Japanese localization (1024jp)
|
||||
* Added Greek localization
|
||||
|
||||
# 1.7.1 (Jul 2, 2014)
|
||||
|
||||
* Removed option to install unverified updates (Kornel Lesiński)
|
||||
* Added detailed log when code signing verification fails (Sam Deane)
|
||||
* Restored original Sparkle icon. (Jake Petroules)
|
||||
* Switched SUUpdateAlert.xib to AutoLayout (Kornel Lesiński)
|
||||
* Replace references to andymatuschak.org with sparkle-project.org. (Jake Petroules)
|
||||
* Several code cleanups, modernizations, fixed warnings and improved code formatting (Jake Petroules)
|
||||
* Make the repository significantly more organized. (Jake Petroules)
|
||||
* Xcode project: set organization name and class prefix. (Jake Petroules)
|
||||
* Link to Foundation and AppKit instead of Cocoa. (Jake Petroules)
|
||||
* Use new operatingSystemVersion API when available. (Jake Petroules)
|
||||
* Add .clang-format configuration file for source code formatting. (Jake Petroules)
|
||||
* Add a target to build Sparkle API documentation using Doxygen. (Jake Petroules)
|
||||
|
||||
# 1.7.0
|
||||
|
||||
* Dropped support for macOS 10.6. Sparkle now supports 10.7 and newer (including 10.10 Yosemite) on 64-bit Intel Macs (the last 32-bit Mac was released in 2006).
|
||||
* Removed use of deprecated functions (Zachary Waldowski)
|
||||
* Switched to modern Obj-C runtime and new literals syntax
|
||||
* Removed pre-10.7 code. (C.W. Betts)
|
||||
* Use more Blocks/libdispatch code. (C.W. Betts)
|
||||
* Cleaned up and improved security of `generate_keys`/`sign_update` scripts
|
||||
|
||||
# 1.6.1
|
||||
|
||||
* Removed archive password prompt (Kornel Lesiński)
|
||||
* (Re)fixes bug where URLs are naively double escaped (Andrew Madsen)
|
||||
* Fixed typo that caused crashes in BinaryDelta (Tamas Lustyik)
|
||||
* SUStandardVersionComparator.h is public (Vincent CARLIER)
|
||||
* Remove pre-10.6-specific code. (C.W. Betts)
|
||||
* Objective C 2 getters and setters. (C.W. Betts)
|
||||
* Define correct dependencies on locale scripts (Antonin Hildebrand)
|
||||
|
||||
# 1.6.0
|
||||
|
||||
* Cleaned up and deleted redundant strings files (Kornel Lesiński)
|
||||
* Modern Objective C syntax, properties where possible. (C.W. Betts)
|
||||
* Make SUAppcastDelegate a formal protocol. (C.W. Betts)
|
||||
* Fixed default font in release notes WebView (Kornel Lesiński)
|
||||
* Configurable name for finish_installation.app (Kornel Lesiński)
|
||||
* Removed code for 10.4 (Kornel Lesiński)
|
||||
* Convert all strings files to UTF-8 (UTF-16 must die) (Kornel Lesiński)
|
||||
* Removing GC target (Matt Thomas)
|
||||
* finish_installation.app and pkg files will not removed when we use *.pkg installer and restart system in the installer (Takayama Fumihiko)
|
||||
* Select Korean and Slovak for Sparkle.strings localization (Shon Frazier)
|
||||
* Updated the Romanian translation (Gabe)
|
||||
* pt-BR localization polishing (BR Lingo)
|
||||
* update zh_CN (61)
|
||||
* Shut up some warnings & make build with newer Xcode (Uli Kusterer)
|
||||
* Less unsafety with format strings (Uli Kusterer)
|
||||
* New icon (Rick Fillion)
|
||||
* fixed a 'content rectangle not entirely onscreen' warning (Simone Manganelli)
|
||||
* updated sends system profile to use info.plist if user defaults key isn't present (Jamie Pinkham)
|
||||
* Support for notifications on some updater events (Doug Russell)
|
||||
* Allow the delegate to trigger a silent install and relaunch (Matt Stevens)
|
||||
* Support silent relaunches (Matt Stevens)
|
||||
* Increment the sudden termination counter if installing on quit (Matt Stevens)
|
||||
* Prompts the user to update after a week (rather than a day) if he doesn't quit the app (Andy Matuschak)
|
||||
* Adding <sparkle:tags> appcast item element, <sparkle:criticalUpdate /> tag (Andy Matuschak)
|
||||
* We have this check box that says "Automatically download and install updates in the future." But we only download them automatically. We still ask permission again before installing them. (Andy Matuschak)
|
||||
|
||||
# 1.5.0-beta6
|
||||
|
||||
* Important Changes
|
||||
* Sparkle now requires DSA signatures on your updates. Check the documentation for more information on how to set that up if you don't already sign your updates. You can bypass this requirement if you deliver both your appcast and your updates over SSL.
|
||||
* Sparkle will no longer display release notes located at file:// URLs, since Javascript on such a page would be able to read files on your file system.
|
||||
* For security reasons, Sparkle will refuse to install updates which appear to "downgrade" the app.
|
||||
* SUUpdater now implements new keys: "automaticallyDownloadsUpdates", "lastUpdateCheckDate", and "sendsSystemProfile."
|
||||
* Fixed a bug that could prevent SUProbingUpdateDriver from working.
|
||||
* Fixed a bug that prevented the updaterWillRelaunchApplication: delegate method from getting called.
|
||||
* Fixed displaying release notes transmitted "loose" in the <description> key.
|
||||
* Fixed Sparkle compilation on 10.4 systems.
|
||||
* Fixed a bug that could cause window confusion if an app changed its LSUIElement at runtime.
|
||||
* Added support for Sparkle 1.1's behavior of disabling updates when the check interval is 0.
|
||||
* Sparkle can now handle appending parameters to URLs which already have parameters.
|
||||
* If an update's sparkle:shortVersionString is the same as the host's CFBundleShortVersionString, the sparkle:version and CFBundleVersion will be presented in parentheticals.
|
||||
|
||||
# 1.5.0-beta5
|
||||
|
||||
* Important Changes!
|
||||
* Made every Sparkle class private except for SUUpdater, SUAppcast, SUAppcastItem, and the SUVersionComparisonProtocol.
|
||||
* There is now a single SUUpdater singleton for every host bundle; instead of -[SUUpdater setHostBundle], you can use +[SUUpdater updaterForBundle].
|
||||
* Redefined the (entire) delegate protocol accordingly.
|
||||
* Renamed -[SUUpdater updatePreferencesChanged] to -[SUUpdater resetUpdateCycle]. This provides better semantics for non-apps, which need to start the update cycle manually.
|
||||
* -[SUUpdater checkForUpdatesWithDriver] is private. If you were using SUProbingUpdateDriver, you can now use -[SUUpdater checkForUpdateInformation] for a similar effect.
|
||||
* All the user defaults keys are now private; instead, SUUpdater is KVC-compliant for automaticallyChecksForUpdates, updateCheckInterval, and feedURL.
|
||||
* Reduced the size of the English-only framework by 25%.
|
||||
* System profiling information is now only submitted to the server once per week; this will help normalize your statistics across users with different interval preferences.
|
||||
* The feedParamatersForUpdater: delegate method now requires "displayKey" and "displayVersion" keys so that it can inform the user what's being sent.
|
||||
* Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
|
||||
* Added support for xml:lang to pick localized nodes in appcasts (for release notes, etc).
|
||||
* Fixed a bug which would cause the "checking for updates" window to not disappear in certain extraordinary error conditions.
|
||||
* Fixed a DSA signature checking bug for .tar.gz archives.
|
||||
* Sparkle now refuses to update on any read-only volume, not just dmgs.
|
||||
* Sparkle will clean up the host app's name and version before sending it as the user agent string; some non-ASCII characters were causing problems.
|
||||
* Added an Italian localization courtesy Michele Longhi.
|
||||
* Added a Swedish localization courtesy Daniel Bergman.
|
||||
* Fixes to the French localization courtesy Ronald Leroux and Yann Ricqueberg.
|
||||
* Fixes to the German localization courtesy Sven-S. Porst.
|
||||
* Fixes to the Russian localization courtesy Alexander Bykov and Anton Sotkov.
|
||||
* Fixed a number of issues related to archive format detection: I reverted back to extensions from UTIs.
|
||||
* Focus behavior fixes for LSUIElement apps.
|
||||
* The status window progress bar now animates even when indeterminate.
|
||||
* Major refactorings to improve functionality for non-app bundles.
|
||||
|
||||
# 1.5.0-beta4
|
||||
|
||||
* Fixed a critical bug which prevented non-.dmgs from unarchiving properly.
|
||||
* Added reporting of 64-bit capability to the profiling system.
|
||||
|
||||
# 1.5.0-beta3
|
||||
|
||||
* Added a new delegate method to SUUpdater.h to allow delegates to specify custom version comparators.
|
||||
* Added a German localization, courtesy the Camino localizer team: Dominik Tobschall, Tobias Stohr, and Friedemann Bochow.
|
||||
* Bug fixes:
|
||||
* Fixed a serious bug which could cause a server to be DDoS'd (or the host app to crash!) if an appcast fails to be parsed.
|
||||
* Fixed .tbz extraction if the archive was made with Stuffit.
|
||||
* Fixed support for .tar.bz2 and .tar.gz; Sparkle has to assume the archive is a tar when it sees "bz2" and "gz"; don't use those without tarring.
|
||||
* Fixed a typo which caused the shouldPromptForPermissionToCheckForUpdatesToHostBundle: method to not work in 1.5b2.
|
||||
* Fixed .zip extraction on Tiger (Apple changed the UTI between releases)
|
||||
* Fixed a crasher on Tiger.
|
||||
* Fixed display of the default app icon when the host app doesn't have an icon.
|
||||
* Sparkle now displays a sensible progress string and uses an indeterminate progress bar when the server doesn't report a file size.
|
||||
* Fixed some memory leaks.
|
||||
|
||||
# 1.5.0-beta2
|
||||
|
||||
* Compatibility Issues:
|
||||
* Most of the delegate method selectors have changed to scale better. See SUUpdater.h for changes; you'll likely have to make changes if you implement any delegate methods.
|
||||
* If you're using .tar.gz or .tar.bz2 archives, name them ".tbz" or ".tgz" instead; Sparkle now uses UTIs for archive detection, and it's not smart about double extensions.
|
||||
* I'm no longer supporting 10.3. This may or may not work on Panther—probably not.
|
||||
* Sparkle's no longer built for ppc64 by default. If you want to ship that, feel free to build your own, but this saves a few hundred k.
|
||||
* Enhancements:
|
||||
* Sparkle now detects if the preferences for automatic update checks or the time interval change mid-cycle.
|
||||
* If your product is a non-.app, you need to clue Sparkle in on the change by calling [[SUUpdater sharedUpdater] updatePreferencesChanged].
|
||||
* Added a cancel to the "checking for updates..." dialog.
|
||||
* Sparkle now cleans up all its litter in /tmp.
|
||||
* Made SUUpdater's delegate an IBOutlet so you can hook it up in IB.
|
||||
* Bug fixes:
|
||||
* Sparkle no longer crashes on non-GC hosts when the user cancels an update's downloads.
|
||||
* Sparkle no longer gets stuck in an inconsistent state or crashes when it can't parse the appcast on scheduled updates.
|
||||
* Added the sharedUpdater method to SUUpdater, as it should have been.
|
||||
* Fixed a bug where the "checking for updates..." window wouldn't go away if an error occurs while checking for updates.
|
||||
* Made the dual-mode build configuration actually use the .xcconfig which builds it with GC support. (oops!)
|
||||
* Fixed relaunching for prefpanes.
|
||||
* Sparkle no longer fails to install updates on Snow Leopard (though there's still an issue with trashing the old version of the app, but it seems to be a 10.6 bug)
|
||||
* Sparkle now handles redirects correctly under Tiger.
|
||||
* Fixed the installation path for non-.app bundles.
|
||||
* Fixed a bug which could crash Sparkle under non-English locales.
|
||||
* Fixed a weird race condition which could cause the relaunch tool to never notice that its target relaunched.
|
||||
* Fixed a bug where if the host app is inactive when an update occurs, the update alert sometimes doesn't become key.
|
||||
* Minor textual fixes.
|
||||
* Localizations:
|
||||
* Dutch: Maarten Van Coile
|
||||
* French: Yann Ricquebourg
|
||||
* Spanish: Ernesto Gomez Cereijo
|
||||
|
||||
# 1.5.0-beta1
|
||||
|
||||
* The most important things to know:
|
||||
* The 10.3 support is untested at best; sketchy at worst. Test with it thoroughly before you use it.
|
||||
* Sparkle now asks for permission to update on second launch; don't be surprised at that. You can change that behavior with a delegate method; read SUUpdater.h for more info.
|
||||
* We no longer distinguish between "check on startup" and "scheduled updates"; everything is scheduled, with the default being every day.
|
||||
* The test application is using the new profiling features, but that's only for demonstration: these are off by default. More on this later.
|
||||
* There are no localizations yet.
|
||||
* New features:
|
||||
* Sparkle now supports .pkgs. Just name the .pkg the name of the app and put in the update archive.
|
||||
* Sparkle now sends optional demographic profiling information; set SUEnableSystemProfiling to YES in your Info.plist and check out the GET data sent to your webserver when fetching the appcast. More on this in the documentation. The test application has this on so you can see the behavior.
|
||||
* Sparkle now supports updating non-.apps. Just call -setHostBundle: on the global SUUpdater to let it know what you're trying to update.
|
||||
* Sparkle now supports garbage collection in the host app. Use "Sparkle-with-GC.framework" for that, but be aware it's 10.5-only.
|
||||
* Sparkle is now 64-bit compatible, compiling both ppc64 and x86_64.
|
||||
* Sparkle now supports a sparkle:minimumSystemVersion key you can set on appcast items. It does what you think it does.
|
||||
* Sparkle now checks to see if the host app is running from a disk image and refuses to update if it is. (10.4+ only)
|
||||
* Added support for entities in enclosure paths.
|
||||
* The file size output is now formatted prettily.
|
||||
* Sparkle now gives visual indication that it's checking for updates when the update's user initiated. ie: it pops up a status controller saying "checking for updates..."
|
||||
* Added support for an SUPublicDSAKeyFile, so people don't have to copy/paste their entire key into their Info.plist. Set this key in your Info.plist to the filename of the key in your Resources directory.
|
||||
* Added an actually maintainable codebase.
|
||||
* Changes:
|
||||
* Sparkle version comparison is now dramatically less stupid and verified by a bunch of unit tests. If something doesn't work the way you think it should, add a test to SUVersionComparisonTest.m
|
||||
* Added a minimum to the check interval so that developers don't accidentally release their apps into the wild with 60-second test check intervals and have DOS-attack-like results. It's an hour now for release mode; feel free to change it.
|
||||
* The relaunching process now uses a separate helper app, which is a much more robust method.
|
||||
* Changed CFBundleShortVersionString behavior: Sparkle no longer uses Apple's about box style of displaying ShortVersionString (CFBundleVersion) when the latter is available.
|
||||
* No more MD5 checking. Use DSA: it's actually secure.
|
||||
* The abomination that was SUStatusChecker is dead. Use SUProbingUpdateDriver instead.
|
||||
* Bugfixes:
|
||||
* Fixed a huge bug with fully-automatic updating: before, if the user chose to relaunch later, the app would be running from the trash for a while. Now the buttons are "install and relaunch" or "install later."
|
||||
* Sparkle forces Spotlight to reindex the updated app so that it won't keep pointing to the one in the trash.
|
||||
* Sparkle trims whitespace from around DSA signatures; this could cause crashes before.
|
||||
* Fixed a bug where the user choosing to skip a version would inhibit future automatic updates until the next launch.
|
||||
* Fixed a bug that could occur when the app has a localized CFBundleName.
|
||||
* .dmgs now work on Leopard.
|
||||
* The status controller's button now sizes appropriately to the localization.
|
||||
* Sparkle now works correctly with LSUIElement apps: it focuses them before displaying the update alert.
|
||||
* Sparkle now deletes failed partial downloads.
|
||||
* The update alert no longer floats above everything in the app.
|
||||
* Fixed varied and sundry memory leaks.
|
||||
* A ton of other things that I've forgotten or were too small to mention!
|
||||
|
||||
# 1.1
|
||||
|
||||
* Optimized framework size: now only 1.4mb with all localizations and 384kb with only English (an English-only version is in the Extras folder).
|
||||
* Added a new SUStatusChecker class for programmatically determining if a new version is available (see the docs); thanks, Evan Schoenberg!
|
||||
* Added support for apps using SIGCHLD; thanks, Augie Fackler!
|
||||
* Added a zh_CN update from JT Lee
|
||||
* Added a Polish update from Piotr Chylinski
|
||||
* Fixed DMG support for images with /Applications symlinks.
|
||||
* Fixed a really stupid interval-checking bug that could cause repeated hits to the appcast.
|
||||
* Fixed a bug where the check interval would be inconsistent if a value of 0 was stored in the user defaults.
|
||||
|
||||
# 1.0
|
||||
|
||||
* Additions:
|
||||
* Added real version comparison courtesy Kevin Ballard: Sparkle now knows that 0.89 < 1.0a3 < 1.0.
|
||||
* Added many localizations courtesy David Kocher's localization team.
|
||||
* Added a much better installation mechanism courtesy Allan Odgaard.
|
||||
* Added a user agent string to the RSS fetch request.
|
||||
* Added support for CFBundleShortVersionString in addition to CFBundleVersion, and support for a sparkle:shortVersionString attribute on the enclosure.
|
||||
* Added support for CFBundleDisplayName if available.
|
||||
* Changes:
|
||||
* Automatic updating is now allowed by default, but only if DSA signing is on.
|
||||
* Pressing Escape or closing the update alert now reminds the user later.
|
||||
* Now when there's a stored check interval, Sparkle doesn't check immediately on startup the first time the app is launched because the user hasn't consented to it yet.
|
||||
* The update alert now remembers its size and floats.
|
||||
* Bug Fixes:
|
||||
* Fixed installation of DMGs with multiple files enclosed.
|
||||
* Fixed a nasty memory leak.
|
||||
* Fixed a bug wherein having no value for allowing automatic updates would display a checkbox for the updates but would not honor it.
|
||||
* Fixed a bug in zip extraction that occurred in Panther.
|
||||
* Fixed release notes caching.
|
||||
* Fixed a bug wherein Sparkle refused to authenticate the installation if the user had cancelled authentication previously in that session.
|
||||
* Fixed a weird bug that would cause a second help menu to appear on first launch.
|
||||
* Fixed a bug that could occur when changing the scheduled check interval.
|
||||
* Fixed a bug wherein the host app could crash if the user clicked Remind Me Later before the release notes finished loading.
|
||||
* Fixed a bug wherein the behavior was undefined if the user manually initiated a check when an automatic one was already taking place.
|
||||
* Fixed wrapping on the description field in the update alert.
|
||||
|
||||
# 1.0-beta3
|
||||
|
||||
* Fixed a nasty crasher that occurred often when the user was not connected to the internet.
|
||||
|
||||
# 1.0-beta2
|
||||
|
||||
* Major Improvements:
|
||||
* Fully automatic updating! (see the Documentation: this is beta and off by default)
|
||||
* Added support for DSA signatures (see the Documentation).
|
||||
* Added support for MD5 sum verification.
|
||||
* Added Security.framework-based authentication for installing to privileged directories.
|
||||
* Huge refactoring of the codebase: there's now a Sparkle Xcode project, Sparkle is now a framework, and everything is modular / abstracted. And no more code-generated interface.
|
||||
* Minor Improvements:
|
||||
* A SUUpdaterWillRestartNotification is sent out before restarting now.
|
||||
* Added key equivalents to alert panel buttons.
|
||||
* Error handling is much prettier now: technical messages are not presented to the user anymore.
|
||||
* There's now a test app for developers to see what Sparkle's like before using it.
|
||||
* Wrote new, pretty, extremely thorough documentation.
|
||||
* Bug Fixes:
|
||||
* Relaunch behavior is much improved and shouldn't fail in huge apps anymore.
|
||||
* Fixed a bug wherein a failing tar command could crash the host app.
|
||||
* Sparkle now looks at InfoPlist.strings in addition to Info.plist.
|
||||
* Fixed some stupid typos.
|
||||
|
||||
# 1.0-beta1
|
||||
|
||||
* Major New Features:
|
||||
* Sparkle now supports scheduled periodic updates—read the Readme for information on how to use it.
|
||||
* Sparkle now supports WebKit-based release notes (for CSS and full HTML), which it displays in the main update alert, not a separate panel. The Readme has much more information. Sparkle will, of course, fall back on NSTextView if the host app does not include WebKit.
|
||||
* Minor New Features:
|
||||
* Added support for .zip update archives.
|
||||
* Added support for .dmg update archives.
|
||||
* Implemented Remind Me Later to replace simple update cancellation.
|
||||
* Implemented Skip This Version functionality.
|
||||
* Added support for multiple feeds via the user defaults SUFeedURL key taking precedent over the one in Info.plist.
|
||||
* Added support for Sparkle's custom XML namespace, which is optional but may prove useful. See the Readme for more information.
|
||||
* Bug Fixes:
|
||||
* Sparkle will no longer enter an inconsistent state if the user tries to update again while one is already in progress.
|
||||
* Sparkle now uses CFBundleName to determine the application's name instead of the app's filename.
|
||||
* Sparkle no longer crashes if the user cancels during extraction.
|
||||
* Lots of code refactoring.
|
||||
|
||||
# 0.1
|
||||
|
||||
* Initial Release
|
||||
@@ -1,74 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at kornel+sparkle@geekhood.net. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -1 +1,8 @@
|
||||
// BinaryDelta tool only
|
||||
|
||||
PRODUCT_NAME = BinaryDelta
|
||||
GCC_PREFIX_HEADER =
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.5
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.5
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
|
||||
@@ -1,2 +1,5 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
#include "ConfigBinaryDelta.xcconfig"
|
||||
|
||||
OTHER_CFLAGS = -DDEBUG
|
||||
@@ -1 +1,3 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigBinaryDelta.xcconfig"
|
||||
@@ -1,99 +1,51 @@
|
||||
// Common
|
||||
|
||||
SPARKLE_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle
|
||||
SPARKLE_RELAUNCH_TOOL_NAME = Autoupdate
|
||||
SPARKLE_FILEOP_TOOL_NAME = fileop
|
||||
|
||||
SPARKLE_APPEND_VERSION_NUMBER = 1
|
||||
|
||||
// Sparkle usually doesn't allow downgrades as they're usually accidental, but
|
||||
// if your app has a downgrade function or URL handler, turn this on
|
||||
SPARKLE_AUTOMATED_DOWNGRADES = 0
|
||||
|
||||
// If your app file on disk is named "MyApp 1.1b4", Sparkle usually updates it
|
||||
// in place, giving you an app named 1.1b4 that is actually 1.2. Turn the
|
||||
// following on to always reset the name back to "MyApp":
|
||||
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME = 0
|
||||
|
||||
// If you change any of these version details, you must increase CURRENT_PROJECT_VERSION
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_MAJOR = 1
|
||||
SPARKLE_VERSION_MINOR = 27
|
||||
SPARKLE_VERSION_PATCH = 3
|
||||
|
||||
// This should be in SemVer format or empty, ie. "-rc.1"
|
||||
// These variables must have a space after the '=' too
|
||||
SPARKLE_VERSION_SUFFIX =
|
||||
// This is now a monotonically increasing ID number, even across prereleases, but let's keep this below 2.0
|
||||
CURRENT_PROJECT_VERSION = 1.108
|
||||
|
||||
MARKETING_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)$(SPARKLE_VERSION_SUFFIX)
|
||||
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = YES
|
||||
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
|
||||
ARCHS = $(ARCHS_STANDARD)
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9
|
||||
PRODUCT_NAME = ${TARGET_NAME}
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
|
||||
|
||||
GCC_PREPROCESSOR_DEFINITIONS_COMMON = SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=$(SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME) SPARKLE_AUTOMATED_DOWNGRADES=$(SPARKLE_AUTOMATED_DOWNGRADES) SPARKLE_APPEND_VERSION_NUMBER=$(SPARKLE_APPEND_VERSION_NUMBER) SPARKLE_BUNDLE_IDENTIFIER=\"$(SPARKLE_BUNDLE_IDENTIFIER)\" MARKETING_VERSION=\"$(MARKETING_VERSION)\" SPARKLE_RELAUNCH_TOOL_NAME=\"$(SPARKLE_RELAUNCH_TOOL_NAME)\" SPARKLE_FILEOP_TOOL_NAME=\"$(SPARKLE_FILEOP_TOOL_NAME)\"
|
||||
|
||||
CODE_SIGN_IDENTITY = -
|
||||
SDKROOT = macosx
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES
|
||||
PREBINDING = NO
|
||||
ZERO_LINK = NO
|
||||
CURRENT_PROJECT_VERSION = 1.5
|
||||
SDKROOT = macosx10.7
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
|
||||
MACOSX_DEPLOYMENT_TARGET[arch=x86_64] = 10.5
|
||||
GCC_C_LANGUAGE_STANDARD = c99
|
||||
GCC_ENABLE_OBJC_EXCEPTIONS = YES
|
||||
GCC_DEBUGGING_SYMBOLS = full
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
||||
GCC_PREFIX_HEADER = $(SDKROOT)/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h
|
||||
GCC_FAST_OBJC_DISPATCH = YES
|
||||
GCC_ENABLE_PASCAL_STRINGS = NO
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
COMBINE_HIDPI_IMAGES = NO;
|
||||
ARCHS = ppc i386 x86_64
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0
|
||||
CLANG_LINK_OBJC_RUNTIME = NO
|
||||
|
||||
// Enable warnings
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES
|
||||
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES
|
||||
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES
|
||||
CLANG_ENABLE_MODULES = YES
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
|
||||
CLANG_WARN_ASSIGN_ENUM = YES
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES
|
||||
CLANG_WARN_EMPTY_BODY = YES
|
||||
CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES
|
||||
CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES
|
||||
CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
|
||||
CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES
|
||||
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
|
||||
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES
|
||||
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
|
||||
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
|
||||
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES
|
||||
GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
|
||||
GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = YES
|
||||
GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
|
||||
GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = YES
|
||||
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES
|
||||
GCC_WARN_PEDANTIC = YES
|
||||
GCC_WARN_SHADOW = YES
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
|
||||
GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES
|
||||
GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES
|
||||
GCC_WARN_MISSING_PARENTHESES = YES
|
||||
GCC_WARN_ABOUT_MISSING_NEWLINE = YES
|
||||
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
|
||||
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES
|
||||
GCC_WARN_SIGN_COMPARE = YES
|
||||
GCC_WARN_STRICT_SELECTOR_MATCH = YES
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES
|
||||
GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES
|
||||
GCC_WARN_UNKNOWN_PRAGMAS = YES
|
||||
GCC_WARN_UNUSED_VARIABLE = YES
|
||||
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES
|
||||
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES
|
||||
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES
|
||||
GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES
|
||||
GCC_WARN_UNUSED_FUNCTION = YES
|
||||
GCC_WARN_UNUSED_LABEL = YES
|
||||
GCC_WARN_UNUSED_VALUE = YES
|
||||
GCC_WARN_UNUSED_PARAMETER = YES
|
||||
GCC_WARN_UNUSED_VARIABLE = YES
|
||||
|
||||
// These should be removed once the conversion to ARC is complete
|
||||
WARNING_CFLAGS_EXTRA = -Wno-custom-atomic-properties -Wno-implicit-atomic-properties
|
||||
|
||||
// Turn on all warnings, then disable a few which are almost impossible to avoid
|
||||
WARNING_CFLAGS = -Wall -Weverything -Wno-unused-macros -Wno-gnu-statement-expression -Wno-arc-repeated-use-of-weak -Wno-auto-import -Wno-gnu-zero-variadic-macro-arguments -Wno-format-non-iso $(WARNING_CFLAGS_EXTRA)
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES
|
||||
WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Winvalid-pch
|
||||
@@ -1,17 +1,10 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
|
||||
// Debug only
|
||||
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0
|
||||
DEBUG_INFORMATION_FORMAT = dwarf
|
||||
ENABLE_TESTABILITY = YES
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_COMMON) DEBUG=1
|
||||
ONLY_ACTIVE_ARCH = YES
|
||||
COPY_PHASE_STRIP = NO
|
||||
SPARKLE_EXTRA_DEBUG_10_5_ONLY = -fstack-protector -D_FORTIFY_SOURCE=2
|
||||
SPARKLE_EXTRA_DEBUG = -DDEBUG
|
||||
OTHER_CFLAGS = $(SPARKLE_EXTRA_DEBUG)
|
||||
|
||||
// Add $(SPARKLE_EXTRA_DEBUG_10_5_ONLY) to SPARKLE_EXTRA_DEBUG if your deployment is 10.5 or greater.
|
||||
@@ -1,18 +1,8 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
|
||||
// Release only
|
||||
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = s
|
||||
DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_COMMON)
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = NO
|
||||
DEAD_CODE_STRIPPING = YES
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = NO
|
||||
GCC_TREAT_WARNINGS_AS_ERRORS = YES
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES
|
||||
COPY_PHASE_STRIP = NO
|
||||
@@ -1,5 +0,0 @@
|
||||
// Fileop tool only
|
||||
|
||||
PRODUCT_NAME = $(SPARKLE_FILEOP_TOOL_NAME)
|
||||
SKIP_INSTALL = YES
|
||||
CLANG_ENABLE_MODULES = NO
|
||||
@@ -1,13 +1,10 @@
|
||||
// Framework only
|
||||
|
||||
DYLIB_INSTALL_NAME_BASE = @rpath
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.6
|
||||
DYLIB_CURRENT_VERSION = $(SPARKLE_VERSION_MAJOR).$(SPARKLE_VERSION_MINOR).$(SPARKLE_VERSION_PATCH)
|
||||
INSTALL_PATH = @loader_path/../Frameworks
|
||||
DYLIB_COMPATIBILITY_VERSION = 1.5
|
||||
DYLIB_CURRENT_VERSION = 1.5
|
||||
PRODUCT_NAME = Sparkle
|
||||
WRAPPER_EXTENSION = framework
|
||||
FRAMEWORK_VERSION = A
|
||||
INFOPLIST_FILE = Sparkle/Sparkle-Info.plist
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BUILDING_SPARKLE=1
|
||||
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
|
||||
SKIP_INSTALL = YES
|
||||
DEFINES_MODULE = YES
|
||||
PRODUCT_BUNDLE_IDENTIFIER = ${SPARKLE_BUNDLE_IDENTIFIER}
|
||||
INFOPLIST_FILE = Info.plist
|
||||
GCC_PREFIX_HEADER = Sparkle.pch
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
#include "ConfigFramework.xcconfig"
|
||||
|
||||
// Unit tests need access to non-public classes
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO
|
||||
OTHER_CFLAGS = -DDEBUG
|
||||
@@ -1,2 +1,9 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigFramework.xcconfig"
|
||||
|
||||
STRIP_INSTALLED_PRODUCT = YES
|
||||
DEPLOYMENT_POSTPROCESSING = YES
|
||||
STRIPFLAGS = -u -r
|
||||
STRIP_STYLE = non-global
|
||||
SEPARATE_STRIP = YES
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "ConfigFrameworkRelease.xcconfig"
|
||||
|
||||
//GCC_ENABLE_OBJC_GC = supported
|
||||
@@ -1,7 +0,0 @@
|
||||
// Generate Appcast only
|
||||
|
||||
#include "ConfigSwift.xcconfig"
|
||||
|
||||
SWIFT_OBJC_BRIDGING_HEADER = generate_appcast/Appcast-Bridging-Header.h
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11
|
||||
PRODUCT_NAME = generate_appcast
|
||||
@@ -1,4 +0,0 @@
|
||||
// Generate Appcast Debug
|
||||
|
||||
#include "ConfigGenerateAppcast.xcconfig"
|
||||
#include "ConfigSwiftDebug.xcconfig"
|
||||
@@ -1,4 +0,0 @@
|
||||
// Generate Appcast Release
|
||||
|
||||
#include "ConfigGenerateAppcast.xcconfig"
|
||||
#include "ConfigSwiftRelease.xcconfig"
|
||||
@@ -1,7 +0,0 @@
|
||||
// Generate Appcast only
|
||||
|
||||
#include "ConfigSwift.xcconfig"
|
||||
|
||||
SWIFT_OBJC_BRIDGING_HEADER = generate_keys/Bridging-Header.h
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11
|
||||
PRODUCT_NAME = generate_keys
|
||||
@@ -1,4 +0,0 @@
|
||||
// Generate Appcast Debug
|
||||
|
||||
#include "ConfigGenerateKeys.xcconfig"
|
||||
#include "ConfigSwiftDebug.xcconfig"
|
||||
@@ -1,4 +0,0 @@
|
||||
// Generate Appcast Release
|
||||
|
||||
#include "ConfigGenerateKeys.xcconfig"
|
||||
#include "ConfigSwiftRelease.xcconfig"
|
||||
@@ -1,8 +1,4 @@
|
||||
// Relaunch Tool only
|
||||
|
||||
INFOPLIST_FILE = Sparkle/Autoupdate/Autoupdate-Info.plist
|
||||
PRODUCT_NAME = $(SPARKLE_RELAUNCH_TOOL_NAME)
|
||||
PRODUCT_NAME = finish_installation
|
||||
SKIP_INSTALL = YES
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
|
||||
CLANG_ENABLE_MODULES = NO
|
||||
OTHER_LDFLAGS = -Wl,-U,_NSURLQuarantinePropertiesKey
|
||||
@@ -1 +1,5 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
#include "ConfigRelaunch.xcconfig"
|
||||
|
||||
OTHER_CFLAGS = -DDEBUG
|
||||
@@ -1 +1,3 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigRelaunch.xcconfig"
|
||||
@@ -1,2 +0,0 @@
|
||||
SWIFT_VERSION = 4.2
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
|
||||
@@ -1 +0,0 @@
|
||||
SWIFT_OPTIMIZATION_LEVEL = -Onone
|
||||
@@ -1 +0,0 @@
|
||||
SWIFT_OPTIMIZATION_LEVEL = -Owholemodule
|
||||
@@ -1,9 +1,5 @@
|
||||
// Test Application only
|
||||
|
||||
INFOPLIST_FILE = TestApplication/TestApplication-Info.plist
|
||||
INFOPLIST_FILE = Test Application/Test Application-Info.plist
|
||||
PRODUCT_NAME = Sparkle Test App
|
||||
WRAPPER_EXTENSION = app
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
|
||||
LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.sparkle-project.SparkleTestApp
|
||||
ENABLE_HARDENED_RUNTIME = NO
|
||||
CODE_SIGN_IDENTITY = -
|
||||
@@ -1,2 +1,5 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
#include "ConfigTestApp.xcconfig"
|
||||
|
||||
OTHER_CFLAGS = -DDEBUG
|
||||
@@ -1 +1,3 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigTestApp.xcconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "ConfigTestAppRelease.xcconfig"
|
||||
|
||||
GCC_ENABLE_OBJC_GC = required
|
||||
@@ -1,14 +0,0 @@
|
||||
// UI Test only
|
||||
|
||||
#include "ConfigSwift.xcconfig"
|
||||
|
||||
INFOPLIST_FILE = UITests/UITests-Info.plist
|
||||
WRAPPER_EXTENSION = xctest
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11
|
||||
ENABLE_HARDENED_RUNTIME = NO
|
||||
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)
|
||||
LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks
|
||||
|
||||
TEST_TARGET_NAME = Sparkle Test App
|
||||
USES_XCTRUNNER = YES
|
||||
@@ -1,2 +0,0 @@
|
||||
#include "ConfigUITest.xcconfig"
|
||||
#include "ConfigSwiftDebug.xcconfig"
|
||||
@@ -1,2 +0,0 @@
|
||||
#include "ConfigUITest.xcconfig"
|
||||
#include "ConfigSwiftRelease.xcconfig"
|
||||
@@ -1,14 +1,10 @@
|
||||
// Unit Test only
|
||||
|
||||
#include "ConfigSwift.xcconfig"
|
||||
|
||||
INFOPLIST_FILE = Tests/SparkleTests-Info.plist
|
||||
WRAPPER_EXTENSION = xctest
|
||||
OTHER_CFLAGS = $(inherited) -iframework"$(DEVELOPER_FRAMEWORKS_DIR)" -iframework"$(PLATFORM_DIR)/Developer/Library/Frameworks"
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO
|
||||
WARNING_CFLAGS = $(inherited) -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments
|
||||
FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)
|
||||
LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.9
|
||||
CLANG_ENABLE_MODULES = YES
|
||||
SWIFT_OBJC_BRIDGING_HEADER = Tests/Sparkle Unit Tests-Bridging-Header.h
|
||||
INFOPLIST_FILE = Tests/Sparkle Unit Tests-Info.plist
|
||||
OTHER_LDFLAGS = -framework Cocoa -framework SenTestingKit
|
||||
PRODUCT_NAME = Sparkle Unit Tests
|
||||
WRAPPER_EXTENSION = octest
|
||||
FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_LIBRARY_DIR)/Frameworks
|
||||
GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.6
|
||||
@@ -1,2 +1,3 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonDebug.xcconfig"
|
||||
#include "ConfigUnitTest.xcconfig"
|
||||
#include "ConfigSwiftDebug.xcconfig"
|
||||
@@ -1,2 +1,3 @@
|
||||
#include "ConfigCommon.xcconfig"
|
||||
#include "ConfigCommonRelease.xcconfig"
|
||||
#include "ConfigUnitTest.xcconfig"
|
||||
#include "ConfigSwiftRelease.xcconfig"
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "ConfigUnitTestRelease.xcconfig"
|
||||
|
||||
GCC_ENABLE_OBJC_GC = required
|
||||
@@ -1,3 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "bsdiff-Shared.xcconfig"
|
||||
@@ -1,3 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "bsdiff-Shared.xcconfig"
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
// Deployment
|
||||
SKIP_INSTALL = YES
|
||||
|
||||
// Packaging
|
||||
EXECUTABLE_PREFIX = lib
|
||||
PRODUCT_NAME = $(TARGET_NAME)
|
||||
|
||||
// Search Paths
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
|
||||
WARNING_CFLAGS = $(inherited) -Wno-comma
|
||||
@@ -1,3 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "ed25519-Shared.xcconfig"
|
||||
@@ -1,3 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
#include "ed25519-Shared.xcconfig"
|
||||
@@ -1,14 +0,0 @@
|
||||
// Copyright © 2019 Sparkle Project. All rights reserved.
|
||||
|
||||
// Deployment
|
||||
SKIP_INSTALL = YES
|
||||
|
||||
// Packaging
|
||||
EXECUTABLE_PREFIX = lib
|
||||
PRODUCT_NAME = $(TARGET_NAME)
|
||||
|
||||
// Search Paths
|
||||
ALWAYS_SEARCH_USER_PATHS = NO
|
||||
|
||||
// Disable Warnings - this is a third-party project, and we'll trust that the maintainers know what they're doing.
|
||||
WARNING_CFLAGS = $(inherited) -Wno-cast-qual -Wno-conversion -Wno-sign-conversion
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os, sys
|
||||
|
||||
# Ignore the first version line starting with # x.y.z..
|
||||
# and print everything until the second version line starting with # x.y.z..
|
||||
|
||||
hit_first_changelog_note = False
|
||||
with open("CHANGELOG", "r") as changelog_file:
|
||||
for line in changelog_file:
|
||||
if line.startswith("#"):
|
||||
if hit_first_changelog_note:
|
||||
# We are done with printing changes
|
||||
break
|
||||
else:
|
||||
# We haven't hit an important changelog line yet, so continue
|
||||
continue
|
||||
|
||||
if not hit_first_changelog_note and len(line.strip()) == 0:
|
||||
continue
|
||||
|
||||
hit_first_changelog_note = True
|
||||
sys.stdout.write(line)
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Tests the code signing validity of the extracted products within the provided path.
|
||||
# This guards against our archives being corrupt / created incorrectly.
|
||||
function verify_code_signatures() {
|
||||
verification_directory="$1"
|
||||
|
||||
if [[ -z "$verification_directory" ]]; then
|
||||
echo "Provided verification directory does not exist" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Search the current directory for all instances of the framework to verify them (XCFrameworks can have multiple copies of a framework for different platforms).
|
||||
find "${verification_directory}" -name "Sparkle.framework" -type d -exec codesign --verify -vvv --deep {} \;
|
||||
codesign --verify -vvv --deep "${verification_directory}/Sparkle Test App.app"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/BinaryDelta"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/generate_appcast"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/sign_update"
|
||||
codesign --verify -vvv --deep "${verification_directory}/bin/generate_keys"
|
||||
}
|
||||
|
||||
if [ "$ACTION" = "" ] ; then
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
rm -f "Sparkle-$MARKETING_VERSION.tar.xz"
|
||||
rm -f "Sparkle-$MARKETING_VERSION.tar.bz2"
|
||||
rm -f "Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
|
||||
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp "$CONFIGURATION_BUILD_DIR/sign_update" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.xcframework" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
# Only copy dSYMs for Release builds, but don't check for the presence of the actual files
|
||||
# because missing dSYMs in a release build SHOULD trigger a build failure
|
||||
if [ "$CONFIGURATION" = "Release" ] ; then
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/BinaryDelta.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_appcast.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/generate_keys.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/sign_update.dSYM" "$CONFIGURATION_BUILD_DIR/staging/bin"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle Test App.app.dSYM" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/Sparkle.framework.dSYM" "$CONFIGURATION_BUILD_DIR/staging"
|
||||
fi
|
||||
cp -R "$CONFIGURATION_BUILD_DIR/staging/bin" "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
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"
|
||||
|
||||
# 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
|
||||
|
||||
# Test code signing validity of the extracted products
|
||||
# This guards against our archives being corrupt / created incorrectly
|
||||
verify_code_signatures "/tmp/sparkle-extract"
|
||||
|
||||
rm -rf "/tmp/sparkle-extract"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging"
|
||||
|
||||
# Generate zip containing the xcframework for SPM
|
||||
rm -rf "/tmp/sparkle-spm-extract"
|
||||
mkdir -p "/tmp/sparkle-spm-extract"
|
||||
cd "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
# rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive"
|
||||
ditto -c -k --zlibCompressionLevel 9 --rsrc . "../Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
# Test code signing validity of the extracted Swift package
|
||||
# This guards against our archives being corrupt / created incorrectly
|
||||
ditto -x -k "../Sparkle-for-Swift-Package-Manager.zip" "/tmp/sparkle-spm-extract"
|
||||
verify_code_signatures "/tmp/sparkle-spm-extract"
|
||||
|
||||
rm -rf "/tmp/sparkle-spm-extract"
|
||||
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"
|
||||
|
||||
# Get latest git tag
|
||||
cd "$SRCROOT"
|
||||
latest_git_tag=$(git describe --tags --abbrev=0)
|
||||
|
||||
# Check semantic versioning
|
||||
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
|
||||
echo "Tag $latest_git_tag follows semantic versioning"
|
||||
else
|
||||
echo "ERROR: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate new Package manifest and podspec
|
||||
cd "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
|
||||
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
|
||||
if [ "$XCODE_VERSION_MAJOR" -ge "1200" ]; then
|
||||
# is equivalent to shasum -a 256 FILE
|
||||
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
|
||||
rm -rf ".build"
|
||||
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$MARKETING_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
|
||||
cp "Package.swift" "$SRCROOT"
|
||||
echo "Package.swift updated with the following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
echo "Tag: $latest_git_tag"
|
||||
echo "Checksum: $spm_checksum"
|
||||
|
||||
sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"
|
||||
cp "Sparkle.podspec" "$SRCROOT"
|
||||
echo "Sparkle.podspec updated with following values:"
|
||||
echo "Version: $MARKETING_VERSION"
|
||||
else
|
||||
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
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Convenience script to automatically commit Package.swift after updating the checksum and move the latest tag
|
||||
latest_git_tag=$(git describe --tags --abbrev=0) # gets the latest tag name
|
||||
commits_since_tag=$(git rev-list ${latest_git_tag}.. --count)
|
||||
|
||||
function move_tag() {
|
||||
long_message=$(git tag -n99 -l $latest_git_tag) # gets corresponding message
|
||||
long_message=${long_message/$latest_git_tag} # trims tag name
|
||||
long_message="$(echo -e "${long_message}" | sed -e 's/^[[:space:]]*//')" # trim leading whitespace
|
||||
git add Package.swift Sparkle.podspec
|
||||
git commit -m "Update Package.swift and Sparkle.podspec for version ${latest_git_tag}"
|
||||
git tag -fa $latest_git_tag -m "${long_message}"
|
||||
echo "Package.swift and Sparkle.podspec committed and tag '$latest_git_tag' moved."
|
||||
}
|
||||
|
||||
if [ "$commits_since_tag" -gt 0 ]; then
|
||||
# If there have been commits since the latest tag, it's highly likely that we did not intend to do a full release
|
||||
echo "WARNING: $commits_since_tag commit(s) since tag '$latest_git_tag'. Did you tag a new version?"
|
||||
echo "Package.swift has not been committed and tag has not been moved."
|
||||
elif [ "$CI" == true ]; then
|
||||
move_tag
|
||||
else
|
||||
# TODO: add sanity check to see if version is actually being updated or not?
|
||||
read -p "Do you want to commit changes to Package.swift and Sparkle.podspec, and force move tag '$latest_git_tag'? (required for official release) [Y/n]" -n 1 -r
|
||||
echo # (optional) move to a new line
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
move_tag
|
||||
else
|
||||
echo "Package.swift and Sparkle.podspec have not been committed and tag has not been moved."
|
||||
fi
|
||||
fi
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if ! which -s git ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "$SRCROOT" ] || \
|
||||
[ -z "$BUILT_PRODUCTS_DIR" ] || \
|
||||
[ -z "$INFOPLIST_PATH" ] || \
|
||||
[ -z "$MARKETING_VERSION" ]; then
|
||||
echo "$0: Must be run from Xcode!" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version="$MARKETING_VERSION"
|
||||
|
||||
# Get version in format 1.x.x-commits-hash
|
||||
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
|
||||
if [ -z "$gitversion" ] ; then
|
||||
echo "$0: Can't find a Git hash!" 1>&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# remove everything before the second last "-" to keep the hash part only
|
||||
versionsuffix=$( echo "${gitversion}" | sed -E 's/.+((-[^.]+){2})$/\1/' )
|
||||
if [ "$versionsuffix" != "$gitversion" ]; then
|
||||
version="$version$versionsuffix"
|
||||
fi
|
||||
|
||||
# and use it to set the CFBundleShortVersionString value
|
||||
export PATH="$PATH:/usr/libexec"
|
||||
|
||||
if [ -f "$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" ] ; then
|
||||
oldversion=$(PlistBuddy -c "Print :CFBundleShortVersionString" "$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH")
|
||||
fi
|
||||
if [ "$version" != "$oldversion" ] ; then
|
||||
PlistBuddy -c "Set :CFBundleShortVersionString '$version'" \
|
||||
"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"
|
||||
fi
|
||||
@@ -1 +0,0 @@
|
||||
html
|
||||
@@ -1,20 +0,0 @@
|
||||
PROJECT_NAME = Sparkle
|
||||
PROJECT_NUMBER = 1.14.0
|
||||
PROJECT_BRIEF = "A software update framework for macOS"
|
||||
PROJECT_LOGO = Resources/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png
|
||||
|
||||
RECURSIVE = YES
|
||||
INPUT = Sparkle
|
||||
OUTPUT_DIRECTORY = Documentation
|
||||
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_LATEX = NO
|
||||
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST = YES
|
||||
GENERATE_TODOLIST = YES
|
||||
|
||||
ALPHABETICAL_INDEX = YES
|
||||
|
||||
QT_AUTOBRIEF = YES
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$ACTION" = "" ] ; then
|
||||
if which -s doxygen ; then
|
||||
doxygen Documentation/Doxyfile
|
||||
else
|
||||
echo "warning: Doxygen not found in PATH"
|
||||
echo "open Terminal and type this command 'brew install doxygen' then click 'enter/return' key. finally build this target again"
|
||||
fi
|
||||
elif [ "$ACTION" = "clean" ] ; then
|
||||
rm -rf "$SRCROOT/Documentation/html"
|
||||
fi
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<string>com.binaryage.sparkle</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MARKETING_VERSION}</string>
|
||||
<string>1.5 Beta (git)</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<string>1.5</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
@@ -1,61 +0,0 @@
|
||||
Copyright (c) 2006-2013 Andy Matuschak.
|
||||
Copyright (c) 2009-2013 Elgato Systems GmbH.
|
||||
Copyright (c) 2011-2014 Kornel Lesiński.
|
||||
Copyright (c) 2015-2017 Mayur Pawashe.
|
||||
Copyright (c) 2014 C.W. Betts.
|
||||
Copyright (c) 2014 Petroules Corporation.
|
||||
Copyright (c) 2014 Big Nerd Ranch.
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
=================
|
||||
EXTERNAL LICENSES
|
||||
=================
|
||||
|
||||
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
|
||||
Copyright (c) 2003-2005 Colin Percival.
|
||||
|
||||
sais.c and sais.c, from sais-lite (2010/08/07) <https://sites.google.com/site/yuta256/sais>:
|
||||
Copyright (c) 2008-2010 Yuta Mori.
|
||||
|
||||
SUDSAVerifier.m:
|
||||
Copyright (c) 2011 Mark Hamlin.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted providing that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,38 @@
|
||||
Copyright (c) 2006 Andy Matuschak
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
=================
|
||||
EXTERNAL LICENSES
|
||||
=================
|
||||
|
||||
License for bspatch.c and bsdiff.c, from bsdiff 4.3 (<http://www.daemonology.net/bsdiff/>:
|
||||
/*-
|
||||
* Copyright 2003-2005 Colin Percival
|
||||
* All rights reserved
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted providing that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
@@ -1,47 +1,7 @@
|
||||
.PHONY: all localizable-strings release build test ci
|
||||
|
||||
all: build
|
||||
|
||||
ifndef BUILDDIR
|
||||
BUILDDIR := $(shell mktemp -d "$(TMPDIR)/Sparkle.XXXXXX")
|
||||
endif
|
||||
.PHONY: all localizable-strings
|
||||
|
||||
localizable-strings:
|
||||
rm -f Sparkle/en.lproj/Sparkle.strings
|
||||
genstrings -o Sparkle/en.lproj -s SULocalizedString Sparkle/*.m Sparkle/*.h
|
||||
iconv -f UTF-16 -t UTF-8 < Sparkle/en.lproj/Localizable.strings > Sparkle/en.lproj/Sparkle.strings
|
||||
rm Sparkle/en.lproj/Localizable.strings
|
||||
rm en.lproj/Sparkle.strings || TRUE
|
||||
genstrings -o en.lproj -s SULocalizedString *.m *.h
|
||||
mv en.lproj/Localizable.strings en.lproj/Sparkle.strings
|
||||
|
||||
release:
|
||||
xcodebuild -scheme Distribution -configuration Release -derivedDataPath "$(BUILDDIR)" build
|
||||
./Configurations/release-move-tag.sh
|
||||
open "$(BUILDDIR)/Build/Products/Release/"
|
||||
cat Sparkle.podspec
|
||||
@echo "Don't forget to update CocoaPods! pod trunk push"
|
||||
@echo "Don't forget to upload Sparkle-for-Swift-Package-Manager.zip!"
|
||||
|
||||
build:
|
||||
xcodebuild clean build
|
||||
|
||||
test:
|
||||
xcodebuild -scheme Distribution -configuration Debug test
|
||||
./objc_dep/objc_dep.py -t .
|
||||
|
||||
uitest:
|
||||
xcodebuild -scheme UITests -configuration Debug test
|
||||
|
||||
ci:
|
||||
for i in {7..9} ; do \
|
||||
if xcrun --sdk "macosx10.$$i" --show-sdk-path 2> /dev/null ; then \
|
||||
( rm -rf build && xcodebuild -sdk "macosx10.$$i" -scheme Distribution -configuration Coverage -derivedDataPath build ) || exit 1 ; \
|
||||
fi ; \
|
||||
done
|
||||
for i in {10..12} ; do \
|
||||
if xcrun --sdk "macosx10.$$i" --show-sdk-path 2> /dev/null ; then \
|
||||
( rm -rf build && xcodebuild -sdk "macosx10.$$i" -scheme Distribution -configuration Coverage -derivedDataPath build test ) || exit 1 ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
check-localizations:
|
||||
./Sparkle/CheckLocalizations.swift -root . -htmlPath "$(TMPDIR)/LocalizationsReport.htm"
|
||||
open "$(TMPDIR)/LocalizationsReport.htm"
|
||||
@@ -1,24 +0,0 @@
|
||||
# To update the icon run make -f Makefile-icon
|
||||
# Requires:
|
||||
# autoconf, automake, libtool, pkg-config, pngquant
|
||||
|
||||
ICONDIR=./Resources/Images.xcassets/AppIcon.appiconset
|
||||
OPTIMIZEDICONS=$(ICONDIR)/optimized_16x16.png $(ICONDIR)/optimized_32x32.png $(ICONDIR)/optimized_128x128.png $(ICONDIR)/optimized_512x512.png
|
||||
DESTICON=Resources/AppIcon.icns
|
||||
|
||||
all: $(DESTICON)
|
||||
|
||||
libicns:
|
||||
git clone https://github.com/pornel/libicns.git
|
||||
|
||||
libicns/Makefile: libicns
|
||||
( cd libicns && autoreconf -vif && ./configure )
|
||||
|
||||
libicns/icnsutils/png2icns: libicns/Makefile
|
||||
( cd libicns && make -j8 )
|
||||
|
||||
optimized_%.png: icon_%.png
|
||||
pngquant -s1 -f -o $@ $<
|
||||
|
||||
$(DESTICON): libicns/icnsutils/png2icns $(OPTIMIZEDICONS)
|
||||
./libicns/icnsutils/png2icns $@ $(OPTIMIZEDICONS)
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// NTSynchronousTask.h
|
||||
// CocoatechCore
|
||||
//
|
||||
// Created by Steve Gehrman on 9/29/05.
|
||||
// Copyright 2005 Steve Gehrman. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef NTSYNCHRONOUSTASK_H
|
||||
#define NTSYNCHRONOUSTASK_H
|
||||
|
||||
@interface NTSynchronousTask : NSObject
|
||||
{
|
||||
@private
|
||||
NSTask *mv_task;
|
||||
NSPipe *mv_outputPipe;
|
||||
NSPipe *mv_inputPipe;
|
||||
|
||||
NSData* mv_output;
|
||||
BOOL mv_done;
|
||||
int mv_result;
|
||||
}
|
||||
|
||||
// pass nil for directory if not needed
|
||||
// returns the result
|
||||
+(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData;
|
||||
|
||||
+(NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
|
||||
|
||||
- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
|
||||
- (int)result;
|
||||
- (NSData *)output;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,268 @@
|
||||
//
|
||||
// NTSynchronousTask.m
|
||||
// CocoatechCore
|
||||
//
|
||||
// Created by Steve Gehrman on 9/29/05.
|
||||
// Copyright 2005 Steve Gehrman. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdater.h"
|
||||
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "NTSynchronousTask.h"
|
||||
|
||||
@implementation NTSynchronousTask
|
||||
|
||||
//----------------------------------------------------------
|
||||
// task
|
||||
//----------------------------------------------------------
|
||||
- (NSTask *)task
|
||||
{
|
||||
return mv_task;
|
||||
}
|
||||
|
||||
- (void)setTask:(NSTask *)theTask
|
||||
{
|
||||
if (mv_task != theTask) {
|
||||
[mv_task release];
|
||||
mv_task = [theTask retain];
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// outputPipe
|
||||
//----------------------------------------------------------
|
||||
- (NSPipe *)outputPipe
|
||||
{
|
||||
return mv_outputPipe;
|
||||
}
|
||||
|
||||
- (void)setOutputPipe:(NSPipe *)theOutputPipe
|
||||
{
|
||||
if (mv_outputPipe != theOutputPipe) {
|
||||
[mv_outputPipe release];
|
||||
mv_outputPipe = [theOutputPipe retain];
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// inputPipe
|
||||
//----------------------------------------------------------
|
||||
- (NSPipe *)inputPipe
|
||||
{
|
||||
return mv_inputPipe;
|
||||
}
|
||||
|
||||
- (void)setInputPipe:(NSPipe *)theInputPipe
|
||||
{
|
||||
if (mv_inputPipe != theInputPipe) {
|
||||
[mv_inputPipe release];
|
||||
mv_inputPipe = [theInputPipe retain];
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// output
|
||||
//----------------------------------------------------------
|
||||
- (NSData *)output
|
||||
{
|
||||
return mv_output;
|
||||
}
|
||||
|
||||
- (void)setOutput:(NSData *)theOutput
|
||||
{
|
||||
if (mv_output != theOutput) {
|
||||
[mv_output release];
|
||||
mv_output = [theOutput retain];
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// done
|
||||
//----------------------------------------------------------
|
||||
- (BOOL)done
|
||||
{
|
||||
return mv_done;
|
||||
}
|
||||
|
||||
- (void)setDone:(BOOL)flag
|
||||
{
|
||||
mv_done = flag;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// result
|
||||
//----------------------------------------------------------
|
||||
- (int)result
|
||||
{
|
||||
return mv_result;
|
||||
}
|
||||
|
||||
- (void)setResult:(int)theResult
|
||||
{
|
||||
mv_result = theResult;
|
||||
}
|
||||
|
||||
- (void)taskOutputAvailable:(NSNotification*)note
|
||||
{
|
||||
[self setOutput:[[note userInfo] objectForKey:NSFileHandleNotificationDataItem]];
|
||||
|
||||
[self setDone:YES];
|
||||
}
|
||||
|
||||
- (void)taskDidTerminate:(NSNotification*)note
|
||||
{
|
||||
[self setResult:[[self task] terminationStatus]];
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
[self setTask:[[[NSTask alloc] init] autorelease]];
|
||||
[self setOutputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
[self setInputPipe:[[[NSPipe alloc] init] autorelease]];
|
||||
|
||||
[[self task] setStandardInput:[self inputPipe]];
|
||||
[[self task] setStandardOutput:[self outputPipe]];
|
||||
[[self task] setStandardError:[self outputPipe]];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
// dealloc
|
||||
//----------------------------------------------------------
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
[mv_task release];
|
||||
[mv_outputPipe release];
|
||||
[mv_inputPipe release];
|
||||
[mv_output release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
|
||||
{
|
||||
BOOL success = NO;
|
||||
|
||||
if (currentDirectory)
|
||||
[[self task] setCurrentDirectoryPath: currentDirectory];
|
||||
|
||||
[[self task] setLaunchPath:toolPath];
|
||||
[[self task] setArguments:args];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(taskOutputAvailable:)
|
||||
name:NSFileHandleReadToEndOfFileCompletionNotification
|
||||
object:[[self outputPipe] fileHandleForReading]];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(taskDidTerminate:)
|
||||
name:NSTaskDidTerminateNotification
|
||||
object:[self task]];
|
||||
|
||||
[[[self outputPipe] fileHandleForReading] readToEndOfFileInBackgroundAndNotifyForModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]];
|
||||
|
||||
@try
|
||||
{
|
||||
[[self task] launch];
|
||||
success = YES;
|
||||
}
|
||||
@catch (NSException *localException) { }
|
||||
|
||||
if (success)
|
||||
{
|
||||
if (input)
|
||||
{
|
||||
// feed the running task our input
|
||||
[[[self inputPipe] fileHandleForWriting] writeData:input];
|
||||
[[[self inputPipe] fileHandleForWriting] closeFile];
|
||||
}
|
||||
|
||||
// loop until we are done receiving the data
|
||||
if (![self done])
|
||||
{
|
||||
double resolution = 1;
|
||||
BOOL isRunning;
|
||||
NSDate* next;
|
||||
|
||||
do {
|
||||
next = [NSDate dateWithTimeIntervalSinceNow:resolution];
|
||||
|
||||
isRunning = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode
|
||||
beforeDate:next];
|
||||
} while (isRunning && ![self done]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
|
||||
{
|
||||
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSData* result=nil;
|
||||
|
||||
@try
|
||||
{
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
|
||||
if ([task result] == 0)
|
||||
result = [[task output] retain];
|
||||
|
||||
[task release];
|
||||
}
|
||||
@catch (NSException *localException) { }
|
||||
|
||||
[pool drain];
|
||||
|
||||
// retained above
|
||||
[result autorelease];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData
|
||||
{
|
||||
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
int taskResult = 0;
|
||||
if( outData )
|
||||
*outData = nil;
|
||||
|
||||
NS_DURING
|
||||
{
|
||||
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];
|
||||
|
||||
[task run:toolPath directory:currentDirectory withArgs:args input:input];
|
||||
|
||||
taskResult = [task result];
|
||||
if( outData )
|
||||
*outData = [[task output] retain];
|
||||
|
||||
[task release];
|
||||
}
|
||||
NS_HANDLER;
|
||||
taskResult = errCppGeneral;
|
||||
NS_ENDHANDLER;
|
||||
|
||||
[pool drain];
|
||||
|
||||
// retained above
|
||||
if( outData )
|
||||
[*outData autorelease];
|
||||
|
||||
return taskResult;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,27 +0,0 @@
|
||||
// swift-tools-version:5.3
|
||||
import PackageDescription
|
||||
|
||||
// Version is technically not required here, SPM doesn't check
|
||||
let version = "1.27.3"
|
||||
// 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 = "1.27.3"
|
||||
let checksum = "f0c6b4e6ffc6269a67b0d4ff254e3e8acfc6b3852db7b9957d4c0a5b39044446"
|
||||
let url = "https://github.com/sparkle-project/Sparkle/releases/download/\(tag)/Sparkle-for-Swift-Package-Manager.zip"
|
||||
|
||||
let package = Package(
|
||||
name: "Sparkle",
|
||||
platforms: [.macOS(.v10_11)],
|
||||
products: [
|
||||
.library(
|
||||
name: "Sparkle",
|
||||
targets: ["Sparkle"])
|
||||
],
|
||||
targets: [
|
||||
.binaryTarget(
|
||||
name: "Sparkle",
|
||||
url: url,
|
||||
checksum: checksum
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
@@ -1,68 +1,40 @@
|
||||
# Sparkle 1.x  [](https://github.com/Carthage/Carthage) []() <a href="https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=badge&utm_campaign=readme"><img src="https://img.shields.io/badge/sponsored%20by-StackPath-orange.svg" alt="sponsored by: StackPath"></a>
|
||||
# Sparkle
|
||||
is an easy-to-use software update framework for Cocoa developers.
|
||||
|
||||
Secure and reliable software update framework for Cocoa developers.
|
||||
* True self-updating--no work required from the user.
|
||||
|
||||
<img src="Resources/Screenshot.png" width="732" alt="Sparkle shows familiar update window with release notes">
|
||||
* Displays release notes to the user via WebKit.
|
||||
|
||||
This branch is the production ready, battle-tested version of Sparkle used by thousands of Mac apps.
|
||||
The upcoming Sparkle 2 (currently in beta) can be found in the [2.x branch](https://github.com/sparkle-project/Sparkle/tree/2.x).
|
||||
* Displays a detailed progress window to the user.
|
||||
|
||||
## Features
|
||||
* Supports authentication for installing in secure locations.
|
||||
|
||||
* Seamless. There's no mention of Sparkle; your icons and app name are used.
|
||||
* Secure. Updates are verified using EdDSA signatures and Apple Code Signing.
|
||||
* Fast. Supports delta updates which only patch files that have changed.
|
||||
* Easy to install. Sparkle requires no code in your app, and only needs static files on a web server.
|
||||
* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products.
|
||||
* Handles permissions, quarantine and automatically asks for authentication if needed.
|
||||
* Uses RSS-based appcasts for release information. Appcasts are a de-facto standard supported by 3rd party update-tracking programs and websites.
|
||||
* Stays hidden until second launch for better first impressions.
|
||||
* Truly self-updating — the user can choose to automatically download and install all updates in the background.
|
||||
* Ability to mark updates as critical.
|
||||
* Progress and status notifications for the host app.
|
||||
* Really, really easy to install.
|
||||
|
||||
## Requirements
|
||||
* Uses appcasts for release information.
|
||||
|
||||
* Runtime: macOS 10.9 or greater
|
||||
* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less; at least Xcode 12 if using Swift Package Manager.
|
||||
* HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/))
|
||||
* No sandboxing. Sparkle 1.x can't update sandboxed apps. However, [Sparkle 2.x](https://github.com/sparkle-project/Sparkle/tree/2.x) can.
|
||||
* The user can choose to automatically download and install all updates.
|
||||
|
||||
## Usage
|
||||
* Seamless integration—there's no mention of Sparkle; your icons and app name are used.
|
||||
|
||||
See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required.
|
||||
* Supports DSA signatures for ultra-secure updates.
|
||||
|
||||
## Development
|
||||
* Sparkle requires no code in your app, so it's trivial to upgrade or remove the module.
|
||||
|
||||
This repository uses git submodules, and will not build unless you clone recursively. Also, GitHub-provided ZIP/tar archives are broken due to GitHub not supporting git submodules properly.
|
||||
## New in Sparkle 1.5:
|
||||
|
||||
git clone --recursive https://github.com/sparkle-project/Sparkle
|
||||
* Optionally sends user demographic information to the server when checking for updates.
|
||||
|
||||
### Troubleshooting
|
||||
* Dual-mode garbage collection support for any memory management style.
|
||||
|
||||
* Please check **Console.app**. Sparkle prints detailed information there about all problems it encounters. It often also suggests solutions to the problems, so please read Sparkle's log messages carefully.
|
||||
* Sparkle doesn't bug the user until second launch for better first impressions.
|
||||
|
||||
* Use the `generate_appcast` tool which creates appcast files, correct signatures, and delta updates automatically.
|
||||
* Sparkle can install .pkg files for more complicated products.
|
||||
|
||||
* Make sure the URL specified in [`SUFeedURL`](https://sparkle-project.org/documentation/customization/) is valid (typos/404s are a common error!), and that it uses modern TLS ([test it](https://www.ssllabs.com/ssltest/)).
|
||||
* Supports bundles, preference panes, plugins, and other non-.app software.
|
||||
|
||||
* Delete your app's preferences (in `~/Library/Preferences/<your bundle id>`) if you've set another feed URL programmatically via Sparkle's Objective-C interface.
|
||||
* Supports branches due to minimum OS version requirements.
|
||||
|
||||
### API symbols
|
||||
* Deep delegate support to make Sparkle work exactly as you need.
|
||||
|
||||
Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default.
|
||||
If you are adding a symbol to the public API you must decorate the declaration with the `SU_EXPORT` macro (grep the source code for examples).
|
||||
|
||||
### Building the distribution package
|
||||
|
||||
`cd` to the root of the Sparkle source tree and run `make release`. Sparkle-*VERSION*.tar.bz2 will be created in a temporary directory and revealed in Finder after the build has completed.
|
||||
|
||||
Alternatively, build the Distribution scheme in the Xcode UI.
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
We pledge to have an open and welcoming environment. See our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
|
||||
## Project Sponsor
|
||||
|
||||
[StackPath](https://www.stackpath.com/?utm_source=sparkle-github&utm_medium=link&utm_campaign=readme-footer)
|
||||
* Tons of other stuff! [Read more about what's new.](http://andymatuschak.org/articles/2008/05/31/sparkle-15b1-now-available/ "Sparkle 1.5b1: now available!")
|
||||
@@ -3,22 +3,22 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<string>com.binaryage.totalfinder.sparkle.relaunch</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.5</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSUIElement</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,68 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_16x16.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_16x16@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_32x32.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_32x32@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_128x128.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_128x128@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_256x256.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_256x256@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_512x512.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "icon_512x512@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 662 B |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 176 KiB |
@@ -1,12 +0,0 @@
|
||||
@media (prefers-color-scheme: dark) {
|
||||
html {
|
||||
color: white;
|
||||
background: transparent;
|
||||
}
|
||||
:link {
|
||||
color: #419CFF;
|
||||
}
|
||||
:link:active {
|
||||
color: #FF1919;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<title>Your Great App's Changelog</title>
|
||||
<description>Most recent changes with links to updates.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>Version 2.0 (2 bugs fixed; 3 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:version>2.0</sparkle:version>
|
||||
<sparkle:releaseNotesLink>
|
||||
https://you.com/app/2.0.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 09 Jan 2006 19:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%202.0.zip" length="1623481" type="application/octet-stream" sparkle:edSignature="WVyVJpOx+a5+vNWJVY79TRjFKveNk+VhGJf2iti4CZtJsJewIUGvh/1AKKEAFbH1qUwx+vro1ECuzOsMmumoBA==" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Version 1.5 (8 bugs fixed; 2 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:version>1.5</sparkle:version>
|
||||
<sparkle:releaseNotesLink>
|
||||
https://you.com/app/1.5.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<pubDate>Wed, 01 Jan 2006 12:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.5.zip" length="1472893" type="application/octet-stream" sparkle:edSignature="pNFd7KbcQSu+Mq7UYrbQXTPq82luht2ACXm/r2utp1u/Uv/5hWqctdT2jwQgMejW7DRoeV/hVr6J4VdZYdwWDw==" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
|
||||
<!-- Now here's an example of a version with a weird internal version number (like an SVN revision) but a human-readable external one. -->
|
||||
<item>
|
||||
<title>Version 1.4 (5 bugs fixed; 2 new features)</title>
|
||||
<link>https://sparkle-project.org</link>
|
||||
<sparkle:releaseNotesLink>
|
||||
https://you.com/app/1.4.html
|
||||
</sparkle:releaseNotesLink>
|
||||
<sparkle:version>241</sparkle:version>
|
||||
<sparkle:shortVersionString>1.4</sparkle:shortVersionString>
|
||||
<pubDate>Wed, 25 Dec 2005 12:20:11 +0000</pubDate>
|
||||
<enclosure url="https://you.com/app/Your%20Great%20App%201.4.zip" sparkle:edSignature="Ody3D/ybSMH4T+P/oNj3LN4F0SA8RJGLEr1TI4UemrBAiJ9aEcDnYV3u58P75AbcFjI13jPYmHDUHXMSTFQbDw==" length="1472349" type="application/octet-stream" />
|
||||
<sparkle:minimumSystemVersion>10.9</sparkle:minimumSystemVersion>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
||||
|
Before Width: | Height: | Size: 100 KiB |
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// SUAppcast.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUAPPCAST_H
|
||||
#define SUAPPCAST_H
|
||||
|
||||
@class SUAppcastItem;
|
||||
@interface SUAppcast : NSObject<NSURLDownloadDelegate>
|
||||
{
|
||||
@private
|
||||
NSArray *items;
|
||||
NSString *userAgentString;
|
||||
id delegate;
|
||||
NSString *downloadFilename;
|
||||
NSURLDownload *download;
|
||||
}
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url;
|
||||
- (void)setDelegate:delegate;
|
||||
- (void)setUserAgentString:(NSString *)userAgentString;
|
||||
|
||||
- (NSArray *)items;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUAppcastDelegate)
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
|
||||
- (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,301 @@
|
||||
//
|
||||
// SUAppcast.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdater.h"
|
||||
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUAppcast.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SULog.h"
|
||||
|
||||
@interface NSXMLElement (SUAppcastExtensions)
|
||||
- (NSDictionary *)attributesAsDictionary;
|
||||
@end
|
||||
|
||||
@implementation NSXMLElement (SUAppcastExtensions)
|
||||
- (NSDictionary *)attributesAsDictionary
|
||||
{
|
||||
NSEnumerator *attributeEnum = [[self attributes] objectEnumerator];
|
||||
NSXMLNode *attribute;
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
|
||||
while ((attribute = [attributeEnum nextObject]))
|
||||
[dictionary setObject:[attribute stringValue] forKey:[attribute name]];
|
||||
return dictionary;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface SUAppcast () <NSURLDownloadDelegate>
|
||||
- (void)reportError:(NSError *)error;
|
||||
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes;
|
||||
@end
|
||||
|
||||
@implementation SUAppcast
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[items release];
|
||||
items = nil;
|
||||
[userAgentString release];
|
||||
userAgentString = nil;
|
||||
[downloadFilename release];
|
||||
downloadFilename = nil;
|
||||
[download release];
|
||||
download = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *)items
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
- (void)fetchAppcastFromURL:(NSURL *)url
|
||||
{
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30.0];
|
||||
if (userAgentString)
|
||||
[request setValue:userAgentString forHTTPHeaderField:@"User-Agent"];
|
||||
|
||||
download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)aDownload decideDestinationWithSuggestedFilename:(NSString *)filename
|
||||
{
|
||||
NSString* destinationFilename = NSTemporaryDirectory();
|
||||
if (destinationFilename)
|
||||
{
|
||||
destinationFilename = [destinationFilename stringByAppendingPathComponent:filename];
|
||||
[download setDestination:destinationFilename allowOverwrite:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)aDownload didCreateDestination:(NSString *)path
|
||||
{
|
||||
[downloadFilename release];
|
||||
downloadFilename = [path copy];
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish:(NSURLDownload *)aDownload
|
||||
{
|
||||
NSError *error = nil;
|
||||
|
||||
NSXMLDocument *document = nil;
|
||||
BOOL failed = NO;
|
||||
NSArray *xmlItems = nil;
|
||||
NSMutableArray *appcastItems = [NSMutableArray array];
|
||||
|
||||
if (downloadFilename)
|
||||
{
|
||||
NSUInteger options = 0;
|
||||
if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) {
|
||||
// In order to avoid including external entities when parsing the appcast (a potential security vulnerability; see https://github.com/andymatuschak/Sparkle/issues/169), we ask NSXMLDocument to "tidy" the XML first. This happens to remove these external entities; it wouldn't be a future-proof approach, but it worked in these historical versions of OS X, and we have a more rigorous approach for 10.7+.
|
||||
options = NSXMLDocumentTidyXML;
|
||||
} else {
|
||||
// In 10.7 and later, there's a real option for the behavior we desire.
|
||||
options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
|
||||
}
|
||||
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] removeFileAtPath:downloadFilename handler:nil];
|
||||
#else
|
||||
[[NSFileManager defaultManager] removeItemAtPath:downloadFilename error:nil];
|
||||
#endif
|
||||
[downloadFilename release];
|
||||
downloadFilename = nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
|
||||
if (nil == document)
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlItems = [document nodesForXPath:@"/rss/channel/item" error:&error];
|
||||
if (nil == xmlItems)
|
||||
{
|
||||
failed = YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (failed == NO)
|
||||
{
|
||||
|
||||
NSEnumerator *nodeEnum = [xmlItems objectEnumerator];
|
||||
NSXMLNode *node;
|
||||
NSMutableDictionary *nodesDict = [NSMutableDictionary dictionary];
|
||||
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
|
||||
|
||||
while (failed == NO && (node = [nodeEnum nextObject]))
|
||||
{
|
||||
// First, we'll "index" all the first-level children of this appcast item so we can pick them out by language later.
|
||||
if ([[node children] count])
|
||||
{
|
||||
node = [node childAtIndex:0];
|
||||
while (nil != node)
|
||||
{
|
||||
NSString *name = [node name];
|
||||
if (name)
|
||||
{
|
||||
NSMutableArray *nodes = [nodesDict objectForKey:name];
|
||||
if (nodes == nil)
|
||||
{
|
||||
nodes = [NSMutableArray array];
|
||||
[nodesDict setObject:nodes forKey:name];
|
||||
}
|
||||
[nodes addObject:node];
|
||||
}
|
||||
node = [node nextSibling];
|
||||
}
|
||||
}
|
||||
|
||||
NSEnumerator *nameEnum = [nodesDict keyEnumerator];
|
||||
NSString *name;
|
||||
while ((name = [nameEnum nextObject]))
|
||||
{
|
||||
node = [self bestNodeInNodes:[nodesDict objectForKey:name]];
|
||||
if ([name isEqualToString:@"enclosure"])
|
||||
{
|
||||
// enclosure is flattened as a separate dictionary for some reason
|
||||
NSDictionary *encDict = [(NSXMLElement *)node attributesAsDictionary];
|
||||
[dict setObject:encDict forKey:@"enclosure"];
|
||||
|
||||
}
|
||||
else if ([name isEqualToString:@"pubDate"])
|
||||
{
|
||||
// pubDate is expected to be an NSDate by SUAppcastItem, but the RSS class was returning an NSString
|
||||
NSDate *date = [NSDate dateWithNaturalLanguageString:[node stringValue]];
|
||||
if (date)
|
||||
[dict setObject:date forKey:name];
|
||||
}
|
||||
else if ([name isEqualToString:@"sparkle:deltas"])
|
||||
{
|
||||
NSMutableArray *deltas = [NSMutableArray array];
|
||||
NSEnumerator *childEnum = [[node children] objectEnumerator];
|
||||
NSXMLNode *child;
|
||||
while ((child = [childEnum nextObject])) {
|
||||
if ([[child name] isEqualToString:@"enclosure"])
|
||||
[deltas addObject:[(NSXMLElement *)child attributesAsDictionary]];
|
||||
}
|
||||
[dict setObject:deltas forKey:@"deltas"];
|
||||
}
|
||||
else if (name != nil)
|
||||
{
|
||||
// add all other values as strings
|
||||
[dict setObject:[[node stringValue] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:name];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *errString;
|
||||
SUAppcastItem *anItem = [[[SUAppcastItem alloc] initWithDictionary:dict failureReason:&errString] autorelease];
|
||||
if (anItem)
|
||||
{
|
||||
[appcastItems addObject:anItem];
|
||||
}
|
||||
else
|
||||
{
|
||||
SULog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
|
||||
}
|
||||
[nodesDict removeAllObjects];
|
||||
[dict removeAllObjects];
|
||||
}
|
||||
}
|
||||
|
||||
if ([appcastItems count])
|
||||
{
|
||||
NSSortDescriptor *sort = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO] autorelease];
|
||||
[appcastItems sortUsingDescriptors:[NSArray arrayWithObject:sort]];
|
||||
items = [appcastItems copy];
|
||||
}
|
||||
|
||||
if (failed)
|
||||
{
|
||||
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, nil]]];
|
||||
}
|
||||
else if ([delegate respondsToSelector:@selector(appcastDidFinishLoading:)])
|
||||
{
|
||||
[delegate appcastDidFinishLoading:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)aDownload didFailWithError:(NSError *)error
|
||||
{
|
||||
if (downloadFilename)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] removeFileAtPath:downloadFilename handler:nil];
|
||||
#else
|
||||
[[NSFileManager defaultManager] removeItemAtPath:downloadFilename error:nil];
|
||||
#endif
|
||||
}
|
||||
[downloadFilename release];
|
||||
downloadFilename = nil;
|
||||
|
||||
[self reportError:error];
|
||||
}
|
||||
|
||||
- (NSURLRequest *)download:(NSURLDownload *)aDownload willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
|
||||
{
|
||||
return request;
|
||||
}
|
||||
|
||||
- (void)reportError:(NSError *)error
|
||||
{
|
||||
if ([delegate respondsToSelector:@selector(appcast:failedToLoadWithError:)])
|
||||
{
|
||||
[delegate appcast:self failedToLoadWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred in retrieving update information. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes
|
||||
{
|
||||
// We use this method to pick out the localized version of a node when one's available.
|
||||
if ([nodes count] == 1)
|
||||
return [nodes objectAtIndex:0];
|
||||
else if ([nodes count] == 0)
|
||||
return nil;
|
||||
|
||||
NSEnumerator *nodeEnum = [nodes objectEnumerator];
|
||||
NSXMLElement *node;
|
||||
NSMutableArray *languages = [NSMutableArray array];
|
||||
NSString *lang;
|
||||
NSUInteger i;
|
||||
while ((node = [nodeEnum nextObject]))
|
||||
{
|
||||
lang = [[node attributeForName:@"xml:lang"] stringValue];
|
||||
[languages addObject:(lang ? lang : @"")];
|
||||
}
|
||||
lang = [[NSBundle preferredLocalizationsFromArray:languages] objectAtIndex:0];
|
||||
i = [languages indexOfObject:([languages containsObject:lang] ? lang : @"")];
|
||||
if (i == NSNotFound)
|
||||
i = 0;
|
||||
return [nodes objectAtIndex:i];
|
||||
}
|
||||
|
||||
- (void)setUserAgentString:(NSString *)uas
|
||||
{
|
||||
if (uas != userAgentString)
|
||||
{
|
||||
[userAgentString release];
|
||||
userAgentString = [uas copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDelegate:del
|
||||
{
|
||||
delegate = del;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// SUAppcastItem.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUAPPCASTITEM_H
|
||||
#define SUAPPCASTITEM_H
|
||||
|
||||
@interface SUAppcastItem : NSObject
|
||||
{
|
||||
@private
|
||||
NSString *title;
|
||||
NSDate *date;
|
||||
NSString *itemDescription;
|
||||
|
||||
NSURL *releaseNotesURL;
|
||||
|
||||
NSString *DSASignature;
|
||||
NSString *minimumSystemVersion;
|
||||
NSString *maximumSystemVersion;
|
||||
|
||||
NSURL *fileURL;
|
||||
NSString *versionString;
|
||||
NSString *displayVersionString;
|
||||
|
||||
NSDictionary *deltaUpdates;
|
||||
|
||||
NSDictionary *propertiesDictionary;
|
||||
|
||||
NSURL *infoURL; // UK 2007-08-31
|
||||
}
|
||||
|
||||
// Initializes with data from a dictionary provided by the RSS class.
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict;
|
||||
- (instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error;
|
||||
|
||||
- (NSString *)title;
|
||||
- (NSString *)versionString;
|
||||
- (NSString *)displayVersionString;
|
||||
- (NSDate *)date;
|
||||
- (NSString *)itemDescription;
|
||||
- (NSURL *)releaseNotesURL;
|
||||
- (NSURL *)fileURL;
|
||||
- (NSString *)DSASignature;
|
||||
- (NSString *)minimumSystemVersion;
|
||||
- (NSString *)maximumSystemVersion;
|
||||
- (NSDictionary *)deltaUpdates;
|
||||
- (BOOL)isDeltaUpdate;
|
||||
|
||||
// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
|
||||
- (NSDictionary *)propertiesDictionary;
|
||||
|
||||
- (NSURL *)infoURL; // UK 2007-08-31
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,284 @@
|
||||
//
|
||||
// SUAppcastItem.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/12/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUUpdater.h"
|
||||
|
||||
#import "SUAppcast.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SUVersionComparisonProtocol.h"
|
||||
#import "SUAppcastItem.h"
|
||||
#import "SULog.h"
|
||||
|
||||
@implementation SUAppcastItem
|
||||
|
||||
// Attack of accessors!
|
||||
|
||||
- (NSString *)title { return [[title retain] autorelease]; }
|
||||
|
||||
- (void)setTitle:(NSString *)aTitle
|
||||
{
|
||||
if (title == aTitle) return;
|
||||
[title release];
|
||||
title = [aTitle copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSDate *)date { return [[date retain] autorelease]; }
|
||||
|
||||
- (void)setDate:(NSDate *)aDate
|
||||
{
|
||||
if (date == aDate) return;
|
||||
[date release];
|
||||
date = [aDate copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)itemDescription { return [[itemDescription retain] autorelease]; }
|
||||
|
||||
- (void)setItemDescription:(NSString *)anItemDescription
|
||||
{
|
||||
if (itemDescription == anItemDescription) return;
|
||||
[itemDescription release];
|
||||
itemDescription = [anItemDescription copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSURL *)releaseNotesURL { return [[releaseNotesURL retain] autorelease]; }
|
||||
|
||||
- (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL
|
||||
{
|
||||
if (releaseNotesURL == aReleaseNotesURL) return;
|
||||
[releaseNotesURL release];
|
||||
releaseNotesURL = [aReleaseNotesURL copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)DSASignature { return [[DSASignature retain] autorelease]; }
|
||||
|
||||
- (void)setDSASignature:(NSString *)aDSASignature
|
||||
{
|
||||
if (DSASignature == aDSASignature) return;
|
||||
[DSASignature release];
|
||||
DSASignature = [aDSASignature copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSURL *)fileURL { return [[fileURL retain] autorelease]; }
|
||||
|
||||
- (void)setFileURL:(NSURL *)aFileURL
|
||||
{
|
||||
if (fileURL == aFileURL) return;
|
||||
[fileURL release];
|
||||
fileURL = [aFileURL copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)versionString { return [[versionString retain] autorelease]; }
|
||||
|
||||
- (void)setVersionString:(NSString *)s
|
||||
{
|
||||
if (versionString == s) return;
|
||||
[versionString release];
|
||||
versionString = [s copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)displayVersionString { return [[displayVersionString retain] autorelease]; }
|
||||
|
||||
- (void)setDisplayVersionString:(NSString *)s
|
||||
{
|
||||
if (displayVersionString == s) return;
|
||||
[displayVersionString release];
|
||||
displayVersionString = [s copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)minimumSystemVersion { return [[minimumSystemVersion retain] autorelease]; }
|
||||
- (void)setMinimumSystemVersion:(NSString *)systemVersionString
|
||||
{
|
||||
if (minimumSystemVersion == systemVersionString) return;
|
||||
[minimumSystemVersion release];
|
||||
minimumSystemVersion = [systemVersionString copy];
|
||||
}
|
||||
|
||||
- (NSString *)maximumSystemVersion { return [[maximumSystemVersion retain] autorelease]; }
|
||||
- (void)setMaximumSystemVersion:(NSString *)systemVersionString
|
||||
{
|
||||
if (maximumSystemVersion == systemVersionString) return;
|
||||
[maximumSystemVersion release];
|
||||
maximumSystemVersion = [systemVersionString copy];
|
||||
}
|
||||
|
||||
|
||||
- (NSURL *)infoURL { return [[infoURL retain] autorelease]; } // UK 2007-08-31 (whole method)
|
||||
|
||||
- (void)setInfoURL:(NSURL *)aFileURL // UK 2007-08-31 (whole method)
|
||||
{
|
||||
if( aFileURL == infoURL ) return;
|
||||
[infoURL release];
|
||||
infoURL = [aFileURL copy];
|
||||
}
|
||||
|
||||
- (NSDictionary *)deltaUpdates { return [[deltaUpdates retain] autorelease]; }
|
||||
|
||||
- (void)setDeltaUpdates:(NSDictionary *)updates
|
||||
{
|
||||
if (deltaUpdates == updates) return;
|
||||
[deltaUpdates release];
|
||||
deltaUpdates = [updates copy];
|
||||
}
|
||||
|
||||
- (BOOL)isDeltaUpdate
|
||||
{
|
||||
return [[propertiesDictionary objectForKey:@"enclosure"] objectForKey:@"sparkle:deltaFrom"] != nil;
|
||||
}
|
||||
|
||||
- initWithDictionary:(NSDictionary *)dict
|
||||
{
|
||||
return [self initWithDictionary:dict failureReason:nil];
|
||||
}
|
||||
|
||||
- initWithDictionary:(NSDictionary *)dict failureReason:(NSString**)error
|
||||
{
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
id enclosure = [dict objectForKey:@"enclosure"];
|
||||
|
||||
// Try to find a version string.
|
||||
// Finding the new version number from the RSS feed is a little bit hacky. There are two ways:
|
||||
// 1. A "sparkle:version" attribute on the enclosure tag, an extension from the RSS spec.
|
||||
// 2. If there isn't a version attribute, Sparkle will parse the path in the enclosure, expecting
|
||||
// that it will look like this: http://something.com/YourApp_0.5.zip. It'll read whatever's between the last
|
||||
// underscore and the last period as the version number. So name your packages like this: APPNAME_VERSION.extension.
|
||||
// The big caveat with this is that you can't have underscores in your version strings, as that'll confuse Sparkle.
|
||||
// Feel free to change the separator string to a hyphen or something more suited to your needs if you like.
|
||||
NSString *newVersion = [enclosure objectForKey:@"sparkle:version"];
|
||||
if( newVersion == nil )
|
||||
newVersion = [dict objectForKey:@"sparkle:version"]; // UK 2007-08-31 Get version from the item, in case it's a download-less item (i.e. paid upgrade).
|
||||
if (newVersion == nil) // no sparkle:version attribute anywhere?
|
||||
{
|
||||
// Separate the url by underscores and take the last component, as that'll be closest to the end,
|
||||
// then we remove the extension. Hopefully, this will be the version.
|
||||
NSArray *fileComponents = [[enclosure objectForKey:@"url"] componentsSeparatedByString:@"_"];
|
||||
if ([fileComponents count] > 1)
|
||||
newVersion = [[fileComponents lastObject] stringByDeletingPathExtension];
|
||||
}
|
||||
|
||||
if(!newVersion )
|
||||
{
|
||||
if (error)
|
||||
*error = @"Feed item lacks sparkle:version attribute, and version couldn't be deduced from file name (would have used last component of a file name like AppName_1.3.4.zip)";
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
propertiesDictionary = [[NSMutableDictionary alloc] initWithDictionary:dict];
|
||||
[self setTitle:[dict objectForKey:@"title"]];
|
||||
[self setDate:[dict objectForKey:@"pubDate"]];
|
||||
[self setItemDescription:[dict objectForKey:@"description"]];
|
||||
|
||||
NSString* theInfoURL = [dict objectForKey:@"link"];
|
||||
if( theInfoURL )
|
||||
{
|
||||
if( ![theInfoURL isKindOfClass: [NSString class]] )
|
||||
SULog(@"SUAppcastItem -initWithDictionary: Info URL is not of valid type.");
|
||||
else
|
||||
[self setInfoURL:[NSURL URLWithString:theInfoURL]];
|
||||
}
|
||||
|
||||
// Need an info URL or an enclosure URL. Former to show "More Info"
|
||||
// page, latter to download & install:
|
||||
if( !enclosure && !theInfoURL )
|
||||
{
|
||||
if (error)
|
||||
*error = @"No enclosure in feed item";
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString* enclosureURLString = [enclosure objectForKey:@"url"];
|
||||
if( !enclosureURLString && !theInfoURL )
|
||||
{
|
||||
if (error)
|
||||
*error = @"Feed item's enclosure lacks URL";
|
||||
[self release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
if( enclosureURLString )
|
||||
[self setFileURL: [NSURL URLWithString: [enclosureURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
|
||||
if( enclosure )
|
||||
[self setDSASignature:[enclosure objectForKey:@"sparkle:dsaSignature"]];
|
||||
|
||||
[self setVersionString: newVersion];
|
||||
[self setMinimumSystemVersion: [dict objectForKey:@"sparkle:minimumSystemVersion"]];
|
||||
[self setMaximumSystemVersion: [dict objectForKey:@"sparkle:maximumSystemVersion"]];
|
||||
|
||||
NSString *shortVersionString = [enclosure objectForKey:@"sparkle:shortVersionString"];
|
||||
if (nil == shortVersionString)
|
||||
shortVersionString = [dict objectForKey:@"sparkle:shortVersionString"]; // fall back on the <item>
|
||||
|
||||
if (shortVersionString)
|
||||
[self setDisplayVersionString: shortVersionString];
|
||||
else
|
||||
[self setDisplayVersionString: [self versionString]];
|
||||
|
||||
// Find the appropriate release notes URL.
|
||||
if ([dict objectForKey:@"sparkle:releaseNotesLink"])
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[dict objectForKey:@"sparkle:releaseNotesLink"]]];
|
||||
else if ([[self itemDescription] hasPrefix:@"http://"]) // if the description starts with http://, use that.
|
||||
[self setReleaseNotesURL:[NSURL URLWithString:[self itemDescription]]];
|
||||
else
|
||||
[self setReleaseNotesURL:nil];
|
||||
|
||||
if ([dict objectForKey:@"deltas"])
|
||||
{
|
||||
NSMutableDictionary *deltas = [NSMutableDictionary dictionary];
|
||||
NSArray *deltaDictionaries = [dict objectForKey:@"deltas"];
|
||||
NSEnumerator *deltaDictionariesEnum = [deltaDictionaries objectEnumerator];
|
||||
NSDictionary *deltaDictionary;
|
||||
while ((deltaDictionary = [deltaDictionariesEnum nextObject]))
|
||||
{
|
||||
NSMutableDictionary *fakeAppCastDict = [dict mutableCopy];
|
||||
[fakeAppCastDict removeObjectForKey:@"deltas"];
|
||||
[fakeAppCastDict setObject:deltaDictionary forKey:@"enclosure"];
|
||||
SUAppcastItem *deltaItem = [[[self class] alloc] initWithDictionary:fakeAppCastDict];
|
||||
[fakeAppCastDict release];
|
||||
|
||||
[deltas setObject:deltaItem forKey:[deltaDictionary objectForKey:@"sparkle:deltaFrom"]];
|
||||
[deltaItem release];
|
||||
}
|
||||
[self setDeltaUpdates:deltas];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self setTitle:nil];
|
||||
[self setDate:nil];
|
||||
[self setItemDescription:nil];
|
||||
[self setReleaseNotesURL:nil];
|
||||
[self setDSASignature:nil];
|
||||
[self setMinimumSystemVersion: nil];
|
||||
[self setFileURL:nil];
|
||||
[self setVersionString:nil];
|
||||
[self setDisplayVersionString:nil];
|
||||
[self setInfoURL:nil];
|
||||
[propertiesDictionary release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSDictionary *)propertiesDictionary
|
||||
{
|
||||
return propertiesDictionary;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// SUAutomaticUpdateAlert.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/18/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUAUTOMATICUPDATEALERT_H
|
||||
#define SUAUTOMATICUPDATEALERT_H
|
||||
|
||||
#import "SUWindowController.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SUInstallNowChoice,
|
||||
SUInstallLaterChoice,
|
||||
SUDoNotInstallChoice
|
||||
} SUAutomaticInstallationChoice;
|
||||
|
||||
@class SUAppcastItem, SUHost;
|
||||
@interface SUAutomaticUpdateAlert : SUWindowController {
|
||||
SUAppcastItem *updateItem;
|
||||
id delegate;
|
||||
SUHost *host;
|
||||
}
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)hostBundle delegate:delegate;
|
||||
- (IBAction)installNow:sender;
|
||||
- (IBAction)installLater:sender;
|
||||
- (IBAction)doNotInstall:sender;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSObject (SUAutomaticUpdateAlertDelegateProtocol)
|
||||
- (void)automaticUpdateAlert:(SUAutomaticUpdateAlert *)aua finishedWithChoice:(SUAutomaticInstallationChoice)choice;
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// SUAutomaticUpdateAlert.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 3/18/06.
|
||||
// Copyright 2006 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
|
||||
@implementation SUAutomaticUpdateAlert
|
||||
|
||||
- (id)initWithAppcastItem:(SUAppcastItem *)item host:(SUHost *)aHost delegate:del;
|
||||
{
|
||||
self = [super initWithHost:aHost windowNibName:@"SUAutomaticUpdateAlert"];
|
||||
if (self)
|
||||
{
|
||||
updateItem = [item retain];
|
||||
delegate = del;
|
||||
host = [aHost retain];
|
||||
[self setShouldCascadeWindows:NO];
|
||||
[[self window] center];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[host release];
|
||||
[updateItem release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSString *)description { return [NSString stringWithFormat:@"%@ <%@, %@>", [self class], [host bundlePath], [host installationPath]]; }
|
||||
|
||||
- (IBAction)installNow:sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallNowChoice];
|
||||
}
|
||||
|
||||
- (IBAction)installLater:sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUInstallLaterChoice];
|
||||
}
|
||||
|
||||
- (IBAction)doNotInstall:sender
|
||||
{
|
||||
[self close];
|
||||
[delegate automaticUpdateAlert:self finishedWithChoice:SUDoNotInstallChoice];
|
||||
}
|
||||
|
||||
- (NSImage *)applicationIcon
|
||||
{
|
||||
return [host icon];
|
||||
}
|
||||
|
||||
- (NSString *)titleText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"A new version of %@ is ready to install!", nil), [host name]];
|
||||
}
|
||||
|
||||
- (NSString *)descriptionText
|
||||
{
|
||||
return [NSString stringWithFormat:SULocalizedString(@"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?", nil), [host name], [updateItem displayVersionString]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,9 +9,16 @@
|
||||
#ifndef SUAUTOMATICUPDATEDRIVER_H
|
||||
#define SUAUTOMATICUPDATEDRIVER_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUBasicUpdateDriver.h"
|
||||
|
||||
@class SUAutomaticUpdateAlert;
|
||||
@interface SUAutomaticUpdateDriver : SUBasicUpdateDriver
|
||||
{
|
||||
@private
|
||||
BOOL postponingInstallation, showErrors;
|
||||
SUAutomaticUpdateAlert *alert;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// SUAutomaticUpdateDriver.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 5/6/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUAutomaticUpdateDriver.h"
|
||||
|
||||
#import "SUAutomaticUpdateAlert.h"
|
||||
#import "SUHost.h"
|
||||
#import "SUConstants.h"
|
||||
|
||||
@implementation SUAutomaticUpdateDriver
|
||||
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
|
||||
{
|
||||
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem host:host delegate:self];
|
||||
|
||||
// If the app is a menubar app or the like, we need to focus it first and alter the
|
||||
// update prompt to behave like a normal window. Otherwise if the window were hidden
|
||||
// there may be no way for the application to be activated to make it visible again.
|
||||
if ([host isBackgroundApplication])
|
||||
{
|
||||
[[alert window] setHidesOnDeactivate:NO];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
}
|
||||
|
||||
if ([NSApp isActive])
|
||||
[[alert window] makeKeyAndOrderFront:self];
|
||||
else
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:NSApp];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
|
||||
{
|
||||
[[alert window] makeKeyAndOrderFront:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSApplicationDidBecomeActiveNotification" object:NSApp];
|
||||
}
|
||||
|
||||
- (void)automaticUpdateAlert:(SUAutomaticUpdateAlert *)aua finishedWithChoice:(SUAutomaticInstallationChoice)choice;
|
||||
{
|
||||
switch (choice)
|
||||
{
|
||||
case SUInstallNowChoice:
|
||||
[self installWithToolAndRelaunch:YES];
|
||||
break;
|
||||
|
||||
case SUInstallLaterChoice:
|
||||
postponingInstallation = YES;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:NSApplicationWillTerminateNotification object:nil];
|
||||
break;
|
||||
|
||||
case SUDoNotInstallChoice:
|
||||
[host setObject:[updateItem versionString] forUserDefaultsKey:SUSkippedVersionKey];
|
||||
[self abortUpdate];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)shouldInstallSynchronously { return postponingInstallation; }
|
||||
|
||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch
|
||||
{
|
||||
showErrors = YES;
|
||||
[super installWithToolAndRelaunch:relaunch];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)note
|
||||
{
|
||||
[self installWithToolAndRelaunch:NO];
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if (showErrors)
|
||||
[super abortUpdateWithError:error];
|
||||
else
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// SUBasicUpdateDriver.h
|
||||
// Sparkle,
|
||||
//
|
||||
// Created by Andy Matuschak on 4/23/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUBASICUPDATEDRIVER_H
|
||||
#define SUBASICUPDATEDRIVER_H
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import "SUUpdateDriver.h"
|
||||
|
||||
@class SUAppcastItem, SUUnarchiver, SUAppcast, SUUnarchiver, SUHost;
|
||||
@interface SUBasicUpdateDriver : SUUpdateDriver<NSURLDownloadDelegate> {
|
||||
SUAppcastItem *updateItem;
|
||||
SUAppcastItem *nonDeltaUpdateItem;
|
||||
|
||||
NSURLDownload *download;
|
||||
NSString *downloadPath;
|
||||
NSString *tempDir;
|
||||
|
||||
NSString *relaunchPath;
|
||||
}
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)host;
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac;
|
||||
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error;
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui;
|
||||
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui;
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui;
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui;
|
||||
- (void)didFindValidUpdate;
|
||||
- (void)didNotFindUpdate;
|
||||
|
||||
- (void)downloadUpdate;
|
||||
- (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSString *)name;
|
||||
- (void)downloadDidFinish:(NSURLDownload *)d;
|
||||
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
|
||||
|
||||
- (void)extractUpdate;
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua;
|
||||
- (void)unarchiverDidFail:(SUUnarchiver *)ua;
|
||||
- (void)failedToApplyDeltaUpdate;
|
||||
|
||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch;
|
||||
- (void)installerForHost:(SUHost *)host failedWithError:(NSError *)error;
|
||||
|
||||
- (void)cleanUpDownload;
|
||||
|
||||
- (void)abortUpdate;
|
||||
- (void)abortUpdateWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,414 @@
|
||||
//
|
||||
// SUBasicUpdateDriver.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Andy Matuschak on 4/23/08.
|
||||
// Copyright 2008 Andy Matuschak. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUBasicUpdateDriver.h"
|
||||
|
||||
#import "SUHost.h"
|
||||
#import "SUDSAVerifier.h"
|
||||
#import "SUInstaller.h"
|
||||
#import "SUStandardVersionComparator.h"
|
||||
#import "SUUnarchiver.h"
|
||||
#import "SUConstants.h"
|
||||
#import "SULog.h"
|
||||
#import "SUPlainInstaller.h"
|
||||
#import "SUPlainInstallerInternals.h"
|
||||
#import "SUBinaryDeltaCommon.h"
|
||||
#import "SUCodeSigningVerifier.h"
|
||||
#import "SUUpdater_Private.h"
|
||||
|
||||
@interface SUBasicUpdateDriver () <NSURLDownloadDelegate>; @end
|
||||
|
||||
|
||||
@implementation SUBasicUpdateDriver
|
||||
|
||||
- (void)checkForUpdatesAtURL:(NSURL *)URL host:(SUHost *)aHost
|
||||
{
|
||||
[super checkForUpdatesAtURL:URL host:aHost];
|
||||
if ([aHost isRunningOnReadOnlyVolume])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"%1$@ can't be updated when it's running from a read-only volume like a disk image or an optical drive. Move %1$@ to your Applications folder, relaunch it from there, and try again.", nil), [aHost name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
return;
|
||||
}
|
||||
|
||||
SUAppcast *appcast = [[SUAppcast alloc] init];
|
||||
CFRetain(appcast); // We'll manage the appcast's memory ourselves so we don't have to make it an IV to support GC.
|
||||
[appcast release];
|
||||
|
||||
[appcast setDelegate:self];
|
||||
[appcast setUserAgentString:[updater userAgentString]];
|
||||
[appcast fetchAppcastFromURL:URL];
|
||||
}
|
||||
|
||||
- (id <SUVersionComparison>)versionComparator
|
||||
{
|
||||
id <SUVersionComparison> comparator = nil;
|
||||
|
||||
// Give the delegate a chance to provide a custom version comparator
|
||||
if ([[updater delegate] respondsToSelector:@selector(versionComparatorForUpdater:)])
|
||||
comparator = [[updater delegate] versionComparatorForUpdater:updater];
|
||||
|
||||
// If we don't get a comparator from the delegate, use the default comparator
|
||||
if (!comparator)
|
||||
comparator = [SUStandardVersionComparator defaultComparator];
|
||||
|
||||
return comparator;
|
||||
}
|
||||
|
||||
- (BOOL)isItemNewer:(SUAppcastItem *)ui
|
||||
{
|
||||
return [[self versionComparator] compareVersion:[host version] toVersion:[ui versionString]] == NSOrderedAscending;
|
||||
}
|
||||
|
||||
- (BOOL)hostSupportsItem:(SUAppcastItem *)ui
|
||||
{
|
||||
if (([ui minimumSystemVersion] == nil || [[ui minimumSystemVersion] isEqualToString:@""]) &&
|
||||
([ui maximumSystemVersion] == nil || [[ui maximumSystemVersion] isEqualToString:@""])) { return YES; }
|
||||
|
||||
BOOL minimumVersionOK = TRUE;
|
||||
BOOL maximumVersionOK = TRUE;
|
||||
|
||||
// Check minimum and maximum System Version
|
||||
if ([ui minimumSystemVersion] != nil && ![[ui minimumSystemVersion] isEqualToString:@""]) {
|
||||
minimumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui minimumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedDescending;
|
||||
}
|
||||
if ([ui maximumSystemVersion] != nil && ![[ui maximumSystemVersion] isEqualToString:@""]) {
|
||||
maximumVersionOK = [[SUStandardVersionComparator defaultComparator] compareVersion:[ui maximumSystemVersion] toVersion:[SUHost systemVersionString]] != NSOrderedAscending;
|
||||
}
|
||||
|
||||
return minimumVersionOK && maximumVersionOK;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsSkippedVersion:(SUAppcastItem *)ui
|
||||
{
|
||||
NSString *skippedVersion = [host objectForUserDefaultsKey:SUSkippedVersionKey];
|
||||
if (skippedVersion == nil) { return NO; }
|
||||
return [[self versionComparator] compareVersion:[ui versionString] toVersion:skippedVersion] != NSOrderedDescending;
|
||||
}
|
||||
|
||||
- (BOOL)itemContainsValidUpdate:(SUAppcastItem *)ui
|
||||
{
|
||||
return [self hostSupportsItem:ui] && [self isItemNewer:ui] && ![self itemContainsSkippedVersion:ui];
|
||||
}
|
||||
|
||||
- (void)appcastDidFinishLoading:(SUAppcast *)ac
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFinishLoadingAppcast:)])
|
||||
[[updater delegate] updater:updater didFinishLoadingAppcast:ac];
|
||||
|
||||
SUAppcastItem *item = nil;
|
||||
|
||||
// Now we have to find the best valid update in the appcast.
|
||||
if ([[updater delegate] respondsToSelector:@selector(bestValidUpdateInAppcast:forUpdater:)]) // Does the delegate want to handle it?
|
||||
{
|
||||
item = [[updater delegate] bestValidUpdateInAppcast:ac forUpdater:updater];
|
||||
}
|
||||
else // If not, we'll take care of it ourselves.
|
||||
{
|
||||
// Find the first update we can actually use.
|
||||
NSEnumerator *updateEnumerator = [[ac items] objectEnumerator];
|
||||
do {
|
||||
item = [updateEnumerator nextObject];
|
||||
} while (item && ![self hostSupportsItem:item]);
|
||||
|
||||
if (binaryDeltaSupported()) {
|
||||
SUAppcastItem *deltaUpdateItem = [[item deltaUpdates] objectForKey:[host version]];
|
||||
if (deltaUpdateItem && [self hostSupportsItem:deltaUpdateItem]) {
|
||||
nonDeltaUpdateItem = [item retain];
|
||||
item = deltaUpdateItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateItem = [item retain];
|
||||
if (ac) { CFRelease(ac); } // Remember that we're explicitly managing the memory of the appcast.
|
||||
if (updateItem == nil) { [self didNotFindUpdate]; return; }
|
||||
|
||||
if ([self itemContainsValidUpdate:updateItem])
|
||||
[self didFindValidUpdate];
|
||||
else
|
||||
[self didNotFindUpdate];
|
||||
}
|
||||
|
||||
- (void)appcast:(SUAppcast *)ac failedToLoadWithError:(NSError *)error
|
||||
{
|
||||
if (ac) { CFRelease(ac); } // Remember that we're explicitly managing the memory of the appcast.
|
||||
[self abortUpdateWithError:error];
|
||||
}
|
||||
|
||||
- (void)didFindValidUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:didFindValidUpdate:)])
|
||||
[[updater delegate] updater:updater didFindValidUpdate:updateItem];
|
||||
[self downloadUpdate];
|
||||
}
|
||||
|
||||
- (void)didNotFindUpdate
|
||||
{
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterDidNotFindUpdate:)])
|
||||
[[updater delegate] updaterDidNotFindUpdate:updater];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUNoUpdateError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:SULocalizedString(@"You already have the newest version of %@.", nil), [host name]] forKey:NSLocalizedDescriptionKey]]];
|
||||
}
|
||||
|
||||
- (void)downloadUpdate
|
||||
{
|
||||
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[updateItem fileURL]];
|
||||
[request setValue:[updater userAgentString] forHTTPHeaderField:@"User-Agent"];
|
||||
download = [[NSURLDownload alloc] initWithRequest:request delegate:self];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)d decideDestinationWithSuggestedFilename:(NSString *)name
|
||||
{
|
||||
// If name ends in .txt, the server probably has a stupid MIME configuration. We'll give the developer the benefit of the doubt and chop that off.
|
||||
if ([[name pathExtension] isEqualToString:@"txt"])
|
||||
name = [name stringByDeletingPathExtension];
|
||||
|
||||
NSString *downloadFileName = [NSString stringWithFormat:@"%@ %@", [host name], [updateItem versionString]];
|
||||
|
||||
|
||||
[tempDir release];
|
||||
tempDir = [[[host appSupportPath] stringByAppendingPathComponent:downloadFileName] retain];
|
||||
int cnt=1;
|
||||
while ([[NSFileManager defaultManager] fileExistsAtPath:tempDir] && cnt <= 999)
|
||||
{
|
||||
[tempDir release];
|
||||
tempDir = [[[host appSupportPath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@ %d", downloadFileName, cnt++]] retain];
|
||||
}
|
||||
|
||||
// Create the temporary directory if necessary.
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
BOOL success = YES;
|
||||
NSEnumerator *pathComponentEnumerator = [[tempDir pathComponents] objectEnumerator];
|
||||
NSString *pathComponentAccumulator = @"";
|
||||
NSString *currentPathComponent;
|
||||
while ((currentPathComponent = [pathComponentEnumerator nextObject])) {
|
||||
pathComponentAccumulator = [pathComponentAccumulator stringByAppendingPathComponent:currentPathComponent];
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:pathComponentAccumulator]) continue;
|
||||
success &= [[NSFileManager defaultManager] createDirectoryAtPath:pathComponentAccumulator attributes:nil];
|
||||
}
|
||||
#else
|
||||
BOOL success = [[NSFileManager defaultManager] createDirectoryAtPath:tempDir withIntermediateDirectories:YES attributes:nil error:NULL];
|
||||
#endif
|
||||
if (!success)
|
||||
{
|
||||
// Okay, something's really broken with this user's file structure.
|
||||
[download cancel];
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUTemporaryDirectoryError userInfo:[NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Can't make a temporary directory for the update download at %@.",tempDir] forKey:NSLocalizedDescriptionKey]]];
|
||||
}
|
||||
|
||||
downloadPath = [[tempDir stringByAppendingPathComponent:name] retain];
|
||||
[download setDestination:downloadPath allowOverwrite:YES];
|
||||
}
|
||||
|
||||
- (BOOL)validateUpdateDownloadedToPath:(NSString *)downloadedPath extractedToPath:(NSString *)extractedPath DSASignature:(NSString *)DSASignature publicDSAKey:(NSString *)publicDSAKey
|
||||
{
|
||||
NSString *newBundlePath = [SUInstaller appPathInUpdateFolder:extractedPath forHost:host];
|
||||
if (newBundlePath)
|
||||
{
|
||||
NSError *error = nil;
|
||||
if ([SUCodeSigningVerifier codeSignatureIsValidAtPath:newBundlePath error:&error]) {
|
||||
return YES;
|
||||
} else {
|
||||
SULog(@"Code signature check on update failed: %@", error);
|
||||
}
|
||||
}
|
||||
|
||||
return [SUDSAVerifier validatePath:downloadedPath withEncodedDSASignature:DSASignature withPublicDSAKey:publicDSAKey];
|
||||
}
|
||||
|
||||
- (void)downloadDidFinish:(NSURLDownload *)d
|
||||
{
|
||||
[self extractUpdate];
|
||||
}
|
||||
|
||||
- (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while downloading the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
}
|
||||
|
||||
- (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType
|
||||
{
|
||||
// We don't want the download system to extract our gzips.
|
||||
// Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug.
|
||||
return ([encodingType rangeOfString:@"gzip"].location == NSNotFound);
|
||||
}
|
||||
|
||||
- (void)extractUpdate
|
||||
{
|
||||
SUUnarchiver *unarchiver = [SUUnarchiver unarchiverForPath:downloadPath updatingHost:host];
|
||||
if (!unarchiver)
|
||||
{
|
||||
SULog(@"Sparkle Error: No valid unarchiver for %@!", downloadPath);
|
||||
[self unarchiverDidFail:nil];
|
||||
return;
|
||||
}
|
||||
CFRetain(unarchiver); // Manage this memory manually so we don't have to make it an IV.
|
||||
[unarchiver setDelegate:self];
|
||||
[unarchiver start];
|
||||
}
|
||||
|
||||
- (void)failedToApplyDeltaUpdate
|
||||
{
|
||||
// When a delta update fails to apply we fall back on updating via a full install.
|
||||
[updateItem release];
|
||||
updateItem = nonDeltaUpdateItem;
|
||||
nonDeltaUpdateItem = nil;
|
||||
|
||||
[self downloadUpdate];
|
||||
}
|
||||
|
||||
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
|
||||
{
|
||||
if (ua) { CFRelease(ua); }
|
||||
[self installWithToolAndRelaunch:YES];
|
||||
}
|
||||
|
||||
- (void)unarchiverDidFail:(SUUnarchiver *)ua
|
||||
{
|
||||
if (ua) { CFRelease(ua); }
|
||||
|
||||
if ([updateItem isDeltaUpdate]) {
|
||||
[self failedToApplyDeltaUpdate];
|
||||
return;
|
||||
}
|
||||
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUUnarchivingError userInfo:[NSDictionary dictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil) forKey:NSLocalizedDescriptionKey]]];
|
||||
}
|
||||
|
||||
- (BOOL)shouldInstallSynchronously { return NO; }
|
||||
|
||||
- (void)installWithToolAndRelaunch:(BOOL)relaunch
|
||||
{
|
||||
#if !ENDANGER_USERS_WITH_INSECURE_UPDATES
|
||||
if (![self validateUpdateDownloadedToPath:downloadPath extractedToPath:tempDir DSASignature:[updateItem DSASignature] publicDSAKey:[host publicDSAKey]])
|
||||
{
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUSignatureError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedDescriptionKey, @"The update is improperly signed.", NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
relaunch = NO; // TOTALFINDER-related HACK to prevent relaunch, installer does relaunch automatically
|
||||
|
||||
if (![updater mayUpdateAndRestart])
|
||||
{
|
||||
[self abortUpdate];
|
||||
return;
|
||||
}
|
||||
|
||||
// Give the host app an opportunity to postpone the install and relaunch.
|
||||
static BOOL postponedOnce = NO;
|
||||
if (!postponedOnce && [[updater delegate] respondsToSelector:@selector(updater:shouldPostponeRelaunchForUpdate:untilInvoking:)])
|
||||
{
|
||||
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[self class] instanceMethodSignatureForSelector:@selector(installWithToolAndRelaunch:)]];
|
||||
[invocation setSelector:@selector(installWithToolAndRelaunch:)];
|
||||
[invocation setArgument:&relaunch atIndex:2];
|
||||
[invocation setTarget:self];
|
||||
postponedOnce = YES;
|
||||
if ([[updater delegate] updater:updater shouldPostponeRelaunchForUpdate:updateItem untilInvoking:invocation])
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ([[updater delegate] respondsToSelector:@selector(updater:willInstallUpdate:)])
|
||||
[[updater delegate] updater:updater willInstallUpdate:updateItem];
|
||||
|
||||
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
||||
NSString *relaunchPathToCopy = [SPARKLE_BUNDLE pathForResource:@"finish_installation" ofType:@"app"];
|
||||
NSString *targetPath = [[host appSupportPath] stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
NSError *error = nil;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] attributes: [NSDictionary dictionary]];
|
||||
#else
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath: [targetPath stringByDeletingLastPathComponent] withIntermediateDirectories: YES attributes: [NSDictionary dictionary] error: &error];
|
||||
#endif
|
||||
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
if( [SUPlainInstaller copyPathWithAuthentication: relaunchPathToCopy overPath: targetPath temporaryName: nil error: &error] )
|
||||
relaunchPath = [targetPath retain];
|
||||
else
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.", nil), NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't copy relauncher (%@) to temporary path (%@)! %@", relaunchPathToCopy, targetPath, (error ? [error localizedDescription] : @"")], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:SUUpdaterWillRestartNotification object:self];
|
||||
if ([[updater delegate] respondsToSelector:@selector(updaterWillRelaunchApplication:)])
|
||||
[[updater delegate] updaterWillRelaunchApplication:updater];
|
||||
|
||||
if(!relaunchPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath])
|
||||
{
|
||||
// Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin.
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURelaunchError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:SULocalizedString(@"An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@.", nil), [host name]], NSLocalizedDescriptionKey, [NSString stringWithFormat:@"Couldn't find the relauncher (expected to find it at %@)", relaunchPath], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
// We intentionally don't abandon the update here so that the host won't initiate another.
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *pathToRelaunch = [host bundlePath];
|
||||
if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)])
|
||||
pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
|
||||
NSString *relaunchToolPath = [relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS/finish_installation"];
|
||||
[NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects:[host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], tempDir, relaunch ? @"1" : @"0", nil]];
|
||||
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
- (void)cleanUpDownload
|
||||
{
|
||||
if (tempDir != nil) // tempDir contains downloadPath, so we implicitly delete both here.
|
||||
{
|
||||
BOOL success = NO;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
success = [[NSFileManager defaultManager] removeFileAtPath: tempDir handler: nil]; // Clean up the copied relauncher
|
||||
#else
|
||||
NSError * error = nil;
|
||||
success = [[NSFileManager defaultManager] removeItemAtPath: tempDir error: &error]; // Clean up the copied relauncher
|
||||
#endif
|
||||
if( !success )
|
||||
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:[tempDir stringByDeletingLastPathComponent] destination:@"" files:[NSArray arrayWithObject:[tempDir lastPathComponent]] tag:NULL];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)installerForHost:(SUHost *)aHost failedWithError:(NSError *)error
|
||||
{
|
||||
if (aHost != host) { return; }
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] removeFileAtPath: relaunchPath handler: nil]; // Clean up the copied relauncher
|
||||
#else
|
||||
NSError * dontThrow = nil;
|
||||
[[NSFileManager defaultManager] removeItemAtPath: relaunchPath error: &dontThrow]; // Clean up the copied relauncher
|
||||
#endif
|
||||
[self abortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while installing the update. Please try again later.", nil), NSLocalizedDescriptionKey, [error localizedDescription], NSLocalizedFailureReasonErrorKey, nil]]];
|
||||
}
|
||||
|
||||
- (void)abortUpdate
|
||||
{
|
||||
[[self retain] autorelease]; // In case the notification center was the last one holding on to us.
|
||||
[self cleanUpDownload];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[super abortUpdate];
|
||||
}
|
||||
|
||||
- (void)abortUpdateWithError:(NSError *)error
|
||||
{
|
||||
if ([error code] != SUNoUpdateError) // Let's not bother logging this.
|
||||
SULog(@"Sparkle Error: %@", [error localizedDescription]);
|
||||
if ([error localizedFailureReason])
|
||||
SULog(@"Sparkle Error (continued): %@", [error localizedFailureReason]);
|
||||
if (download)
|
||||
[download cancel];
|
||||
[self abortUpdate];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[updateItem release];
|
||||
[nonDeltaUpdateItem release];
|
||||
[download release];
|
||||
[downloadPath release];
|
||||
[tempDir release];
|
||||
[relaunchPath release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -9,9 +9,7 @@
|
||||
#ifndef SUBINARYDELTAAPPLY_H
|
||||
#define SUBINARYDELTAAPPLY_H
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NSString;
|
||||
BOOL applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile, BOOL verbose, void (^progressCallback)(double), NSError * __autoreleasing *error);
|
||||
int applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,101 @@
|
||||
//
|
||||
// SUBinaryDeltaApply.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Rowe on 2009-06-01.
|
||||
// Copyright 2009 Mark Rowe. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SUBinaryDeltaApply.h"
|
||||
#import "SUBinaryDeltaCommon.h"
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <bspatch.h>
|
||||
#import <stdio.h>
|
||||
#import <stdlib.h>
|
||||
#import <xar/xar.h>
|
||||
|
||||
static void applyBinaryDeltaToFile(xar_t x, xar_file_t file, NSString *sourceFilePath, NSString *destinationFilePath)
|
||||
{
|
||||
NSString *patchFile = temporaryFilename(@"apply-binary-delta");
|
||||
xar_extract_tofile(x, file, [patchFile fileSystemRepresentation]);
|
||||
const char *argv[] = {"/usr/bin/bspatch", [sourceFilePath fileSystemRepresentation], [destinationFilePath fileSystemRepresentation], [patchFile fileSystemRepresentation]};
|
||||
bspatch(4, (char **)argv);
|
||||
unlink([patchFile fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
int applyBinaryDelta(NSString *source, NSString *destination, NSString *patchFile)
|
||||
{
|
||||
xar_t x = xar_open([patchFile UTF8String], READ);
|
||||
if (!x) {
|
||||
fprintf(stderr, "Unable to open %s. Giving up.\n", [patchFile UTF8String]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
NSString *expectedBeforeHash = nil;
|
||||
NSString *expectedAfterHash = nil;
|
||||
xar_subdoc_t subdoc;
|
||||
for (subdoc = xar_subdoc_first(x); subdoc; subdoc = xar_subdoc_next(subdoc)) {
|
||||
if (!strcmp(xar_subdoc_name(subdoc), "binary-delta-attributes")) {
|
||||
const char *value = 0;
|
||||
xar_subdoc_prop_get(subdoc, "before-sha1", &value);
|
||||
if (value)
|
||||
expectedBeforeHash = [NSString stringWithUTF8String:value];
|
||||
|
||||
xar_subdoc_prop_get(subdoc, "after-sha1", &value);
|
||||
if (value)
|
||||
expectedAfterHash = [NSString stringWithUTF8String:value];
|
||||
}
|
||||
}
|
||||
|
||||
if (!expectedBeforeHash || !expectedAfterHash) {
|
||||
fprintf(stderr, "Unable to find before-sha1 or after-sha1 metadata in delta. Giving up.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Verifying source... ");
|
||||
NSString *beforeHash = hashOfTree(source);
|
||||
|
||||
if (![beforeHash isEqualToString:expectedBeforeHash]) {
|
||||
fprintf(stderr, "Source doesn't have expected hash (%s != %s). Giving up.\n", [expectedBeforeHash UTF8String], [beforeHash UTF8String]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nCopying files... ");
|
||||
removeTree(destination);
|
||||
copyTree(source, destination);
|
||||
|
||||
fprintf(stderr, "\nPatching... ");
|
||||
xar_file_t file;
|
||||
xar_iter_t iter = xar_iter_new();
|
||||
for (file = xar_file_first(x, iter); file; file = xar_file_next(iter)) {
|
||||
NSString *path = [NSString stringWithUTF8String:xar_get_path(file)];
|
||||
NSString *sourceFilePath = [source stringByAppendingPathComponent:path];
|
||||
NSString *destinationFilePath = [destination stringByAppendingPathComponent:path];
|
||||
|
||||
const char *value;
|
||||
if (!xar_prop_get(file, "delete", &value) || !xar_prop_get(file, "delete-then-extract", &value)) {
|
||||
removeTree(destinationFilePath);
|
||||
if (!xar_prop_get(file, "delete", &value))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!xar_prop_get(file, "binary-delta", &value))
|
||||
applyBinaryDeltaToFile(x, file, sourceFilePath, destinationFilePath);
|
||||
else
|
||||
xar_extract_tofile(x, file, [destinationFilePath fileSystemRepresentation]);
|
||||
}
|
||||
xar_close(x);
|
||||
|
||||
fprintf(stderr, "\nVerifying destination... ");
|
||||
NSString *afterHash = hashOfTree(destination);
|
||||
|
||||
if (![afterHash isEqualToString:expectedAfterHash]) {
|
||||
fprintf(stderr, "Destination doesn't have expected hash (%s != %s). Giving up.\n", [expectedAfterHash UTF8String], [afterHash UTF8String]);
|
||||
removeTree(destination);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nDone!\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// SUBinaryDeltaCommon.h
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Rowe on 2009-06-01.
|
||||
// Copyright 2009 Mark Rowe. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef SUBINARYDELTACOMMON_H
|
||||
#define SUBINARYDELTACOMMON_H
|
||||
|
||||
#include <fts.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSData;
|
||||
|
||||
extern int binaryDeltaSupported(void);
|
||||
extern int compareFiles(const FTSENT **a, const FTSENT **b);
|
||||
extern NSData *hashOfFile(FTSENT *ent);
|
||||
extern NSString *hashOfTree(NSString *path);
|
||||
extern void removeTree(NSString *path);
|
||||
extern void copyTree(NSString *source, NSString *dest);
|
||||
extern NSString *pathRelativeToDirectory(NSString *directory, NSString *path);
|
||||
NSString *temporaryFilename(NSString *base);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,165 @@
|
||||
//
|
||||
// SUBinaryDeltaCommon.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Rowe on 2009-06-01.
|
||||
// Copyright 2009 Mark Rowe. All rights reserved.
|
||||
//
|
||||
|
||||
#include "SUBinaryDeltaCommon.h"
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
extern int xar_close(void*) __attribute__((weak_import));
|
||||
|
||||
int binaryDeltaSupported(void)
|
||||
{
|
||||
// OS X 10.4 didn't include libxar, so we link against it weakly.
|
||||
// This checks whether libxar is available at runtime.
|
||||
return xar_close != 0;
|
||||
}
|
||||
|
||||
int compareFiles(const FTSENT **a, const FTSENT **b)
|
||||
{
|
||||
return strcoll((*a)->fts_name, (*b)->fts_name);
|
||||
}
|
||||
|
||||
NSString *pathRelativeToDirectory(NSString *directory, NSString *path)
|
||||
{
|
||||
NSUInteger directoryLength = [directory length];
|
||||
if ([path hasPrefix:directory])
|
||||
return [path substringFromIndex:directoryLength];
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
NSString *temporaryFilename(NSString *base)
|
||||
{
|
||||
NSString *template = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.XXXXXXXXXX", base]];
|
||||
char buffer[MAXPATHLEN];
|
||||
strcpy(buffer, [template fileSystemRepresentation]);
|
||||
return [NSString stringWithUTF8String:mktemp(buffer)];
|
||||
}
|
||||
|
||||
static void _hashOfBuffer(unsigned char *hash, const char* buffer, size_t bufferLength)
|
||||
{
|
||||
assert(bufferLength <= UINT32_MAX);
|
||||
CC_SHA1_CTX hashContext;
|
||||
CC_SHA1_Init(&hashContext);
|
||||
CC_SHA1_Update(&hashContext, buffer, (CC_LONG)bufferLength);
|
||||
CC_SHA1_Final(hash, &hashContext);
|
||||
}
|
||||
|
||||
static void _hashOfFile(unsigned char* hash, FTSENT *ent)
|
||||
{
|
||||
if (ent->fts_info == FTS_SL) {
|
||||
char linkDestination[MAXPATHLEN + 1];
|
||||
ssize_t linkDestinationLength = readlink(ent->fts_path, linkDestination, MAXPATHLEN);
|
||||
if (linkDestinationLength < 0) {
|
||||
perror("readlink");
|
||||
return;
|
||||
}
|
||||
|
||||
_hashOfBuffer(hash, linkDestination, linkDestinationLength);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ent->fts_info == FTS_F) {
|
||||
int fileDescriptor = open(ent->fts_path, O_RDONLY);
|
||||
if (fileDescriptor == -1) {
|
||||
perror("open");
|
||||
return;
|
||||
}
|
||||
|
||||
size_t fileSize = (size_t)ent->fts_statp->st_size;
|
||||
if (fileSize == 0) {
|
||||
_hashOfBuffer(hash, NULL, 0);
|
||||
close(fileDescriptor);
|
||||
return;
|
||||
}
|
||||
|
||||
void *buffer = mmap(0, fileSize, PROT_READ, MAP_FILE | MAP_PRIVATE, fileDescriptor, 0);
|
||||
if (buffer == (void*)-1) {
|
||||
close(fileDescriptor);
|
||||
perror("mmap");
|
||||
return;
|
||||
}
|
||||
|
||||
_hashOfBuffer(hash, buffer, fileSize);
|
||||
munmap(buffer, fileSize);
|
||||
close(fileDescriptor);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ent->fts_info == FTS_D)
|
||||
memset(hash, 0xdd, CC_SHA1_DIGEST_LENGTH);
|
||||
}
|
||||
|
||||
NSData *hashOfFile(FTSENT *ent)
|
||||
{
|
||||
unsigned char fileHash[CC_SHA1_DIGEST_LENGTH];
|
||||
_hashOfFile(fileHash, ent);
|
||||
return [NSData dataWithBytes:fileHash length:CC_SHA1_DIGEST_LENGTH];
|
||||
}
|
||||
|
||||
NSString *hashOfTree(NSString *path)
|
||||
{
|
||||
const char *sourcePaths[] = {[path UTF8String], 0};
|
||||
FTS *fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
perror("fts_open");
|
||||
return nil;
|
||||
}
|
||||
|
||||
CC_SHA1_CTX hashContext;
|
||||
CC_SHA1_Init(&hashContext);
|
||||
|
||||
FTSENT *ent = 0;
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL)
|
||||
continue;
|
||||
|
||||
unsigned char fileHash[CC_SHA1_DIGEST_LENGTH];
|
||||
_hashOfFile(fileHash, ent);
|
||||
CC_SHA1_Update(&hashContext, fileHash, sizeof(fileHash));
|
||||
|
||||
NSString *relativePath = pathRelativeToDirectory(path, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
NSData *relativePathBytes = [relativePath dataUsingEncoding:NSUTF8StringEncoding];
|
||||
CC_SHA1_Update(&hashContext, [relativePathBytes bytes], (uint32_t)[relativePathBytes length]);
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
unsigned char hash[CC_SHA1_DIGEST_LENGTH];
|
||||
CC_SHA1_Final(hash, &hashContext);
|
||||
|
||||
char hexHash[CC_SHA1_DIGEST_LENGTH * 2 + 1];
|
||||
size_t i;
|
||||
for (i = 0; i < CC_SHA1_DIGEST_LENGTH; i++)
|
||||
sprintf(hexHash + i * 2, "%02x", hash[i]);
|
||||
|
||||
return [NSString stringWithUTF8String:hexHash];
|
||||
}
|
||||
|
||||
void removeTree(NSString *path)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] removeItemAtPath:path error:0];
|
||||
#else
|
||||
[[NSFileManager defaultManager] removeFileAtPath:path handler:nil];
|
||||
#endif
|
||||
}
|
||||
|
||||
void copyTree(NSString *source, NSString *dest)
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||
[[NSFileManager defaultManager] copyItemAtPath:source toPath:dest error:0];
|
||||
#else
|
||||
[[NSFileManager defaultManager] copyPath:source toPath:dest handler:nil];
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
//
|
||||
// SUBinaryDeltaTool.m
|
||||
// Sparkle
|
||||
//
|
||||
// Created by Mark Rowe on 2009-06-01.
|
||||
// Copyright 2009 Mark Rowe. All rights reserved.
|
||||
//
|
||||
|
||||
#define _DARWIN_NO_64_BIT_INODE 1
|
||||
|
||||
#include "SUBinaryDeltaCommon.h"
|
||||
#include "SUBinaryDeltaApply.h"
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <fcntl.h>
|
||||
#include <fts.h>
|
||||
#include <libgen.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <xar/xar.h>
|
||||
|
||||
extern int bsdiff(int argc, const char **argv);
|
||||
|
||||
@interface CreateBinaryDeltaOperation : NSOperation
|
||||
{
|
||||
NSString *_relativePath;
|
||||
NSString *_fromPath;
|
||||
NSString *_toPath;
|
||||
NSString *_resultPath;
|
||||
}
|
||||
- (id)initWithRelativePath:(NSString *)relativePath oldTree:(NSString *)oldTree newTree:(NSString *)newTree;
|
||||
|
||||
- (NSString *)relativePath;
|
||||
- (NSString *)resultPath;
|
||||
@end
|
||||
|
||||
@implementation CreateBinaryDeltaOperation
|
||||
|
||||
- (id)initWithRelativePath:(NSString *)relativePath oldTree:(NSString *)oldTree newTree:(NSString *)newTree
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
_relativePath = [relativePath copy];
|
||||
_fromPath = [[oldTree stringByAppendingPathComponent:relativePath] retain];
|
||||
_toPath = [[newTree stringByAppendingPathComponent:relativePath] retain];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)relativePath
|
||||
{
|
||||
return [[_relativePath retain] autorelease];
|
||||
}
|
||||
|
||||
- (NSString *)resultPath
|
||||
{
|
||||
return [[_resultPath retain] autorelease];
|
||||
}
|
||||
|
||||
- (void)main
|
||||
{
|
||||
NSString *temporaryFile = temporaryFilename(@"BinaryDelta");
|
||||
const char *argv[] = {"/usr/bin/bsdiff", [_fromPath fileSystemRepresentation], [_toPath fileSystemRepresentation], [temporaryFile fileSystemRepresentation]};
|
||||
int result = bsdiff(4, argv);
|
||||
if (!result)
|
||||
_resultPath = [temporaryFile retain];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
static NSDictionary *infoForFile(FTSENT *ent)
|
||||
{
|
||||
NSData *hash = hashOfFile(ent);
|
||||
NSNumber *size = nil;
|
||||
if (ent->fts_info != FTS_D)
|
||||
size = [NSNumber numberWithUnsignedLongLong:ent->fts_statp->st_size];
|
||||
return [NSDictionary dictionaryWithObjectsAndKeys:hash, @"hash", [NSNumber numberWithUnsignedShort:ent->fts_info], @"type", size, @"size", nil];
|
||||
}
|
||||
|
||||
static NSString *absolutePath(NSString *path)
|
||||
{
|
||||
NSURL *url = [[[NSURL alloc] initFileURLWithPath:path] autorelease];
|
||||
return [[url absoluteURL] path];
|
||||
}
|
||||
|
||||
static NSString *temporaryPatchFile(NSString *patchFile)
|
||||
{
|
||||
NSString *path = absolutePath(patchFile);
|
||||
NSString *directory = [path stringByDeletingLastPathComponent];
|
||||
NSString *file = [path lastPathComponent];
|
||||
return [NSString stringWithFormat:@"%@/.%@.tmp", directory, file];
|
||||
}
|
||||
|
||||
static BOOL shouldSkipDeltaCompression(NSString *key, NSDictionary* originalInfo, NSDictionary *newInfo)
|
||||
{
|
||||
unsigned long long fileSize = [[newInfo objectForKey:@"size"] unsignedLongLongValue];
|
||||
if (fileSize < 4096)
|
||||
return YES;
|
||||
|
||||
if (!originalInfo)
|
||||
return YES;
|
||||
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
static BOOL shouldDeleteThenExtract(NSString *key, NSDictionary* originalInfo, NSDictionary *newInfo)
|
||||
{
|
||||
if (!originalInfo)
|
||||
return NO;
|
||||
|
||||
if ([[originalInfo objectForKey:@"type"] unsignedShortValue] != [[newInfo objectForKey:@"type"] unsignedShortValue])
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (argc != 5) {
|
||||
usage:
|
||||
fprintf(stderr, "Usage: BinaryDelta [create | apply] before-tree after-tree patch-file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
NSString *command = [NSString stringWithUTF8String:argv[1]];
|
||||
NSString *oldPath = [NSString stringWithUTF8String:argv[2]];
|
||||
NSString *newPath = [NSString stringWithUTF8String:argv[3]];
|
||||
NSString *patchFile = [NSString stringWithUTF8String:argv[4]];
|
||||
|
||||
if ([command isEqualToString:@"apply"]) {
|
||||
int result = applyBinaryDelta(oldPath, newPath, patchFile);
|
||||
[pool drain];
|
||||
return result;
|
||||
}
|
||||
if (![command isEqualToString:@"create"]) {
|
||||
[pool drain];
|
||||
goto usage;
|
||||
}
|
||||
|
||||
NSMutableDictionary *originalTreeState = [NSMutableDictionary dictionary];
|
||||
|
||||
const char *sourcePaths[] = {[oldPath fileSystemRepresentation], 0};
|
||||
FTS *fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Processing %s...", [oldPath UTF8String]);
|
||||
FTSENT *ent = 0;
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
|
||||
continue;
|
||||
|
||||
NSString *key = pathRelativeToDirectory(oldPath, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
if (![key length])
|
||||
continue;
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
[originalTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *beforeHash = hashOfTree(oldPath);
|
||||
|
||||
NSMutableDictionary *newTreeState = [NSMutableDictionary dictionary];
|
||||
for (NSString *key in originalTreeState)
|
||||
{
|
||||
[newTreeState setObject:[NSNull null] forKey:key];
|
||||
}
|
||||
|
||||
fprintf(stderr, "\nProcessing %s... ", [newPath UTF8String]);
|
||||
sourcePaths[0] = [newPath fileSystemRepresentation];
|
||||
fts = fts_open((char* const*)sourcePaths, FTS_PHYSICAL | FTS_NOCHDIR, compareFiles);
|
||||
if (!fts) {
|
||||
[pool drain];
|
||||
perror("fts_open");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
while ((ent = fts_read(fts))) {
|
||||
if (ent->fts_info != FTS_F && ent->fts_info != FTS_SL && ent->fts_info != FTS_D)
|
||||
continue;
|
||||
|
||||
NSString *key = pathRelativeToDirectory(newPath, [NSString stringWithUTF8String:ent->fts_path]);
|
||||
if (![key length])
|
||||
continue;
|
||||
|
||||
NSDictionary *info = infoForFile(ent);
|
||||
NSDictionary *oldInfo = [originalTreeState objectForKey:key];
|
||||
|
||||
if ([info isEqual:oldInfo])
|
||||
[newTreeState removeObjectForKey:key];
|
||||
else
|
||||
[newTreeState setObject:info forKey:key];
|
||||
}
|
||||
fts_close(fts);
|
||||
|
||||
NSString *afterHash = hashOfTree(newPath);
|
||||
|
||||
fprintf(stderr, "\nGenerating delta... ");
|
||||
|
||||
NSString *temporaryFile = temporaryPatchFile(patchFile);
|
||||
xar_t x = xar_open([temporaryFile fileSystemRepresentation], WRITE);
|
||||
xar_opt_set(x, XAR_OPT_COMPRESSION, "bzip2");
|
||||
xar_subdoc_t attributes = xar_subdoc_new(x, "binary-delta-attributes");
|
||||
xar_subdoc_prop_set(attributes, "before-sha1", [beforeHash UTF8String]);
|
||||
xar_subdoc_prop_set(attributes, "after-sha1", [afterHash UTF8String]);
|
||||
|
||||
NSOperationQueue *deltaQueue = [[NSOperationQueue alloc] init];
|
||||
NSMutableArray *deltaOperations = [NSMutableArray array];
|
||||
|
||||
NSArray *keys = [[newTreeState allKeys] sortedArrayUsingSelector:@selector(compare:)];
|
||||
for (NSString* key in keys) {
|
||||
id value = [newTreeState valueForKey:key];
|
||||
|
||||
if ([value isEqual:[NSNull null]]) {
|
||||
xar_file_t newFile = xar_add_frombuffer(x, 0, [key fileSystemRepresentation], (char *)"", 1);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "delete", "true");
|
||||
continue;
|
||||
}
|
||||
|
||||
NSDictionary *originalInfo = [originalTreeState objectForKey:key];
|
||||
NSDictionary *newInfo = [newTreeState objectForKey:key];
|
||||
if (shouldSkipDeltaCompression(key, originalInfo, newInfo)) {
|
||||
NSString *path = [newPath stringByAppendingPathComponent:key];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [key fileSystemRepresentation], [path fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
if (shouldDeleteThenExtract(key, originalInfo, newInfo))
|
||||
xar_prop_set(newFile, "delete-then-extract", "true");
|
||||
} else {
|
||||
CreateBinaryDeltaOperation *operation = [[CreateBinaryDeltaOperation alloc] initWithRelativePath:key oldTree:oldPath newTree:newPath];
|
||||
[deltaQueue addOperation:operation];
|
||||
[deltaOperations addObject:operation];
|
||||
[operation release];
|
||||
}
|
||||
}
|
||||
|
||||
[deltaQueue waitUntilAllOperationsAreFinished];
|
||||
[deltaQueue release];
|
||||
|
||||
for (CreateBinaryDeltaOperation *operation in deltaOperations) {
|
||||
NSString *resultPath = [operation resultPath];
|
||||
xar_file_t newFile = xar_add_frompath(x, 0, [[operation relativePath] fileSystemRepresentation], [resultPath fileSystemRepresentation]);
|
||||
assert(newFile);
|
||||
xar_prop_set(newFile, "binary-delta", "true");
|
||||
unlink([resultPath fileSystemRepresentation]);
|
||||
}
|
||||
|
||||
xar_close(x);
|
||||
|
||||
unlink([patchFile fileSystemRepresentation]);
|
||||
link([temporaryFile fileSystemRepresentation], [patchFile fileSystemRepresentation]);
|
||||
unlink([temporaryFile fileSystemRepresentation]);
|
||||
fprintf(stderr, "Done!\n");
|
||||
|
||||
[pool drain];
|
||||
return 0;
|
||||
}
|
||||