package com.atlassian.bitbucket.installer.scripts;

import com.atlassian.bitbucket.installer.utils.InstallerUtils;
import com.install4j.api.context.InstallerContext;

public class InstallAsServiceScreen extends AbstractInstallerScript {


    public InstallAsServiceScreen(InstallerContext context, InstallerUtils utils) {
        super(context, utils);
    }

    /**
     * To determine if the service screen should show or not.
     * It won't be shown if it's an upgrade, or if the user doesn't have admin rights.
     * @return true if admin rights is granted and this is a new install, false otherwise
     */
    public boolean shouldShowScreen() {
        return getInstallationDetails().isAdmin()
                && getInstallationDetails().isNewInstall();
    }
}
