2

我最近将 Sparkle 框架 [ http://sparkle-project.org/ ] 添加到我的可可应用程序中。当我向 appcast.xml 添加一个虚拟的新项目(1.1 版)并随后尝试从 1.0 版更新时,它说“XXX 1.0 当前是可用的最新版本”。

我已经有一段时间了,我已经阅读了很多次文档 [ https://github.com/sparkle-project/Sparkle/wiki ],但没有成功。

这是我的 Info.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>BuildMachineOSBuild</key>
    <string>11E53</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>Snappi</string>
    <key>CFBundleExecutable</key>
    <string>Snappi</string>
    <key>CFBundleIconFile</key>
    <string>snappi_icon.icns</string>
    <key>CFBundleIdentifier</key>
    <string>com.snppi.Snappi</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Snappi</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>100</string>
    <key>DTCompiler</key>
    <string>com.apple.compilers.llvm.clang.1_0</string>
    <key>DTPlatformBuild</key>
    <string>4E3002</string>
    <key>DTPlatformVersion</key>
    <string>GM</string>
    <key>DTSDKBuild</key>
    <string>11E52</string>
    <key>DTSDKName</key>
    <string>macosx10.7</string>
    <key>DTXcode</key>
    <string>0433</string>
    <key>DTXcodeBuild</key>
    <string>4E3002</string>
    <key>LSApplicationCategoryType</key>
    <string>public.app-category.productivity</string>
    <key>LSBackgroundOnly</key>
    <false/>
    <key>LSMinimumSystemVersion</key>
    <string>10.6</string>
    <key>LSUIElement</key>
    <string>1</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2012 Marshall Moutenot All rights reserved.</string>
    <key>NSMainNibFile</key>
    <string>StatusBar</string>
    <key>NSPrincipalClass</key>
    <string>NSApplication</string>
    <key>SUFeedURL</key>
    <string>http://app.snppi.com/Snappi.xml</string>
    <key>SUPublicDSAKeyFile</key>
    <string>dsa_pub.pem</string>
</dict>
</plist>

还有我的 appcast.xml(重命名为 Snappi.xml):

<?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>Snappi</title>
    <link>http://app.snppi.com/Snappi.xml</link>
    <description>
      Send snapshots and files to friends in seconds. Snappi automatically generates a short link, so all you have to do is press paste.    
    </description>
    <language>en</language>
    <item>
      <title>Version 1.1</title>
      <sparkle:releaseNotesLink>
    http://app.snappi.com
      </sparkle:releaseNotesLink>
      <pubDate>Sat, 4 Aug 2012 20:26:11 +0000</pubDate>
      <enclosure 
    url="http://app.snppi.com/Snappi_1_1.dmg"
    sparkle:version="1.1"
    length="10518528"
    type="application/octet-stream" 
    sparkle:dsaSignature="MC0CFHaN/qB0aAb6V9rHMVHCLoBrTyJ8AhUAl0Wazod0rtzpxsvIaL0aYTg+KpQ=" 
    />
    </item>
    <item>
      <title>Version 1.0</title>
      <sparkle:releaseNotesLink>
    http://app.snappi.com
      </sparkle:releaseNotesLink>
      <pubDate>Sat, 4 Aug 2012 18:26:11 +0000</pubDate>
      <enclosure 
    url="http://app.snppi.com/Snappi_1_0.dmg"
    sparkle:version="1.0"
    length="10518528"
    type="application/octet-stream" 
    sparkle:dsaSignature="MC0CFHaN/qB0aAb6V9rHMVHCLoBrTyJ8AhUAl0Wazod0rtzpxsvIaL0aYTg+KpQ=" 
    />
    </item>
  </channel>
</rss>

谢谢!

补充:再想一想,这是否会导致与“你已经是最新的”不同的行为?我觉得会,但我不确定。

4

2 回答 2

13

Sparkle 将 appcast 中的 sparkle:version 属性与 plist 中的 CFBundleVersion 进行比较(这是机器可读的版本)。

因此,在这里,您的 CFBundleVersion (100) 表示您有一个较新的 (>1.0) 版本,即 appcast 中的版本。

另一方面,CFBundleShortVersionString(对应于演员表中的 sparkle:shortVersionString)用于“用户可显示”版本。

于 2012-08-06T01:03:56.503 回答
0

我建议坚持使用 Major.Minor.Batch (0.4.12) 版本控制,并在应用程序演员表和项目本身的 info.plist 文件 (CFBundleShortVersionString) 中保持相同。你也可以试试这个与 Sparkle 无缝集成的无忧构建服务器http://amtourky.me/2016/01/20/mac-os-x-continuous-delivery-sparkler-the-missing-build-server-for -火花/

于 2016-02-01T11:39:31.087 回答