Reputation: 11
I have faced some inconvenience performing auto-update with .pkg (installer.app) on my Qt app.
First of all I tried installer
:
// Get full path to installer
QString installer = Path::getCacheFileInfo(Constants::INSTALLER_NAME).filePath();
QStringList args;
args << "installer" << "-pkg" << installer << "-target" << "/" << "-store";
QProcess::startDetached("sudo", args);
But - 1. Requires sudo
; 2. Installation progress is not shown to user.
Also I tried just to use open
on downloaded .pkg - this one seems to be the best approach. But I wish that installer performs "update" only (skip welcome page, EULA agreement etc.).
As far as I know pkg installer must detect if it must perform installation or upgrade (if app was already installed but version is higher)
Quote from pkgbuild
docs:
--version pkg-version Specify a version for the package. Packages with the same identifier are compared >using this version, to determine if the package is an upgrade or downgrade. If you don't specify a version, a default of zero is >assumed, but this may prevent proper upgrade/downgrade checking.
If I try to run installer with the same version installed it seems that installer do nothing about it, it looks like "fresh" installation.
I assume that may be achieved using scripts in distribution.xml
BundleOverwriteAction
I have tried to define BundleOverwriteAction
with Components.plist
. It's have no effect on installation ui. Probably is just effect installation process itself.
So I think I should try to work with distribution.xml
to find a way to skip unnecessary pages for upgrade. Or build update-only package.
The more I trying to deal with pkg, the more I understand that build own installation app is may be most simple solution to deliver updates to user. But still hope that you can configure pkg like Inno Setup
with /SILENT
Upvotes: 0
Views: 108