@@ -27,7 +27,8 @@ public static class UpdateManager
2727 } ;
2828 public static string PathPrefix = LauncherKitUpdateUrls . First ( ) ;
2929 public static string AppDataPath = Environment . ExpandEnvironmentVariables ( @"%appdata%\Spore ModAPI Launcher" ) ;
30- public static string UpdaterDateTimePath = Path . Combine ( AppDataPath , "lastUpdateDateTime.info" ) ;
30+ public static string LastUpdateCheckTimePath = Path . Combine ( AppDataPath , "lastUpdateCheckTime.info" ) ;
31+ public static string LastUpdateDateTimeFormat = "yyyy-MM-dd HH:mm" ;
3132 public static string UpdateInfoDestPath = Path . Combine ( AppDataPath , "update.info" ) ;
3233 public static string UpdaterDestPath = Path . Combine ( AppDataPath , "updater.exe" ) ;
3334 public static string UpdaterBlockPath = Path . Combine ( AppDataPath , "noUpdateCheck.info" ) ;
@@ -115,23 +116,23 @@ public static void CheckForUpdates()
115116 if ( File . Exists ( UpdaterDestPath ) )
116117 File . Delete ( UpdaterDestPath ) ;
117118
118- if ( File . Exists ( UpdaterDateTimePath ) )
119+ if ( File . Exists ( LastUpdateCheckTimePath ) )
119120 {
120121 try
121122 {
122- string lastUpdateDateTimeString = File . ReadAllText ( UpdaterDateTimePath ) ;
123- DateTime lastUpdateDateTime = DateTime . ParseExact ( lastUpdateDateTimeString ,
124- "yyyy-MM-dd HH:mm" ,
123+ string lastUpdateCheckDateTimeString = File . ReadAllText ( LastUpdateCheckTimePath ) ;
124+ DateTime lastUpdateCheckDateTime = DateTime . ParseExact ( lastUpdateCheckDateTimeString ,
125+ LastUpdateDateTimeFormat ,
125126 CultureInfo . InvariantCulture ) ;
126127
127- if ( ( DateTime . Now - lastUpdateDateTime ) . TotalHours < 1 )
128+ if ( ( DateTime . Now - lastUpdateCheckDateTime ) . TotalHours < 1 )
128129 {
129130 return ;
130131 }
131132 }
132133 catch ( Exception )
133134 {
134- File . Delete ( UpdaterDateTimePath ) ;
135+ File . Delete ( LastUpdateCheckTimePath ) ;
135136 }
136137 }
137138
@@ -284,7 +285,7 @@ public static void CheckForUpdates()
284285 }
285286 }
286287
287- File . WriteAllText ( UpdaterDateTimePath , DateTime . Now . ToString ( "yyyy-MM-dd HH:mm" ) ) ;
288+ File . WriteAllText ( LastUpdateCheckTimePath , DateTime . Now . ToString ( LastUpdateDateTimeFormat ) ) ;
288289 }
289290 catch ( Exception ex )
290291 {
0 commit comments