public ActionResult Upload(int pageId)
        {
            ErrorHelper.CheckEditMode(HttpContext, nameof(ImageUploaderController.Upload));
            var page      = FileManagementHelper.GetPage(pageId);
            var imageGuid = Guid.Empty;

            if (Request.Files[0] is HttpPostedFileWrapper file && file != null)
            {
                try
                {
                    imageGuid = FileManagementHelper.AddUnsortedAttachment(page, TempPath, file);
                }
                catch (Exception ex)
                {
                    return(ErrorHelper.HandleException(
                               nameof(ImageUploaderController),
                               nameof(Upload),
                               ex,
                               ErrorHelper.UnprocessableStatusCode));
                }

                return(Json(new { guid = imageGuid }));
            }

            return(new HttpStatusCodeResult(ErrorHelper.UnprocessableStatusCode));
        }
Exemplo n.º 2
0
        public void Test_GetWordsInCategory1()
        {
            string category     = "CSharp";
            string filename     = "LingoWords.xml";
            string cwd          = Directory.GetCurrentDirectory();
            string fullFilePath = Path.Combine(cwd, filename);

            XElement      xElements = null;
            List <string> words     = FileManagementHelper.GetWordsInCategory(category);

            using (StreamReader reader = File.OpenText(fullFilePath))
            {
                xElements = XElement.Load(reader);
            }

            IEnumerable <XElement> itemsXml  = xElements.Descendants("Item");
            List <string>          baseWords = new List <string>();

            foreach (XElement item in itemsXml)
            {
                if (item.Element("Category").Value == "CSharp")
                {
                    baseWords.Add(item.Element("Word").Value);
                }
            }
            var firstNotSecond = words.Except(baseWords).ToList();
            var secondNotFirst = baseWords.Except(words).ToList();

            Assert.IsTrue(firstNotSecond.Count == 0 && secondNotFirst.Count == 0);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Restores the original.
        /// </summary>
        private void RestoreOriginal()
        {
            if (!Directory.Exists(_versionBackupPath))
            {
                return;
            }

            var filesToRestore = Directory.GetFiles(_versionBackupPath, "*.*", SearchOption.AllDirectories);

            foreach (var file in filesToRestore)
            {
                try
                {
                    var originalPath = Path.Combine(FileManagementHelper.ROOT_PATH, file.Replace(_versionBackupPath.EnsureTrailingBackslash(), string.Empty));

                    var backupDirectory = Path.GetDirectoryName(originalPath);
                    if (!Directory.Exists(backupDirectory))
                    {
                        Directory.CreateDirectory(backupDirectory);
                    }

                    FileManagementHelper.RenameFile(originalPath);
                    File.Move(file, originalPath);
                }
                catch (Exception ex)
                {
                    ExceptionLogService.LogException(ex);
                }
            }

            FileManagementHelper.CleanUpDeletedFiles();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Downloads the package.
        /// </summary>
        /// <param name="release">The release.</param>
        /// <returns></returns>
        /// <exception cref="Exception">Target Release ${release} doesn't have a Package URI specified.</exception>
        private string DownloadPackage(RockRelease release)
        {
            if (release.PackageUri.IsNullOrWhiteSpace())
            {
                throw new Exception($"Target Release ${release} doesn't have a Package URI specified.");
            }

            var localRockPackageDirectory = Path.Combine(FileManagementHelper.ROOT_PATH, LOCAL_ROCK_PACKAGE_FOLDER);

            if (!Directory.Exists(localRockPackageDirectory))
            {
                Directory.CreateDirectory(localRockPackageDirectory);
            }

            var localRockPackagePath = Path.Combine(localRockPackageDirectory, $"{release.SemanticVersion}.rockpkg");

            FileManagementHelper.DeleteOrRename(localRockPackagePath);

            try
            {
                var wc = new WebClient();
                wc.DownloadFile(release.PackageUri, localRockPackagePath);
            }
            catch
            {
                FileManagementHelper.DeleteOrRename(localRockPackagePath);
                throw;
            }

            return(localRockPackagePath);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Processes the content files.
        /// </summary>
        /// <param name="packageZip">The package zip.</param>
        private void ProcessContentFiles(ZipArchive packageZip)
        {
            var contentFilesToProcess = packageZip
                                        .Entries
                                        .Where(e => e.FullName.StartsWith(CONTENT_PATH, StringComparison.OrdinalIgnoreCase) ||
                                               e.FullName.StartsWith(CONTENT_PATH_ALT, StringComparison.OrdinalIgnoreCase))
                                        .Where(e => !e.FullName.EndsWith(TRANSFORM_FILE_SUFFIX, StringComparison.OrdinalIgnoreCase));

            // unzip content folder and process xdts
            foreach (ZipArchiveEntry entry in contentFilesToProcess)
            {
                // process all content files
                string fullpath = Path.Combine(FileManagementHelper.ROOT_PATH, entry.FullName.ReplaceFirstOccurrence(CONTENT_PATH, string.Empty).ReplaceFirstOccurrence(CONTENT_PATH_ALT, string.Empty));

                string directory = Path.GetDirectoryName(fullpath).ReplaceFirstOccurrence(CONTENT_PATH, string.Empty).ReplaceFirstOccurrence(CONTENT_PATH_ALT, string.Empty);

                ThrowTestExceptions(Path.GetFileNameWithoutExtension(entry.FullName));

                // if entry is a directory ignore it
                if (entry.Length != 0)
                {
                    BackupFile(fullpath);

                    if (!Directory.Exists(directory))
                    {
                        Directory.CreateDirectory(directory);
                    }

                    FileManagementHelper.RenameActiveFile(fullpath);

                    entry.ExtractToFile(fullpath, true);
                }
            }
        }
Exemplo n.º 6
0
        public void Test_GetWordsAndCategories()
        {
            bool pass = false;
            List <ValueTuple <string, string> > wordsAndCategories = FileManagementHelper.GetWordsAndCategories();
            List <string> words      = new List <string>();
            List <string> categories = new List <string>();

            foreach (ValueTuple <string, string> vtwc in wordsAndCategories)
            {
                words.Add(vtwc.Item2);
                categories.Add(vtwc.Item1);
            }

            List <string> distinctWords     = new List <string>(words.Distinct());
            List <string> distictCategories = new List <string>(categories.Distinct());

            if (distinctWords.Count > 1 && distictCategories.Count > 0)
            {
                if (distinctWords.Count == words.Count)
                {
                    if (distictCategories.Count == 1)
                    {
                        pass = true;
                    }
                }
                DisplayGetWordsAndCategoriesResults(words, distinctWords, distictCategories);
            }
            Assert.AreEqual(true, pass);
        }
Exemplo n.º 7
0
        public void Test_GetFileData()
        {
            //  TODO: Write a better test to actually discover if correct file, data were loaded
            string cwd          = Directory.GetCurrentDirectory();
            string filename     = "LingoWords.xml";
            string fullFilePath = Path.Combine(cwd, filename);

            XElement originalFile = FileManagementHelper.GetFileData(filename);
            XElement xDocFile     = FileManagementHelper.GetFileData();

            IEnumerable <XElement> errorMessage = from el in originalFile.Elements()
                                                  where el.Attribute("Category").Value == "Error"
                                                  select el;

            Console.WriteLine($"errorMessage output:\n{ errorMessage.ToString() }\n" +
                              $"originalFile Output:\n{ originalFile.ToString() }\n" +
                              $"xDocFile Output:\n{ xDocFile.ToString() }");

            Assert.AreNotEqual(errorMessage.ToString(), originalFile.ToString());

            //  If the file couldn't be loaded then the returned XElement will contain the following

            /*
             * new XElement("Words",
             *  new XElement("Item",
             *          new XElement("Category", "Error"),
             *          new XElement("Word", $"Maybe the file could not be found?")
             *          ));
             */
        }
Exemplo n.º 8
0
        public ActionResult Delete(int pageId, [System.Web.Http.FromBody] Guid?attachmentGuid)
        {
            ErrorHelper.CheckEditMode(HttpContext, nameof(SlideshowManagementController.Delete));

            if (attachmentGuid != null)
            {
                var page = FileManagementHelper.GetPage(pageId);

                if (page != null)
                {
                    var attachment = DocumentHelper.GetAttachment(page, attachmentGuid.Value);

                    if (attachment != null)
                    {
                        try
                        {
                            DocumentHelper.DeleteAttachment(page, attachmentGuid.Value);
                        }
                        catch (Exception ex)
                        {
                            ErrorHelper.HandleException(nameof(SlideshowManagementController.Delete), ex, Convert.ToInt32(HttpStatusCode.NoContent));
                        }

                        return(new HttpStatusCodeResult(HttpStatusCode.Accepted));
                    }
                }
            }

            return(new HttpStatusCodeResult(HttpStatusCode.NoContent));
        }
Exemplo n.º 9
0
        public void Test_ConvertToObjectList_EmptyReturnsEmpty()
        {
            XElement xe = null;
            List <LingoWordModel> actualResult   = FileManagementHelper.ConvertToObjectList(xe);
            List <LingoWordModel> expectedResult = new List <LingoWordModel>();

            Assert.AreEqual(expectedResult.Count, actualResult.Count);
            Assert.AreEqual(0, actualResult.Count);
        }
Exemplo n.º 10
0
        public void Test_GetWordsAndCategories_BadFilenameReturnsErrorCategory()
        {
            List <ValueTuple <string, string> > wordsAndCategories = FileManagementHelper.GetWordsAndCategories("nonExistingFile.xml");

            foreach (ValueTuple <string, string> vtwc in wordsAndCategories)
            {
                Assert.IsTrue(vtwc.Item1.ToString().ToUpper() == "error".ToUpper());
            }
        }
Exemplo n.º 11
0
        public void Test_GetWordsAndCategories_EmptyReturnsBlank()
        {
            List <ValueTuple <string, string> > wordsAndCategories = FileManagementHelper.GetWordsAndCategories("emptyLingoWords.xml");

            foreach (ValueTuple <string, string> vtwc in wordsAndCategories)
            {
                Assert.AreEqual(string.IsNullOrEmpty(vtwc.Item1), string.IsNullOrEmpty(vtwc.Item2));
            }
        }
Exemplo n.º 12
0
        public void Test_GetWordsInCategory()
        {
            List <string> words          = FileManagementHelper.GetWordsInCategory("CSharp");
            string        keyWord        = "method";
            bool          expectedResult = true;
            bool          actualResult   = words.Contains(keyWord);

            Assert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 13
0
        public void Test_MergeObjectLists()
        {
            LingoWordModel        lwm      = null;
            List <LingoWordModel> objList1 = new List <LingoWordModel>();
            List <LingoWordModel> objList2 = new List <LingoWordModel>();

            //  Example:
            //  Category 1, Word 1
            //  Category 2, Word 2
            //  Category 3, Word 3
            //  Category 4, Word 4

            for (int count = 1; count <= 4; count++)
            {
                lwm          = new LingoWordModel();
                lwm.Category = $"Category { count }";
                lwm.Word     = $"Word { count }";
                if (count % 2 != 0)
                {
                    objList1.Add(lwm);
                }
                else
                {
                    objList2.Add(lwm);
                }
            }

            StringBuilder expectedResult = new StringBuilder();

            expectedResult.Append("Category 1, ");
            expectedResult.AppendLine("Word 1");
            expectedResult.Append("Category 2, ");
            expectedResult.AppendLine("Word 2");
            expectedResult.Append("Category 3, ");
            expectedResult.AppendLine("Word 3");
            expectedResult.Append("Category 4, ");
            expectedResult.AppendLine("Word 4");

            List <LingoWordModel> mergedLists = FileManagementHelper.MergeObjectLists(objList1, objList2);

            StringBuilder actualResult = new StringBuilder();

            foreach (LingoWordModel lwms in mergedLists)
            {
                actualResult.Append($"{ lwms.Category }, ");
                actualResult.AppendLine($"{ lwms.Word }");
            }
            Console.WriteLine($"Expected\n" +
                              $"Output: { expectedResult.ToString() }\n" +
                              $"Length: { expectedResult.ToString().Length }\n" +
                              $"Actual:\n" +
                              $"Output: { actualResult.ToString() }\n" +
                              $"Length: { actualResult.ToString().Length }\n");

            Assert.IsTrue(expectedResult.ToString().Length == actualResult.ToString().Length);
        }
Exemplo n.º 14
0
        public void Test_GetWordsInCategory_InvalidIsZero()
        {
            List <string> words = null;

            words = FileManagementHelper.GetWordsInCategory("alskdh");
            int expectedResult = 0;
            int actualResult   = words.Count;

            Assert.AreEqual(expectedResult, actualResult);
        }
Exemplo n.º 15
0
        public ActionResult Upload(string filePathId, int mediaLibraryId)
        {
            if (Request.Files[0] is HttpPostedFileWrapper file && file != null)
            {
                string directoryPath = null;

                try
                {
                    directoryPath = FileManagementHelper.EnsureUploadDirectory(TempPath);
                }
                catch (Exception ex)
                {
                    return(ErrorHelper.HandleException(nameof(MediaLibraryUploaderController), nameof(Upload), ex));
                }

                if (!string.IsNullOrEmpty(directoryPath))
                {
                    string imagePath = null;

                    try
                    {
                        imagePath = FileManagementHelper.GetTempFilePath(directoryPath, file.FileName);
                    }
                    catch (Exception ex)
                    {
                        return(ErrorHelper.HandleException(nameof(MediaLibraryUploaderController), nameof(Upload), ex));
                    }

                    if (!string.IsNullOrEmpty(imagePath))
                    {
                        FileInfo fileInfo = null;

                        try
                        {
                            fileInfo = GetFileInfo(file, imagePath);
                        }
                        catch (Exception ex)
                        {
                            return(ErrorHelper.HandleException(
                                       nameof(MediaLibraryUploaderController),
                                       nameof(Upload),
                                       ex,
                                       ErrorHelper.UnprocessableStatusCode));
                        }

                        if (fileInfo != null)
                        {
                            return(CreateMediaFile(filePathId, mediaLibraryId, imagePath, fileInfo));
                        }
                    }
                }
            }

            return(new HttpStatusCodeResult(ErrorHelper.UnprocessableStatusCode));
        }
Exemplo n.º 16
0
        public void Test_ConvertToObjectList()
        {
            List <LingoWordModel> expectedResult = new List <LingoWordModel>(2);
            LingoWordModel        lwm            = null;

            for (int index = 1; index < 3; index++)
            {
                lwm          = new LingoWordModel();
                lwm.Category = $"Convert { index }";
                lwm.Word     = $"Alpha { index }";
                expectedResult.Add(lwm);
            }

            XElement xEl =
                new XElement(
                    new XElement("Root",
                                 new XElement("Item",
                                              new XElement("Category", "Convert 1"),
                                              new XElement("Word", "Alpha 1")
                                              ),
                                 new XElement("Item",
                                              new XElement("Category", "Convert 2"),
                                              new XElement("Word", "Alpha 2")
                                              )));

            int matchCount = 0;
            int totalCount = 0;

            List <LingoWordModel> actualResult = FileManagementHelper.ConvertToObjectList(xEl);

            if (actualResult.Count > 0)
            {
                for (int jindex = 0; jindex < actualResult.Count; jindex++)
                {
                    if (expectedResult[jindex].Category == actualResult[jindex].Category)
                    {
                        matchCount++;
                    }
                    totalCount++;
                    if (expectedResult[jindex].Word == actualResult[jindex].Word)
                    {
                        matchCount++;
                    }
                    totalCount++;
                }
            }

            Assert.AreEqual(expectedResult.Count, actualResult.Count); //  if equal than both lists have same number of objects
            Assert.AreEqual(totalCount, matchCount);                   //  if equal than all if conditionals returned true
        }
Exemplo n.º 17
0
        /// <summary>
        /// Backups the file.
        /// </summary>
        /// <param name="filepathToBackup">The filepath to backup.</param>
        private void BackupFile(string filepathToBackup)
        {
            if (File.Exists(filepathToBackup))
            {
                var backupFilePath  = GetBackupFileLocation(filepathToBackup);
                var backupDirectory = Path.GetDirectoryName(backupFilePath);
                if (!Directory.Exists(backupDirectory))
                {
                    Directory.CreateDirectory(backupDirectory);
                }

                FileManagementHelper.DeleteOrRename(backupFilePath);
                File.Copy(filepathToBackup, backupFilePath);
            }
        }
Exemplo n.º 18
0
        public void Test_MergeDocuments()
        {
            XElement expectedResult = new XElement("Words",
                                                   new XElement("Item",
                                                                new XElement("Category", "Merge"),
                                                                new XElement("Word", "one")),
                                                   new XElement("Item",
                                                                new XElement("Category", "Merge"),
                                                                new XElement("Word", "other"))
                                                   );

            XElement inputOne = new XElement(
                new XElement("Words",
                             new XElement("Item",
                                          new XElement("Category", "Merge"),
                                          new XElement("Word", "one")
                                          )));

            XElement inputTwo = new XElement(
                new XElement("Words",
                             new XElement("Item",
                                          new XElement("Category", "Merge"),
                                          new XElement("Word", "other")
                                          )));

            XElement actualResult = FileManagementHelper.MergeDocuments(inputOne, inputTwo);

            if (actualResult.IsEmpty || null == actualResult)
            {
                Assert.Fail($"actualResult was null or empty. Merge failed.");
            }
            //  only one input argument element was returned so fail the test
            //    Assert.Fail($"First Node == Last Node. Merge failed.");
            //}
            Assert.AreEqual(true, XNode.DeepEquals(expectedResult, actualResult));
            //else if (expectedResult.FirstNode.ToString() == actualResult.FirstNode.ToString())
            //{
            //    if (expectedResult.LastNode.ToString() != actualResult.LastNode.ToString())
            //    {
            //        if (expectedResult.LastNode.PreviousNode.ToString() == actualResult.LastNode.PreviousNode.ToString())
            //        {
            //            mergeSucceeded = true;
            //        }
            //    }
            //}
        }
Exemplo n.º 19
0
        public void Test_ConvertToXElement()
        {
            XElement expectedResult = new XElement(
                new XElement("Words",
                             new XElement("Item",
                                          new XElement("Category", "ConvertToXEl 1"),
                                          new XElement("Word", "Word 1")
                                          ),
                             new XElement("Item",
                                          new XElement("Category", "ConvertToXEl 2"),
                                          new XElement("Word", "Word 2")
                                          ),
                             new XElement("Item",
                                          new XElement("Category", "ConvertToXEl 3"),
                                          new XElement("Word", "Word 3")
                                          ),
                             new XElement("Item",
                                          new XElement("Category", "ConvertToXEl 4"),
                                          new XElement("Word", "Word 4")
                                          )));

            List <LingoWordModel> objectList = null;
            LingoWordModel        lwm        = null;

            objectList = new List <LingoWordModel>();
            for (int index = 1; index <= 4; index++)
            {
                lwm          = new LingoWordModel();
                lwm.Category = $"ConvertToXEl { index }";
                lwm.Word     = $"Word { index }";
                objectList.Add(lwm);
            }

            XElement actualResult = FileManagementHelper.ConvertToXElement(objectList);

            Console.WriteLine(
                $"Expected\n" +
                $"Output: \n{ expectedResult.ToString() }\n" +
                $"Length: \n{ expectedResult.ToString().Length }\n" +
                $"\nActual:\n" +
                $"Output: \n{ actualResult.ToString() }\n" +
                $"Length: \n{ actualResult.ToString().Length }\n"
                );

            Assert.IsTrue(expectedResult.ToString().Length == actualResult.ToString().Length);
        }
Exemplo n.º 20
0
        public void Test_GetCategories()
        {
            List <string> categories         = FileManagementHelper.GetCategories();
            List <string> distinctCategories = null;

            string expectedCategory = "CSharp";

            if (categories != null)
            {
                distinctCategories = new List <string>(categories.Distinct());
                Assert.AreEqual(distinctCategories.Count, 1);
                Assert.AreEqual(expectedCategory, distinctCategories[0]);
            }
            else
            {
                Assert.Fail();
            }
        }
Exemplo n.º 21
0
        public void Test_UpdateFileData()
        {
            bool     fileCreated = false;
            XElement document    = new XElement(
                new XElement("Root",
                             new XElement("Category", "Merge"),
                             new XElement("Word", "test")
                             ));

            string dstFilename     = "Test_UpdateFileData_LingoWords.xml";
            bool   operationOutput = FileManagementHelper.UpdateFileData(document, dstFilename);
            //                       document, filename: "..\\..\\..\\UnitTester\\UpdateFileDataOutput.xml");

            string cwd             = Directory.GetCurrentDirectory();
            string dstFullFilePath = Path.Combine(cwd, dstFilename);

            if (File.Exists(dstFullFilePath))
            {
                fileCreated = true;
                Thread.Sleep(5000);
                File.Delete(dstFullFilePath);
            }
            Assert.IsTrue(fileCreated);
        }
Exemplo n.º 22
0
 /// <summary>
 /// Installs the package.
 /// </summary>
 /// <param name="targetPackagePath">The target package path.</param>
 private void InstallPackage(string targetPackagePath)
 {
     OfflinePageHelper.CreateOfflinePage();
     try
     {
         using (ZipArchive packageZip = ZipFile.OpenRead(targetPackagePath))
         {
             ClearPreviousBackups();
             ProcessTransformFiles(packageZip);
             ProcessContentFiles(packageZip);
             ProcessDeleteFiles(packageZip);
             FileManagementHelper.CleanUpDeletedFiles();
         }
     }
     catch
     {
         RestoreOriginal();
         throw;
     }
     finally
     {
         OfflinePageHelper.RemoveOfflinePage();
     }
 }
Exemplo n.º 23
0
        public void Test_DeployDefaultWordlistFile()
        {
            StringBuilder sb             = new StringBuilder();
            string        sourceFilename = @"..\..\..\FileManagementHelper\StaticDefaultWords.xml";

            string destCWD      = Directory.GetCurrentDirectory();
            string destFile     = "LingoWords.xml";
            string destFilename = Path.Combine(destCWD, destFile);
            string backupFile   = $"{ destFile }.bak";

            sb.AppendLine(CheckFileExists("Source file", sourceFilename, "", "Test will fail."));
            sb.AppendLine(CheckFileExists("Destination file", destFile, "It will be overwritten", "It will be created"));
            sb.AppendLine(CheckFileExists("Backup file", backupFile, "It will be overwritten", "It could get created"));

            bool result = FileManagementHelper.DeployDefaultWordlistFile();

            sb.AppendLine(CheckFileExists("Source file", sourceFilename, "", "Test will fail."));
            sb.AppendLine(CheckFileExists("Destination file", destFile, "It could have been overwritten", "It was created"));
            sb.AppendLine(CheckFileExists("Backup file", backupFile, "", ""));

            Console.WriteLine(sb.ToString());

            Assert.IsTrue(result);
        }
Exemplo n.º 24
0
        /// <summary>
        /// Invoked on page load.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            var rockUpdateService = new RockUpdateService();

            // Set timeout for up to 15 minutes (just like installer)
            Server.ScriptTimeout = 900;
            ScriptManager.GetCurrent(Page).AsyncPostBackTimeout = 900;

            _isEarlyAccessOrganization = rockUpdateService.IsEarlyAccessInstance();
            _installedVersion          = new Version(VersionInfo.GetRockSemanticVersionNumber());

            if (rockUpdateService.GetRockReleaseProgram() != RockReleaseProgram.Production)
            {
                nbRepoWarning.Visible = true;
            }

            DisplayRockVersion();
            if (!IsPostBack)
            {
                btnIssues.NavigateUrl = rockUpdateService.GetRockEarlyAccessRequestUrl();

                if (_isEarlyAccessOrganization)
                {
                    hlblEarlyAccess.LabelType = Rock.Web.UI.Controls.LabelType.Success;
                    hlblEarlyAccess.Text      = "Early Access: Enabled";

                    pnlEarlyAccessNotEnabled.Visible = false;
                    pnlEarlyAccessEnabled.Visible    = true;
                }

                var checkFrameworkVersionResultResult = VersionValidationHelper.CheckFrameworkVersion();

                _isOkToProceed = true;

                if (checkFrameworkVersionResultResult == DotNetVersionCheckResult.Fail)
                {
                    // Starting with v13, .NET 4.7.2 is required. So, show a warning if they haven't updated yet.
                    nbVersionIssue.Visible  = true;
                    nbVersionIssue.Text    += "<p>You will need to upgrade your hosting server in order to proceed with the v13 update.</p>";
                    nbBackupMessage.Visible = false;
                }
                else if (checkFrameworkVersionResultResult == DotNetVersionCheckResult.Unknown)
                {
                    // Starting with v13, .NET 4.7.2 is required. So, show a warning if can't determine if they have updated yet.
                    nbVersionIssue.Visible  = true;
                    nbVersionIssue.Text    += "<p>You may need to upgrade your hosting server in order to proceed with the v13 update. We were <b>unable to determine which Framework version</b> your server is using.</p>";
                    nbVersionIssue.Details += "<div class='alert alert-warning'>We were unable to check your server to verify that the .Net 4.7.2 Framework is installed! <b>You MUST verify this manually before you proceed with the update</b> otherwise your Rock application will be broken until you update the server.</div>";
                    nbBackupMessage.Visible = false;
                }

                _hasSqlServer14OrHigher = VersionValidationHelper.CheckSqlServerVersionGreaterThenSqlServer2012();

                if (!_hasSqlServer14OrHigher)
                {
                    nbSqlServerVersionIssue.Visible = true;
                }

                _releases = GetOrderedReleaseList(rockUpdateService, _installedVersion);

                if (_releases.Count > 0)
                {
                    if (checkFrameworkVersionResultResult != DotNetVersionCheckResult.Pass && new Version(_releases.Last().SemanticVersion) >= new Version("1.13.0"))
                    {
                        // if VersionIssue is visible, and they are updating to v13 or later, show the version Warning as an Danger instead.
                        nbVersionIssue.NotificationBoxType = Rock.Web.UI.Controls.NotificationBoxType.Danger;
                    }

                    pnlUpdatesAvailable.Visible = true;
                    pnlUpdates.Visible          = true;
                    pnlNoUpdates.Visible        = false;
                    cbIncludeStats.Visible      = true;
                    BindGrid();
                }

                FileManagementHelper.CleanUpDeletedFiles();
            }
        }