diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-02-24 11:49:17 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-03-02 08:11:55 +0000 |
commit | 76e113b90afe5555f39b2aa37edc8137d661a1ac (patch) | |
tree | e7f4cd4ecd684b0992d9f29fe160258e156bf9e3 /src/sdk/installerbase.cpp | |
parent | 187239ddbc37b7d98a825c5fff44e29c8561270d (diff) |
Add command line option to start the installer binary as uninstaller
Add option "--uninstaller" to start the installer binary explicitly as
uninstaller. This complements options "--updater" and
"--manage-packages".
Add convenience functions for setting and checking if the magic binary
marker has been set by the user.
Task-number: QTIFW-1639
Change-Id: Ie40ba9c56e09be079e309bca985b19a8a7bef7ef
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 091053e30..e1b553b83 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -227,13 +227,19 @@ int InstallerBase::run() if (parser.isSet(QLatin1String(CommandLineOptions::Updater))) { if (m_core->isInstaller()) throw QInstaller::Error(QLatin1String("Cannot start installer binary as updater.")); - m_core->setUpdater(); + m_core->setUserSetBinaryMarker(QInstaller::BinaryContent::MagicUpdaterMarker); } if (parser.isSet(QLatin1String(CommandLineOptions::ManagePackages))) { if (m_core->isInstaller()) throw QInstaller::Error(QLatin1String("Cannot start installer binary as package manager.")); - m_core->setPackageManager(); + m_core->setUserSetBinaryMarker(QInstaller::BinaryContent::MagicPackageManagerMarker); + } + + if (parser.isSet(QLatin1String(CommandLineOptions::Uninstaller))) { + if (m_core->isInstaller()) + throw QInstaller::Error(QLatin1String("Cannot start installer binary as uninstaller.")); + m_core->setUserSetBinaryMarker(QInstaller::BinaryContent::MagicUninstallerMarker); } if (parser.isSet(QLatin1String(CommandLineOptions::AddRepository))) { |