我正在尝试将Sparkle与 Qt(Go 绑定)应用程序结合使用。
闪闪发光.m:
#import <Headers/SUUpdater.h>
static SUUpdater* updater = nil;
void sparkle_checkUpdates()
{
if (!updater) {
updater = [[SUUpdater sharedUpdater] retain];
}
[updater setUpdateCheckInterval:3600];
[updater checkForUpdatesInBackground];
}
火花.去:
// +build darwin windows
package main
/*
#cgo CFLAGS: -I ${SRCDIR}/Sparkle.framework
#cgo LDFLAGS: -F ${SRCDIR} -framework Sparkle
void sparkle_checkUpdates();
*/
import "C"
func sparkle_checkUpdates() {
C.sparkle_checkUpdates()
}
在 中main.go,我添加了一个菜单来调用该函数:
package main
import (
"github.com/therecipe/qt/widgets"
)
func main() {
action := widgets.NewQMenuBar(nil).AddMenu2("").AddAction("Check for Updates...")
// http://doc.qt.io/qt-5/qaction.html#MenuRole-enum
action.SetMenuRole(widgets.QAction__ApplicationSpecificRole)
action.ConnectTriggered(func(bool) { sparkle_checkUpdates() })
}
有更新时它工作正常:下载、提取、安装、重新启动……
但是当运行最新版本时,单击“检查更新……”菜单没有任何反应。没有弹出窗口说我们是最新的,像这样:
在控制台中,我只看到这个:
[3 <private> stream, pid: 90977, url: https://example.com/appcast.xml, traffic class: 200, tls] cancelled
[3.1 70A1F65B-7E7A-4ED2-AB8B-A21621ED7658 <private>.58040<-><private>]
Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns
Duration: 0.497s, DNS @0.000s took 0.001s, TCP @0.003s took 0.051s, TLS took 0.113s
bytes in/out: 4481/675, packets in/out: 6/3, rtt: 0.053s, retransmitted packets: 0, out-of-order packets: 0
应用广播.xml:
<?xml version="1.0" standalone="yes"?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Premium VPN</title>
<item>
<title>1.0.0.2905</title>
<pubDate>Tue, 11 Dec 2018 11:09:10 +0800</pubDate>
<sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
<enclosure url="https://example.com/x.zip" sparkle:version="1.0.0.2905" sparkle:shortVersionString="1.0.0.2905" sparkle:edSignature="x" length="104408678" type="application/octet-stream"/>
</item>
</channel>
</rss>
我错过了什么?
慕丝7291255
相关分类