By Yaron V. | 4/5/2016 | Qt

Using Sparkle in Qt

Automatic Software update is a very important feature you need to implement in almost any product. Sparkle is an easy-to-use software update framework for macOS applications that answers this need and it can be integrated in almost any development environment. Here is how to integrate it into Qt farmework

 

Using the Sparkle framework with Qt:

 

Prerequisites:

Download the sdk from: https://sparkle-project.org/ and compile that project in XCode.

 Add the Sparkle.framework file to /Library

Open Qt and find which compiler you are using:

Adding the framework and using it:

Copy the complied project (Sparkle.framework) to the complier lib path, and check that all links inside the Sparkle.framework work (have files in them).

 

Open your Qt .Pro file and add the following line:

LIBS += -framework Sparkle

Create a MacUtils.h class:

class MacUtils
{
    public:
         static void checkUpdates();
};

 

Create a MacUtils.mm file with objective C code:

 

#include "Sparkle/Sparkle.h"
#include <Sparkle/SUUpdater.h>
static SUUpdater*  updater = [[SUUpdater sharedUpdater] retain];
void MacUtils::checkUpdates()
{
    [updater setUpdateCheckInterval:3600];
    [updater checkForUpdatesInBackground];
}

Configure the remote server and then add the remote host settings to the application by adding a DES key file to the bundle and the following keys to the plist file:

 

 

Now invoke the update function to check for updatescool

 

Note:

Some of the dependency problems can be solved by running: ~/Qt5.5.1/5.5/clang_64/bin/macdeployqt [path to the bundle]

this will invoke the otool application that adds dependencies to your application bundle

 

 

 

{{CommentsModel.TotalCount}} Comments

Your Comment

{{CommentsModel.Message}}

Recent Stories

Top DiscoverSDK Experts

User photo
3355
Ashton Torrence
Web and Windows developer
GUI | Web and 11 more
View Profile
User photo
3220
Mendy Bennett
Experienced with Ad network & Ad servers.
Mobile | Ad Networks and 1 more
View Profile
User photo
3060
Karen Fitzgerald
7 years in Cross-Platform development.
Mobile | Cross Platform Frameworks
View Profile
Show All
X

Compare Products

Select up to three two products to compare by clicking on the compare icon () of each product.

{{compareToolModel.Error}}

Now comparing:

{{product.ProductName | createSubstring:25}} X
Compare Now