Commit 7eaab142101891cfbfc5b742927153a814bb940e
1 parent
13749fa5
v1.6.3
- BackupPackage package list megjelenítésében levő hiba javítása
Showing
2 changed files
with
32 additions
and
22 deletions
Show diff stats
Vrh.Log4Pro.MaintenanceConsole/Manager - BackupPackageManager.cs
... | ... | @@ -70,37 +70,27 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
70 | 70 | foreach (var p in sr.SelectedParameterList) { OnePackageToCreate(p.Parameters as BackupPackage,TS); } |
71 | 71 | return o; |
72 | 72 | } |
73 | - private static void OnePackageToCreate(BackupPackage bp,DateTime? timestamp=null) | |
73 | + private static void OnePackageToCreate(BackupPackage bpck,DateTime? timestamp) | |
74 | 74 | { |
75 | 75 | try |
76 | 76 | { |
77 | - //packaget | |
78 | - var packagets = (timestamp.HasValue ? timestamp.Value : DateTime.Now).ToString("yyyyMMddHHmmss"); | |
79 | - var vars = new Dictionary<string, string>(); | |
80 | - vars.Add("PACKAGENAME", bp.Xml_PackageName); | |
81 | - vars.Add("PACKAGETS", packagets); | |
82 | - vars.Add("PACKAGEKEY", bp.Xml_Key); | |
77 | + var bp = bpck.ResolveNames(timestamp); | |
83 | 78 | |
84 | 79 | var destinationfolder = Path.GetDirectoryName(bp.Xml_PackageFilePath); |
85 | 80 | if (!Path.IsPathRooted(destinationfolder)) { destinationfolder = Path.Combine(Directory.GetCurrentDirectory(), destinationfolder); } |
86 | 81 | if (!Directory.Exists(destinationfolder)) { Directory.CreateDirectory(destinationfolder); } |
87 | 82 | |
88 | 83 | var destinationfilename = Path.GetFileNameWithoutExtension(bp.Xml_PackageFilePath); |
89 | - //string tempfolderpath = Tools.GetTemporaryFoldername(destinationfolder); | |
90 | - | |
91 | - destinationfilename = StringConstructor.ResolveConstructorR(vars, destinationfilename, "{}@@"); | |
92 | - destinationfolder = StringConstructor.ResolveConstructorR(vars, destinationfolder, "{}@@"); | |
93 | 84 | var temprootfolder=string.IsNullOrEmpty(bp.Xml_TempDirectoryPath) ? destinationfolder : bp.Xml_TempDirectoryPath; |
94 | - | |
95 | 85 | string tempfolderpath = Path.Combine(temprootfolder, destinationfilename); |
96 | 86 | |
97 | 87 | if (Directory.Exists(tempfolderpath)) { Directory.Delete(tempfolderpath, true); } |
98 | 88 | if (!Directory.Exists(tempfolderpath)) { Directory.CreateDirectory(tempfolderpath); } |
99 | 89 | |
100 | - foreach (var bf in bp.Xml_BackupFolderList) { BackupPackageManagerCore.FolderZipBackup(bf, tempfolderpath, vars); } | |
90 | + foreach (var bf in bp.Xml_BackupFolderList) { BackupPackageManagerCore.FolderZipBackup(bf, tempfolderpath); } | |
101 | 91 | foreach (var sqldb in bp.Xml_BackupSQLDataBaseList) { SQLDataBaseManagerNS.SQLDataBaseManager.Execute(sqldb.Xml_Key,sqldb.Xml_DBBackup,sqldb.Xml_ScriptBackup,sqldb.Xml_TableDataBackup, tempfolderpath, timestamp); } |
102 | 92 | |
103 | - BackupPackageManagerCore.CreatePackageFile(bp.Xml_PackageName, tempfolderpath, vars, destinationfilename,destinationfolder, bp.Xml_CreateExe, bp.Xml_SourceIncludeFilenameMaskList); | |
93 | + BackupPackageManagerCore.CreatePackageFile(bp.Xml_PackageName, tempfolderpath, destinationfilename,destinationfolder, bp.Xml_CreateExe, bp.Xml_SourceIncludeFilenameMaskList); | |
104 | 94 | if (Directory.Exists(tempfolderpath)) { Directory.Delete(tempfolderpath,true); } |
105 | 95 | } |
106 | 96 | catch (Exception ex) { ColorConsole.WriteLine(ex.MessageNested(), ConsoleColor.Red); } |
... | ... | @@ -131,7 +121,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
131 | 121 | #region private method: DisplayBackupPackageInfo |
132 | 122 | private static object DisplayBackupPackageInfo(object obj, int lineix) |
133 | 123 | { |
134 | - BackupPackage bp = ((obj as Menu.ExecutorParameter).Parameters as BackupPackage); | |
124 | + BackupPackage xbp = ((obj as Menu.ExecutorParameter).Parameters as BackupPackage); | |
125 | + BackupPackage bp = (new BackupPackage(xbp)).ResolveNames(null); | |
135 | 126 | if (lineix == 0) |
136 | 127 | { |
137 | 128 | ColorConsole.Write($"{bp.Xml_PackageName}", ConsoleColor.Black, ConsoleColor.White); |
... | ... | @@ -185,7 +176,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
185 | 176 | /// <param name="bf">BackupFolder descriptor</param> |
186 | 177 | /// <param name="destinationfolderpath">the target directory path where the zip file is created</param> |
187 | 178 | /// <param name="vars">filename substitution variables</param> |
188 | - public static void FolderZipBackup(BackupPackage.BackupFolder bf, string destinationfolderpath, Dictionary<string, string> vars) | |
179 | + public static void FolderZipBackup(BackupPackage.BackupFolder bf, string destinationfolderpath) | |
189 | 180 | { |
190 | 181 | string foldertobackuppath = bf.Xml_Path; |
191 | 182 | |
... | ... | @@ -198,8 +189,6 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
198 | 189 | var destinationext = Path.GetExtension(destinationbackupfile); if (string.IsNullOrWhiteSpace(destinationext)) { destinationext = ".zip"; } |
199 | 190 | destinationbackupfile = Path.Combine(destinationfolderpath, destinationfile+destinationext); |
200 | 191 | |
201 | - destinationbackupfile = VRH.Common.StringConstructor.ResolveConstructorR(vars, destinationbackupfile, "{}@@"); | |
202 | - | |
203 | 192 | if (File.Exists(destinationbackupfile)) { File.Delete(destinationbackupfile); } |
204 | 193 | |
205 | 194 | if (!Path.IsPathRooted(foldertobackuppath)) { foldertobackuppath = Path.Combine(Directory.GetCurrentDirectory(), foldertobackuppath); } |
... | ... | @@ -216,7 +205,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
216 | 205 | /// <param name="vars">substitution vars</param> |
217 | 206 | /// <param name="createexe">if true, exe self extractor will be created, otherwise zip file; the extension of the package file is zip or exe</param> |
218 | 207 | /// <param name="sourceincludefilenamemaskList">comma separated list of masks for the files to include (NOT regex! "old fashioned" masking characters, like ?/* can be used)</param> |
219 | - public static void CreatePackageFile(string packagename,string sourcedirectorypath, Dictionary<string,string> vars,string destinationfilename =null,string destinationfolder=null,bool createexe=true,string sourceincludefilenamemaskList=null) | |
208 | + public static void CreatePackageFile(string packagename,string sourcedirectorypath, string destinationfilename =null,string destinationfolder=null,bool createexe=true,string sourceincludefilenamemaskList=null) | |
220 | 209 | { |
221 | 210 | string[] sourceinclfnamemasklist = sourceincludefilenamemaskList.Split(','); |
222 | 211 | bool createselfextractor = createexe; |
... | ... | @@ -228,7 +217,6 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
228 | 217 | destinationfilename = destinationfilename??Path.GetFileNameWithoutExtension(sourcedirectorypath); |
229 | 218 | |
230 | 219 | string package___filepath = Path.Combine(destinationfolder, destinationfilename); |
231 | - package___filepath=VRH.Common.StringConstructor.ResolveConstructorR(vars, package___filepath, "{}@@"); | |
232 | 220 | |
233 | 221 | string packageEXEfilepath = package___filepath + ".exe"; |
234 | 222 | string packageZIPfilepath = package___filepath + ".zip"; |
... | ... | @@ -571,6 +559,28 @@ namespace Vrh.Log4Pro.MaintenanceConsole.BackupPackageManagerNS |
571 | 559 | } |
572 | 560 | #endregion BackupSQLDataBase class |
573 | 561 | |
562 | + #region ResolveNames | |
563 | + public BackupPackage ResolveNames(DateTime? timestamp) | |
564 | + { | |
565 | + var rbp = new BackupPackage(this); | |
566 | + var packagets = timestamp.HasValue ? timestamp.Value.ToString("yyyyMMddHHmmss") : "yyyyMMddHHmmss"; | |
567 | + var vars = new Dictionary<string, string>(); | |
568 | + vars.Add("PACKAGETS", packagets); | |
569 | + vars.Add("PACKAGEKEY", rbp.Xml_Key); | |
570 | + rbp.Xml_PackageName = StringConstructor.ResolveConstructorR(vars, rbp.Xml_PackageName, "{}@@"); | |
571 | + vars.Add("PACKAGENAME", rbp.Xml_PackageName); | |
572 | + rbp.Xml_Description = StringConstructor.ResolveConstructorR(vars, rbp.Xml_Description, "{}@@"); | |
573 | + foreach (var bf in rbp.Xml_BackupFolderList) | |
574 | + { | |
575 | + bf.Xml_BackupToFile = StringConstructor.ResolveConstructorR(vars, bf.Xml_BackupToFile, "{}@@"); | |
576 | + bf.Xml_Description = StringConstructor.ResolveConstructorR(vars, bf.Xml_Description, "{}@@"); | |
577 | + bf.Xml_Path = StringConstructor.ResolveConstructorR(vars, bf.Xml_Path, "{}@@"); | |
578 | + } | |
579 | + rbp.Xml_PackageFilePath = StringConstructor.ResolveConstructorR(vars, rbp.Xml_PackageFilePath, "{}@@"); | |
580 | + rbp.Xml_TempDirectoryPath = StringConstructor.ResolveConstructorR(vars, rbp.Xml_TempDirectoryPath, "{}@@"); | |
581 | + return rbp; | |
582 | + } | |
583 | + #endregion ResolveNames | |
574 | 584 | } |
575 | 585 | #endregion BackupPackage class |
576 | 586 | } | ... | ... |
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
... | ... | @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; |
32 | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | 33 | // by using the '*' as shown below: |
34 | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.6.2.0")] | |
36 | -[assembly: AssemblyFileVersion("1.6.2.0")] | |
35 | +[assembly: AssemblyVersion("1.6.3.0")] | |
36 | +[assembly: AssemblyFileVersion("1.6.3.0")] | ... | ... |