diff --git a/LEUpdater/ApplicationUpdater.cs b/LEUpdater/ApplicationUpdater.cs index 7bafde5..f39bf7c 100644 --- a/LEUpdater/ApplicationUpdater.cs +++ b/LEUpdater/ApplicationUpdater.cs @@ -35,13 +35,14 @@ namespace LEUpdater private static void ProcessUpdate(XmlDocument xmlContent, NotifyIcon notifyIcon) { var newVer = xmlContent.SelectSingleNode(@"/VersionInfo/Version/text()").Value; - - if (CompareVersion(GlobalHelper.GetLEVersion(), newVer)) + var crtVer = GlobalHelper.GetLEVersion(); + + GlobalHelper.SetLastUpdate(int.Parse(DateTime.Now.ToString("yyyyMMdd"))); + + if (CompareVersion(crtVer, newVer)) { try { - GlobalHelper.SetLastUpdate(int.Parse(DateTime.Now.ToString("yyyyMMdd"))); - var version = xmlContent.SelectSingleNode(@"/VersionInfo/Version/text()").Value; var date = xmlContent.SelectSingleNode(@"/VersionInfo/Date/text()").Value; url = xmlContent.SelectSingleNode(@"/VersionInfo/Url/text()").Value; diff --git a/LEUpdater/Program.cs b/LEUpdater/Program.cs index efad885..be8879e 100644 --- a/LEUpdater/Program.cs +++ b/LEUpdater/Program.cs @@ -10,15 +10,14 @@ namespace LEUpdater internal static class Program { private static readonly NotifyIcon _notifyIcon = new NotifyIcon {Icon = Resources.icon}; - private static bool byForce; + private static bool auto; private static void Main(string[] args) { - if (args.Length == 0) - byForce = true; + auto = args.Length != 0; // Check new version every week. - if (!byForce && int.Parse(DateTime.Now.ToString("yyyyMMdd")) - GlobalHelper.GetLastUpdate() < 7) + if (auto && int.Parse(DateTime.Now.ToString("yyyyMMdd")) - GlobalHelper.GetLastUpdate() < 7) { Environment.Exit(0); }