diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-02-04 12:40:39 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2020-02-12 07:27:49 +0000 |
commit | 4848af4c1f599f79922bb35cc212ed2f17388441 (patch) | |
tree | d901334210302331c7376bbe6f1c0bb51ea0bad1 /src/sdk/installerbase.cpp | |
parent | 8fa14d6f0960ef9f771aa41f258236630b20c0f6 (diff) |
Do not prompt admin query when command line interface is used
If admin rights are needed, fail and require to install with sudo. This
is how command line interfaces commonly behave. Add convenience
functions for setting and checking if the installer is used from
command line.
Task-number: QTIFW-1598
Change-Id: Ib28d3be08254dade5d9b2d29da9232064f008eb4
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 320a247a2..b1b0e9e5d 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -314,7 +314,8 @@ int InstallerBase::run() } } - //Do not show gui with --silentUpdate, instead update components silently + // Do not show gui if any of the following options are set + m_core->setCommandLineInstance(true); if (parser.isSet(QLatin1String(CommandLineOptions::SilentUpdate))) { if (m_core->isInstaller()) throw QInstaller::Error(QLatin1String("Cannot start installer binary as updater.")); @@ -363,6 +364,7 @@ int InstallerBase::run() return EXIT_FAILURE; m_core->installDefaultComponentsSilently(); } else { + m_core->setCommandLineInstance(false); //create the wizard GUI TabController controller(nullptr); controller.setManager(m_core); |