public WixEditData() { UseRelativeOrAbsolutePaths = PathHandling.UseRelativePathsWhenPossible; ExternalXmlEditor = Path.Combine(Environment.SystemDirectory, "notepad.exe"); UseInstanceOnly = false; WordWrapInResultsPanel = false; RecentOpenedFiles = new string[] {}; DisplayFullPathInTitlebar = false; XmlIndentation = 4; EditDialog = new EditDialogData(); Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); AllowIncludeChanges = IncludeChangesHandling.AskForEachFile; BackupChangedIncludes = true; }
public WixEditData(WixEditData oldVersion, XmlDocument rawData) { BinDirectory = oldVersion.BinDirectory; DarkLocation = oldVersion.DarkLocation; CandleLocation = oldVersion.CandleLocation; LightLocation = oldVersion.LightLocation; if (oldVersion.XsdsLocation == null) { XmlNode node = rawData.SelectSingleNode("/WixEdit/XsdLocation"); if (node != null && node.InnerText.Length > 0) { XsdsLocation = Path.GetDirectoryName(node.InnerText); } } else { XsdsLocation = oldVersion.XsdsLocation; } // Some magic to deal with a new WixEdit installation including a newer WiX version... if (!String.IsNullOrEmpty(BinDirectory) && (String.IsNullOrEmpty(DarkLocation) && String.IsNullOrEmpty(CandleLocation) && String.IsNullOrEmpty(LightLocation) && String.IsNullOrEmpty(XsdsLocation))) { if (!Directory.Exists(BinDirectory)) { DirectoryInfo oldBinDirectory = new DirectoryInfo(BinDirectory); if (oldBinDirectory.Parent != null) { FileInfo[] files = oldBinDirectory.Parent.GetFiles("candle.exe", SearchOption.AllDirectories); if (files.Length == 0 && oldBinDirectory.Parent.Parent != null) { files = oldBinDirectory.Parent.Parent.GetFiles("candle.exe", SearchOption.AllDirectories); } if (files.Length == 1) { BinDirectory = files[0].Directory.FullName; } else if (files.Length > 1) { ArrayList directoryList = new ArrayList(); foreach (FileInfo file in files) { directoryList.Add(file.Directory.FullName); } directoryList.Sort(); BinDirectory = (string)directoryList[directoryList.Count - 1]; } } } } TemplateDirectory = oldVersion.TemplateDirectory; if (!String.IsNullOrEmpty(TemplateDirectory)) { TemplateDirectory = TemplateDirectory.Replace("templates", "wizard"); } UseRelativeOrAbsolutePaths = oldVersion.UseRelativeOrAbsolutePaths; if (oldVersion.ExternalXmlEditor == null || oldVersion.ExternalXmlEditor.Length == 0) { ExternalXmlEditor = Path.Combine(Environment.SystemDirectory, "notepad.exe"); } else { ExternalXmlEditor = oldVersion.ExternalXmlEditor; } UseInstanceOnly = oldVersion.UseInstanceOnly; WordWrapInResultsPanel = oldVersion.WordWrapInResultsPanel; if (oldVersion.IgnoreFilesAndDirectories != null && oldVersion.IgnoreFilesAndDirectories.Count > 0) { IgnoreFilesAndDirectories = oldVersion.IgnoreFilesAndDirectories; } else { ArrayList oldValues = new ArrayList(); XmlNodeList nodes = rawData.SelectNodes("/WixEdit/IgnoreFilesAndDirectories/string"); foreach (XmlNode node in nodes) { oldValues.Add(node.InnerText); } if (oldValues.Count > 0) { IgnoreFilesAndDirectories = oldValues; } } RecentOpenedFiles = oldVersion.RecentOpenedFiles; DisplayFullPathInTitlebar = oldVersion.DisplayFullPathInTitlebar; XmlIndentation = oldVersion.XmlIndentation; AllowIncludeChanges = oldVersion.AllowIncludeChanges; BackupChangedIncludes = oldVersion.BackupChangedIncludes; if (oldVersion.EditDialog == null) { EditDialog = new EditDialogData(); } else { EditDialog = oldVersion.EditDialog; } Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); }