2015-12-16 14 views
7

現在、Qtインストーラフレームワークを使用しており、オンラインリポジトリを設定できました。私が知りたいことは次の通りです:Qtインストーラフレームワーク:自動更新

フレームワークは、ある種の「自動更新」メカニズムを提供していますか?プログラム/システムが起動するたびにアップデートをチェックするプラグイン/サービス?
maintananceツールを使用してインストール自体を行うことができるので、アップデートを確認するだけで十分です。 が自動更新を受信するよう

エンドユーザーは、同様に、最初のインストール後、サーバーから追加コンポーネントをインストールするためにメンテナンスツールを使用することができます。

私はこのトピックについて見つけることができるすべての

は、この小さな文でした更新プログラムがサーバーに公開されると直ちにコンテンツに追加されます。ここから

:あなたの助けをhttp://doc.qt.io/qtinstallerframework/ifw-overview.html#choosing-installer-type

ありがとう!

編集:この質問の受け入れanswere私が自動的にインストーラフレームワークを使用して更新を確認する小さなライブラリを作成したに基づいて提案
- https://github.com/Skycoder42/QtAutoUpdater

+0

[Mendeley/Update-Installer](https://github.com/Mendeley/Update-Installer)が興味深いかもしれません。 –

答えて

13

QProcessを使用してメンテナンスツールを実行し、出力を確認します。 GUIを実行しないモードがありますが、利用可能な場合は更新情報のみを出力します。

アプリケーションが起動するときに作業ディレクトリをアプリケーションのパスに設定しているので、maintenancetoolを実行することができます。

QProcess process; 
process.start("maintenancetool --checkupdates"); 

// Wait until the update tool is finished 
process.waitForFinished(); 

if(process.error() != QProcess::UnknownError) 
{ 
    qDebug() << "Error checking for updates"; 
    return false; 
} 

// Read the output 
QByteArray data = process.readAllStandardOutput(); 

// No output means no updates available 
// Note that the exit code will also be 1, but we don't use that 
// Also note that we should parse the output instead of just checking if it is empty if we want specific update info 
if(data.isEmpty()) 
{ 
    qDebug() << "No updates available"; 
    return false; 
} 

// Call the maintenance tool binary 
// Note: we start it detached because this application need to close for the update 
QStringList args("--updater"); 
bool success = QProcess::startDetached("maintenancetool", args); 

// Close the application 
qApp->closeAllWindows(); 
0

あり、それを行う方法についてのガイドのセクションには、ですが、彼らはそれを自動更新ではなく更新を促進すると呼びます。IFW Updates on doc.qt.io

+0

私はそれを見ましたが、わかっていれば、ユーザーはMaintananceToolを実行してそれらのアップデートを取得する必要がありますか? – Felix