using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Muchinfo.Client.Update.UpdateListFactory { internal class Program { private static void Main(string[] args) { try { string basePath = AppDomain.CurrentDomain.BaseDirectory; Console.Write("请输入主程序名称:"); var info = new UpdateInfo(); // info.StartAppName = "Muchinfo.ClientTerminal.exe"; var tempStr = Console.ReadLine(); info.StartAppName = tempStr; Console.Write("请输资源文件夹:"); tempStr = Console.ReadLine(); info.ResourceDir = tempStr; Console.Write("是否使用压缩文件升级 “Y/N”:"); string code = Console.ReadLine(); info.LastModifyTime = DateTime.Now; info.ReStart = true; if (code != null && "Y".Equals(code.ToUpper())) { info.IsCompress = true; } FilesHelper.SearchfileCompress(info, basePath); var fileVer = FileVersionInfo.GetVersionInfo(Path.Combine(basePath, info.StartAppName)); info.Version = fileVer.FileVersion; FilesHelper.SaveUpdateXml(info, AppDomain.CurrentDomain.BaseDirectory + info.GetType().Name + ".xml"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } Console.WriteLine("操作完成!"); Console.ReadLine(); } } }