//This will set the front end version number to zero, thus requiring that it be updated next launch. public static void SetFrontEndVersionToZero() { var doc = GetXmlDoc.GetFrontEndXmlDoc(); doc.SelectSingleNode("//CurrentVersion").InnerText = "0"; doc.Save(GetPath.GetSettingsXMLPath(DTO.Enums.BackEndOrFrontEndEnum.FrontEnd)); }
//This will set the current Front End launcher version to the passed in int. public static void UpdateFrontEndLauncherVersion(int currentLauncherVersion) { var doc = GetXmlDoc.GetFrontEndXmlDoc(); doc.SelectSingleNode("//LauncherVersion").InnerText = currentLauncherVersion.ToString(); SaveXmlDoc.saveFrontEndDoc(doc); }
//This is an important method for the FrontEnd. A DTO.RolloutInfo object is passed in and then this will //update the frontend.xml file for the user with that info. public static void UpdateFrontEndXml(DTO.RolloutInfo rollout) { var doc = GetXmlDoc.GetFrontEndXmlDoc(); doc.SelectSingleNode("//LaunchFile").InnerText = rollout.LaunchFile; doc.SelectSingleNode("//CurrentUserType").InnerText = rollout.UserTypeName; doc.SelectSingleNode("//CurrentVersion").InnerText = rollout.RolloutVersionString; doc.SelectSingleNode("//CurrentZipPath").InnerText = rollout.ZipPath; SaveXmlDoc.saveFrontEndDoc(doc); }
//This will pull all the values from the frontend.xml file and put them into a DTO.RolloutInfo object. public static RolloutInfo GetFrontEndSettings() { RolloutInfo currentRollout = new RolloutInfo(); var doc = GetXmlDoc.GetFrontEndXmlDoc(); try { currentRollout.RolloutDirectory = doc.SelectSingleNode("//RolloutDirectory").InnerText; currentRollout.ZipPath = doc.SelectSingleNode("//CurrentZipPath").InnerText; currentRollout.LaunchFile = doc.SelectSingleNode("//LaunchFile").InnerText; currentRollout.UserTypeName = doc.SelectSingleNode("//CurrentUserType").InnerText; currentRollout.RolloutVersionString = doc.SelectSingleNode("//CurrentVersion").InnerText; currentRollout.UninstallerPath = doc.SelectSingleNode("//UninstallerLocation").InnerText; } catch (Exception) { throw new DTO.Exceptions.FrontEndNeedsUpdateException(); } return(currentRollout); }
//This will get the current launcher version from the user's local front end. public static int GetFrontEndLauncherVersion() { var doc = GetXmlDoc.GetFrontEndXmlDoc(); return(int.Parse(doc.SelectSingleNode("//LauncherVersion").InnerText)); }
//This function will return just the uninstaller path from the front end settings. public static string GetUninstallerPath() { var doc = GetXmlDoc.GetFrontEndXmlDoc(); return(doc.SelectSingleNode("//UninstallerLocation").InnerText); }