/// <summary> /// Build the fileSpecs_ List of files to add to the archive. /// </summary> /// <returns> /// true if it was able to fully build the list. /// </returns> bool BuildFileList() { if (bool.Parse(Settings.Global.DataBackup["BackupData"])) { // Ok, they want to backup the Data Directory. Let's Scan this // directory to get all the files and move on. foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\data")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupScripts"])) { // Ok, they want to backup all the Scripts. Let's Scan this // directory to get all the files and move on. Let's remember, we also // need to check everything within each Package Root. OH MY! fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\pol.cfg"); fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\uoconvert.cfg"); foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\config")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\regions")) { fileSpecs_.Add(filename); } foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\scripts")) { fileSpecs_.Add(filename); } // Now we read the PackageRoot Entries from Ecompile.Cfg in order to get // all the user's "pkg" directories. OH YAY! EConfig MyConfig = new EConfig(); MyConfig.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); foreach (string pathname in MyConfig.GetPackageRoots()) { foreach (string filename in FileSystemUtil.GetAllFileNames(pathname)) { fileSpecs_.Add(filename); } } } if (bool.Parse(Settings.Global.DataBackup["BackupRealms"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\realm")) { fileSpecs_.Add(filename); } } if (bool.Parse(Settings.Global.DataBackup["BackupLogs"])) { foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\log")) { fileSpecs_.Add(filename); } } return(fileSpecs_.Count > 0); }
private void BTN_ECompilePackageRoots_Click(object sender, EventArgs e) { if (ECompileCFG == null) { DialogResult result = MessageBox.Show(this, "We need to load ECompile.Cfg for this option. Proceed?", "Load ECompile.Cfg", MessageBoxButtons.YesNo); if (result == DialogResult.No) { return; } ECompileCFG.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]); } GB_PackageRootEditor.Visible = true; GB_PackageRootEditor.BringToFront(); BTN_ECompile.Enabled = false; BTN_ECompile.Visible = false; List <string> MyPackageRoots = ECompileCFG.GetPackageRoots(); foreach (string PathName in MyPackageRoots) { object[] PathObject = new object[] { PathName.ToString() }; int RowIndex = DGV_PackageRoot.Rows.Add(PathObject); } }