Commit b0ca7d12 authored by Niels Weber's avatar Niels Weber

Don't show checkbox for Creator if root on Linux and Mac.

Task-number: QTCREATORBUG-9491

Change-Id: Iae5025a311b72596a038424baa4cfb60149b1cdd
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent cd7eed60
......@@ -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@");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment