Fix: always update LastUpdate date

This commit is contained in:
Paddy Xu committed 2017-01-15 16:14:25 +02:00
1 parent 974af7aecc
commit 0fdb507072
2 files changed
+8 -8

No files matched your search

+5 -4
View File
@@ -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;
+3 -4
View File
@@ -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);
}