mirror of
https://github.com/xupefei/Locale-Emulator
synced 2026-11-26 08:57:53 +08:00
Fix: always update LastUpdate date
This commit is contained in:
1 parent
974af7aecc
commit
0fdb507072
2 files changed
+8
-8
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user