diff options
author | Niels Weber <niels.weber@digia.com> | 2013-11-18 18:06:58 +0100 |
---|---|---|
committer | Niels Weber <niels.weber@digia.com> | 2013-11-19 10:33:46 +0100 |
commit | b0ca7d129f81421a65ff7d7c225a3e4c26e5bf8d (patch) | |
tree | e70ad44a89118de874c0e7b5436270c6a37b5e32 /dist/installer | |
parent | cd7eed60faeef0056e9fb0415d9b28c0f5b2afd7 (diff) |
Don't show checkbox for Creator if root on Linux and Mac.
Task-number: QTCREATORBUG-9491
Change-Id: Iae5025a311b72596a038424baa4cfb60149b1cdd
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'dist/installer')
-rw-r--r-- | dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs index 79424d27ab..8e9bbfbb4d 100644 --- a/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs +++ b/dist/installer/ifw/packages/org.qtproject.qtcreator.application/meta/installscript.qs @@ -175,10 +175,24 @@ Component.prototype.createOperations = function() } } +function isRoot() +{ + if (installer.value("os") == "x11" || installer.value("os") == "mac") + { + var id = installer.execute("/usr/bin/id", new Array("-u"))[0]; + id = id.replace(/(\r\n|\n|\r)/gm,""); + if (id === "0") + { + return true; + } + } + return false; +} + Component.prototype.installationFinishedPageIsShown = function() { try { - if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success) { + if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isRoot()) { installer.addWizardPageItem( component, "LaunchQtCreatorCheckBoxForm", QInstaller.InstallationFinished ); } } catch(e) { @@ -189,7 +203,7 @@ Component.prototype.installationFinishedPageIsShown = function() Component.prototype.installationFinished = function() { try { - if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success) { + if (component.installed && installer.isInstaller() && installer.status == QInstaller.Success && !isRoot()) { var isLaunchQtCreatorCheckBoxChecked = component.userInterface("LaunchQtCreatorCheckBoxForm").launchQtCreatorCheckBox.checked; if (isLaunchQtCreatorCheckBoxChecked) installer.executeDetached(component.qtCreatorBinaryPath, new Array(), "@homeDir@"); |