diff --git a/components/lazautoupdate/latest_stable/lazupdate.lpk b/components/lazautoupdate/latest_stable/lazupdate.lpk index 11747b239..a5b55958d 100644 --- a/components/lazautoupdate/latest_stable/lazupdate.lpk +++ b/components/lazautoupdate/latest_stable/lazupdate.lpk @@ -60,7 +60,7 @@ More information in the Wiki Home Page http://wiki.freepascal.org/LazAutoUpdater along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. "/> - + diff --git a/components/lazautoupdate/latest_stable/testapp/testapp.lps b/components/lazautoupdate/latest_stable/testapp/testapp.lps index 80ba388b9..06b2c1fca 100644 --- a/components/lazautoupdate/latest_stable/testapp/testapp.lps +++ b/components/lazautoupdate/latest_stable/testapp/testapp.lps @@ -4,7 +4,7 @@ - + @@ -28,12 +28,11 @@ - + - - + + - @@ -164,6 +163,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi b/components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi index 60e2fcf18..010061774 100644 --- a/components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi +++ b/components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi @@ -60,7 +60,11 @@ - + + + + @@ -133,6 +137,9 @@ + + + diff --git a/components/lazautoupdate/latest_stable/trayicon/trayupdater.lps b/components/lazautoupdate/latest_stable/trayicon/trayupdater.lps index 0bbbb1559..c98753c2a 100644 --- a/components/lazautoupdate/latest_stable/trayicon/trayupdater.lps +++ b/components/lazautoupdate/latest_stable/trayicon/trayupdater.lps @@ -3,16 +3,16 @@ - - + + - - + + @@ -21,13 +21,14 @@ + - - + + - + - + @@ -38,11 +39,11 @@ - + - - - + + + @@ -215,141 +216,162 @@ - + - - + - - - - + + + + + + + + + + + + + + + + + + + - + + + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + + + + + diff --git a/components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm b/components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm index 7d7b2c07e..e8911427f 100644 --- a/components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm +++ b/components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm @@ -1,7 +1,7 @@ object configform: Tconfigform - Left = 1101 + Left = 1144 Height = 495 - Top = 511 + Top = 189 Width = 604 BorderIcons = [biSystemMenu] BorderStyle = bsSingle diff --git a/components/lazautoupdate/latest_stable/trayicon/umainform.pas b/components/lazautoupdate/latest_stable/trayicon/umainform.pas index d822ae19d..c226b91e0 100644 --- a/components/lazautoupdate/latest_stable/trayicon/umainform.pas +++ b/components/lazautoupdate/latest_stable/trayicon/umainform.pas @@ -29,7 +29,7 @@ and optionally auto-updates any apps for which it has a profile It uses an array of custom component LongTimers in order to update a number of different apps on different schedules It uses a config file LAUTray.ini to keep track. This file -is automatically generated by UpdatePack and impoted by this app when first run. +is automatically generated by UpdatePack and imported by this app when first run. VERSION HISTORY @@ -37,6 +37,8 @@ VERSION HISTORY 0.1.12: Updated to Laz 1.7 fpc 3.1.1 0.1.12: Updated lpr to correctly hide the mainform on startup 0.1.12: Commit to svn +0.1.13: Updated January 2017 + Ini filename uses C_PFX } {$mode objfpc}{$H+} @@ -68,7 +70,7 @@ end; { Tmainform } Tmainform = class(TForm) - EventLog1: TEventLog; + Logger: TEventLog; idleReminder: TIdleTimer; LazAutoUpdate1: TLazAutoUpdate; mnu_About: TMenuItem; @@ -135,7 +137,7 @@ Const C_BITNESS = '64'; {$ENDIF} C_PFX = C_OS + C_BITNESS; -C_LAUTRayINI = 'lauimport' + C_PFX + '.ini'; +C_LAUTRayINI = 'lauimport.ini'; C_INIFilename = 'trayupdater' + C_PFX + '.ini'; implementation @@ -181,7 +183,7 @@ begin INI.UpdateFile; except if DebugMode then - EventLog1.Error('Failed to write AppRecArray to %s', [INI.Filename]) + Logger.Error('Failed to write AppRecArray to %s', [INI.Filename]) end; end; end; @@ -199,7 +201,7 @@ begin iTag := TLongTimer(Sender).Tag; end; if DebugMode then - EventLog1.Log('Timer for %s fired', [AppRecArray[iTag].AppPrettyName]); + Logger.Log('Timer for %s fired', [AppRecArray[iTag].AppPrettyName]); TrayIcon1.BalloonHint := Format('Checking %s for updates', [AppRecArray[iTag].AppPrettyName]); TrayIcon1.ShowBalloonHint; @@ -341,7 +343,7 @@ begin end; except if DebugMode then - EventLog1.Error('Failed to read AppRecArray from %s', [INI.Filename]) + Logger.Error('Failed to read AppRecArray from %s', [INI.Filename]) end; finally FreeAndNil(SectionStringList); @@ -443,7 +445,7 @@ begin if (Result = True) then begin if DebugMode then - EventLog1.Log('%s: Imported %s into %s', + Logger.Log('%s: Imported %s into %s', [Application.Title, szImportINIPath, INI.Filename]); DoReadINIIntoAppRecArray; end; @@ -467,9 +469,9 @@ begin mainform.ShowInTaskBar := stNever; // Log a successful startup if DebugMode then - EventLog1.Active := True; + Logger.Active := True; if DebugMode then - EventLog1.Log('%s version %s started OK', + Logger.Log('%s version %s started OK', [Application.Title, LazAutoUpdate1.AppVersion]); end; end; @@ -487,26 +489,26 @@ begin if FileExists(szImportINIPath) then begin if DebugMode then - EventLog1.Log('%s: Import file %s discovered', + Logger.Log('%s: Import file %s discovered', [Application.Title, szImportINIPath]); if ImportINIFile then begin if DebugMode then - EventLog1.Log('%s: Import file %s successfully imported', + Logger.Log('%s: Import file %s successfully imported', [Application.Title, szImportINIPath]); DeleteFileUTF8(szImportINIPath); end else if DebugMode then - EventLog1.Error('%s: Failed to import file %s', + Logger.Error('%s: Failed to import file %s', [Application.Title, szImportINIPath]); end; end; procedure Tmainform.LazAutoUpdate1DebugEvent(Sender: TObject; WhereAt, Message: string); begin - if ((EventLog1.Active) and (DebugMode = True)) then - EventLog1.Log('LazAutoUpdate:%s Message:%s', [WhereAt, Message]); + if ((Logger.Active) and (DebugMode = True)) then + Logger.Log('LazAutoUpdate:%s Message:%s', [WhereAt, Message]); end; procedure Tmainform.mnu_AboutClick(Sender: TObject); @@ -558,7 +560,7 @@ begin Reg.WriteString(Application.Title, ParamStr(0)); INI.WriteBool('ProgramInfo', 'RunAtStartUp', True); if DebugMode then - EventLog1.Log('Run at OS startup Activated'); + Logger.Log('Run at OS startup Activated'); MessageDlg(Application.Title, 'Run at OS startup activated OK', mtInformation, [mbOK], 0); end @@ -567,7 +569,7 @@ begin Reg.DeleteValue(Application.Title); INI.WriteBool('ProgramInfo', 'RunAtStartUp', False); if DebugMode then - EventLog1.Log('Run at OS startup Deactivated'); + Logger.Log('Run at OS startup Deactivated'); MessageDlg(Application.Title, 'Run at OS startup deactivated OK', mtInformation, [mbOK], 0); end; @@ -589,7 +591,7 @@ begin if LazAutoUpdate1.DownloadInprogress then begin if DebugMode then - EventLog1.Error( + Logger.Error( 'Tried to update whilst download in progress. Exiting CheckAndUpdate routine'); Exit; end; @@ -642,7 +644,7 @@ begin //Debugging line if DebugMode then - EventLog1.Active := True; + Logger.Active := True; ShowMessageFmt('Update %s', [AppRecArray[iCurrentRecIndex].AppPrettyName]); CheckAndUpdate(iCurrentRecIndex); @@ -663,6 +665,7 @@ begin DebugMode := True else DebugMode := False; + {$IFDEF DEBUGMODE}DebugMode := True;{$ENDIF} // Initialise the App's main INI file Try INI := TIniFile.Create(GetAppConfigDirUTF8(False) + C_INIFilename); @@ -683,24 +686,26 @@ begin PopulateOwnProfile; // Start up a system Event Log if DebugMode then - EventLog1.LogType := ltFile; + Logger.LogType := ltFile; if DebugMode then - EventLog1.Filename := ExtractFileNameWithoutExt(ParamStr(0)) + '.log'; + Logger.Filename := ExtractFileNameWithoutExt(ParamStr(0)) + '.log'; // New logfile every time if DebugMode then - if FileExistsUTF8(EventLog1.Filename) then - DeleteFile(EventLog1.Filename); + if FileExistsUTF8(Logger.Filename) then + DeleteFile(Logger.Filename); if DebugMode then - EventLog1.AppendContent := True; + Logger.AppendContent := True; if DebugMode then - EventLog1.DefaultEventType := etInfo; + Logger.DefaultEventType := etInfo; if DebugMode then - EventLog1.RaiseExceptionOnError := False; - // EventLog1.Identification := Application.Title; + Logger.RaiseExceptionOnError := False; + // Logger.Identification := Application.Title; // Fetch the location of any trayicon INI on the users system szImportINIPath := GetAppConfigDirUTF8(False, True); - szImportINIPath := AnsiReplaceText(szImportINIPath, Application.Title, 'updatehm'); + szImportINIPath := AnsiReplaceText(szImportINIPath, Application.Title, 'updatehm' + C_PFX); szImportINIPath := AppendPathDelim(szImportINIPath) + C_LAUTRayINI; + if DebugMode then + Logger.Debug('szImportINIPath=' + szImportINIPath); // Initialise the AppRecArray DoReadINIIntoAppRecArray; // Use last saved Profile at startup @@ -735,9 +740,9 @@ begin else begin if DebugMode then - EventLog1.Log('User closed application'); + Logger.Log('User closed application'); if DebugMode then - EventLog1.Active := False; + Logger.Active := False; CanClose := True; end; if CanClose then diff --git a/components/lazautoupdate/latest_stable/ulazautoupdate.pas b/components/lazautoupdate/latest_stable/ulazautoupdate.pas index 0dc8db1ab..9f88b5388 100644 --- a/components/lazautoupdate/latest_stable/ulazautoupdate.pas +++ b/components/lazautoupdate/latest_stable/ulazautoupdate.pas @@ -135,9 +135,10 @@ const V0.2.6: Enabled GitHub tags (GitHubBranchOrTag property) V0.2.7: Updates Tray Updater routines V0.2.8: Changed constants C_UPDATEHMNAME and C_LAUUPDATENAME - V0.2.9: ?? + V0.2.9: Added CreateLocalLauImportFile in UpdateToNewVersion + V0.3.0: ?? } - C_TLazAutoUpdateComponentVersion = '0.2.8'; + C_TLazAutoUpdateComponentVersion = '0.2.9'; C_TThreadedDownloadComponentVersion = '0.0.3'; { V0.0.1: Initial alpha @@ -148,7 +149,7 @@ const C_UpdatesFolder = 'updates'; // User can change // Don't change these without some thought.. - C_LAUTRayINI = 'lauimport.ini'; + C_LAUTRayINI = 'lauimport.ini'; // Name syncronises with TrayUpdater App C_WhatsNewFilename = 'whatsnew.txt'; C_INISection = 'versions'; C_GUIEntry = 'GUI'; @@ -308,8 +309,6 @@ type procedure SetDebugMode(AValue: boolean); function GetThreadDownloadReturnCode: integer; function IsOnlineVersionNewer(const sznewINIPath: string): boolean; - // No longer needed - // function VersionStringToNumber(AVersionString: string): integer; function DoSilentUpdate: boolean; protected @@ -323,7 +322,7 @@ type function NewVersionAvailable: boolean; // Returns TRUE if successful function DownloadNewVersion: boolean; - // Returns TRUE if successful + // Returns TRUE if successful. Also creates a C_LAUTRayINI file in the GetAppConfig folder for TrayUpdater function UpdateToNewVersion: boolean; // Put in form.activate. Shows only if in ProgramDirectory then deletes it. Exits otherwise procedure ShowWhatsNewIfAvailable; @@ -338,7 +337,7 @@ type // Resets AppVersion property to the ownling application version procedure ResetAppVersion; - // Create a new lauimport.ini in the App folder + // Create a new lauimport.ini in GetAppConfigDirUTF8 folder function CreateLocalLauImportFile: boolean; // If lauimport.ini is found in the app folder, move it to the AppData folder procedure RelocateLauImportFile; @@ -767,30 +766,6 @@ begin Result := AppIsRunning(ExeName); end; -{ -// Obselete. fileinfo functions used instead -function TLazAutoUpdate.VersionStringToNumber(AVersionString: string): integer; - // Converts 'n.n.n.n' into an integer -var - s: string; - i: integer; -begin - Result := 0; - // Fetch the 4 (or less) version elements and make into an Integer - s := ExtractDelimited(1, AVersionString, ['.']); - if TryStrToInt(s, i) then - Result := Result + (i * 10000); - s := ExtractDelimited(2, AVersionString, ['.']); - if TryStrToInt(s, i) then - Result := Result + (i * 1000); - s := ExtractDelimited(3, AVersionString, ['.']); - if TryStrToInt(s, i) then - Result := Result + (i * 100); - s := ExtractDelimited(4, AVersionString, ['.']); - if TryStrToInt(s, i) then - Result := Result + i; -end; -} procedure TLazAutoUpdate.ResetAppVersion; begin fApplicationVersionString := GetFileVersion; @@ -1461,6 +1436,7 @@ begin fOndebugEvent(Self, 'CreateLocalLauImportFile', 'CreateLocalLauImportFile called'); if FileExistsUTF8(ProgramDirectory + C_LAUTRayINI) then begin + RelocateLauImportFile; Result := True; Exit; end; @@ -2024,7 +2000,7 @@ begin if fFireDebugEvent then fOndebugEvent(Self, 'UpdateToNewVersion', 'RunAsAdmin failed'); end; - + CreateLocalLauImportFile; // Creates a new import file in GetAppConfigDirUTF8 // Check for C_WhatsNewFilename in the app directory in a LOOP if fFireDebugEvent then fOndebugEvent(Self, 'UpdateToNewVersion', @@ -2065,7 +2041,7 @@ begin 'Error %d: Run this application in Administrator mode or turn off UAC', [GetLastOSError]); end; - + CreateLocalLauImportFile; // Creates a new import file in GetAppConfigDirUTF8 // Check for C_WhatsNewFilename in the app directory in a LOOP if fFireDebugEvent then fOndebugEvent(Self, 'UpdateToNewVersion', diff --git a/components/lazautoupdate/latest_stable/updatepack/umainform.lfm b/components/lazautoupdate/latest_stable/updatepack/umainform.lfm index 91083e036..5a1cee757 100644 --- a/components/lazautoupdate/latest_stable/updatepack/umainform.lfm +++ b/components/lazautoupdate/latest_stable/updatepack/umainform.lfm @@ -1,7 +1,7 @@ object mainform: Tmainform - Left = 715 + Left = 1335 Height = 481 - Top = 197 + Top = 384 Width = 587 AllowDropFiles = True BorderIcons = [biSystemMenu, biMinimize] diff --git a/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip b/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip index 9a1974875..ba336da29 100644 Binary files a/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip and b/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip differ diff --git a/components/lazautoupdate/latest_stable/updates/update_lazautoupdate.json b/components/lazautoupdate/latest_stable/updates/update_lazautoupdate.json index 9852d0989..81334b0fe 100644 --- a/components/lazautoupdate/latest_stable/updates/update_lazautoupdate.json +++ b/components/lazautoupdate/latest_stable/updates/update_lazautoupdate.json @@ -9,7 +9,7 @@ "ForceNotify" : false, "InternalVersion" : 1, "Name" : "lazupdate.lpk", - "Version" : "0.2.8.0" + "Version" : "0.2.9.0" } ] }