//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 method is ultimately called by FrontEndInstaller application. It creates the frontend.xml file //In the user's appDataDirectory. The Xml nodes are mostly empty except for the rollout directory and the //Uninstaller location. These are pre-populated because they are necessary from the start for //the front-end to operate. public static void CreateFrontEndXMLFile(string rolloutDirectory, string appDataDirectory, int currentLauncherVersion) { var doc = new XmlDocument(); XmlDeclaration xmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", null); XmlElement root = doc.DocumentElement; doc.InsertBefore(xmlDeclaration, root); XmlElement baseDoc = doc.CreateElement("FrontEndSettings"); doc.AppendChild(baseDoc); XmlElement launcherVersion = doc.CreateElement("LauncherVersion"); launcherVersion.InnerText = currentLauncherVersion.ToString(); baseDoc.AppendChild(launcherVersion); XmlElement rolloutDirectoryEl = doc.CreateElement("RolloutDirectory"); rolloutDirectoryEl.InnerText = rolloutDirectory; baseDoc.AppendChild(rolloutDirectoryEl); XmlElement uninstallLocation = doc.CreateElement("UninstallerLocation"); uninstallLocation.InnerText = rolloutDirectory + "AccessLauncher.FeUninstaller.exe"; baseDoc.AppendChild(uninstallLocation); XmlElement currentZipPath = doc.CreateElement("CurrentZipPath"); baseDoc.AppendChild(currentZipPath); XmlElement launchFile = doc.CreateElement("LaunchFile"); baseDoc.AppendChild(launchFile); XmlElement currentUserType = doc.CreateElement("CurrentUserType"); baseDoc.AppendChild(currentUserType); XmlElement currentVersion = doc.CreateElement("CurrentVersion"); baseDoc.AppendChild(currentVersion); SaveXmlDoc.saveFrontEndDoc(doc); }