diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs index 71c207de369..8bfd8a4fd95 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs @@ -26,6 +26,7 @@ using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; +using DotNetNuke.Entities.Users; using DotNetNuke.Services.FileSystem; using DotNetNuke.Services.Upgrade.Internals; using DotNetNuke.Services.Upgrade.Internals.Steps; @@ -54,6 +55,15 @@ public override void Execute() Details = Localization.Localization.GetString("InitHostSetting", LocalInstallResourceFile); var installConfig = InstallController.Instance.GetInstallConfig(); + //if any super user (even deleted) is found - exit + var superUsers = UserController.GetUsers(true, true, Null.NullInteger); + if (superUsers != null && superUsers.Count > 0) + { + Details = "..."; + Status = StepStatus.Done; + return; + } + //Need to clear the cache to pick up new HostSettings from the SQLDataProvider script DataCache.RemoveCache(DataCache.HostSettingsCacheKey); diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs index b83ce41408d..ed53639e2c9 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs @@ -51,6 +51,15 @@ public override void Execute() Details = Localization.Localization.GetString("CreateSuperUser", LocalInstallResourceFile); var installConfig = InstallController.Instance.GetInstallConfig(); + //if any super user (even deleted) is found - exit + var superUsers = UserController.GetUsers(true, true, Null.NullInteger); + if (superUsers != null && superUsers.Count > 0) + { + Details = "..."; + Status = StepStatus.Done; + return; + } + //Set admin user to be a superuser var adminSuperUser = UserController.GetUserByName(0, installConfig.SuperUser.UserName); if (adminSuperUser != null) diff --git a/DNN Platform/Library/Services/Upgrade/Upgrade.cs b/DNN Platform/Library/Services/Upgrade/Upgrade.cs index cf1a27024ff..d5826ceccdd 100644 --- a/DNN Platform/Library/Services/Upgrade/Upgrade.cs +++ b/DNN Platform/Library/Services/Upgrade/Upgrade.cs @@ -4095,7 +4095,21 @@ public static string CheckUpgrade() /// ----------------------------------------------------------------------------- public static void DeleteInstallerFiles() { - var files = new List {"DotNetNuke.install.config", "InstallWizard.aspx", "InstallWizard.aspx.cs"}; + var files = new List + { + "DotNetNuke.install.config", + "DotNetNuke.install.config.resources", + "InstallWizard.aspx", + "InstallWizard.aspx.cs", + "InstallWizard.aspx.designer.cs", + "UpgradeWizard.aspx", + "UpgradeWizard.aspx.cs", + "UpgradeWizard.aspx.designer.cs", + "Install.aspx", + "Install.aspx.cs", + "Install.aspx.designer.cs", + }; + foreach (var file in files) { try @@ -4661,9 +4675,14 @@ public static void InstallDNN(string strProviderPath) // parse Host Settings if available InitialiseHostSettings(xmlDoc, true); - // parse SuperUser if Available - UserInfo superUser = GetSuperUser(xmlDoc, true); - UserController.CreateUser(ref superUser); + //Create SuperUser only when it's not there (even soft deleted) + var superUsers = UserController.GetUsers(true, true, Null.NullInteger); + if (superUsers == null || superUsers.Count == 0) + { + // parse SuperUser if Available + UserInfo superUser = GetSuperUser(xmlDoc, true); + UserController.CreateUser(ref superUser); + } // parse File List if available InstallFiles(xmlDoc, true); diff --git a/DNN Platform/Website/Install/InstallWizard.aspx.cs b/DNN Platform/Website/Install/InstallWizard.aspx.cs index b87ca2e40ef..cf800493a7d 100644 --- a/DNN Platform/Website/Install/InstallWizard.aspx.cs +++ b/DNN Platform/Website/Install/InstallWizard.aspx.cs @@ -301,7 +301,7 @@ private static void LaunchAutoInstall() private static void Install() { //bail out early if we are already running - if (_installerRunning || InstallBlocker.Instance.IsInstallInProgress()) + if (_installerRunning || InstallBlocker.Instance.IsInstallInProgress() || (Globals.Status != Globals.UpgradeStatus.Install)) return; var percentForEachStep = 100 / _steps.Count;