Andy Matuschak 似乎表明 Sparkle 实际上可以为您优雅地处理“仅下载”。用他自己的话说,只需将<enclosure>
您的元素排除在外,<item>
然后添加一个<sparkle:version>2.0</sparkle:version>
元素作为<item>
.
在这里阅读他的评论:https ://github.com/sparkle-project/Sparkle/issues/227#issuecomment-13192723
就像他之前的费马一样,他遗漏了一条信息。但与定理不同的是,我们可以访问 Sparkle 源代码,尤其是SUAppcastItem.m
. 感谢代码,我发现丢失的部分是一个<link>
标签。这是一个示例应用广播:
<?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>FooBar</title>
<link>http://foobar.com/appcast.xml</link>
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>FooBar 2.0</title>
<sparkle:releaseNotesLink>http://foobar.com/release-notes-special.html</sparkle:releaseNotesLink>
<sparkle:minimumSystemVersion>10.9.0</sparkle:minimumSystemVersion>
<pubDate>2014-04-14T18:40:44+02:00</pubDate>
<sparkle:version>2013</sparkle:version>
<sparkle:shortVersionString>2.0</sparkle:shortVersionString>
<link>http://foobar.com/release-notes-special.html</link>
</item>
</channel>
</rss>
在接收该应用广播且无法更新的沙盒应用中,“安装更新”已消失,取而代之的是一个“了解更多”按钮,该按钮会将用户带到该<link>
. 这是获得下载说明的好地方。
在您的应用程序的下一个版本中,您可以为 appcast 使用不同的 URL,以便上述 appcast 仅适用于旧版本(假设您修复了一些问题,现在使用 Sparkle 的非官方 XPC 技巧)。