闪耀永远是最新的

时间:2012-08-05 02:14:05

标签: xcode cocoa sparkle

我最近在我的cocoa应用程序中添加了Sparkle Framework [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>

谢谢!

补充:考虑到这一点,这是否应该导致行为与“你已经是最新的”不同?我觉得它会,但我不确定。

2 个答案:

答案 0 :(得分:13)

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

所以,在这里,你的CFBundleVersion(100)表明你有一个比appcast更新的(> 1.0)版本。

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

答案 1 :(得分:0)

我建议坚持使用Major.Minor.Batch(0.4.12)版本,并在app cast和项目本身的info.plist文件(CFBundleShortVersionString)中保持相同。 您也可以尝试与Sparkle http://amtourky.me/2016/01/20/mac-os-x-continuous-delivery-sparkler-the-missing-build-server-for-sparkle/

无缝集成的无障碍构建服务器