diff --git a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.en.po b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.en.po
index d4ad8f7b9..3e93f7005 100644
--- a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.en.po
+++ b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.en.po
@@ -87,10 +87,6 @@ msgstr "Please wait. Processing...."
msgid "Property SFProjectName is empty!"
msgstr "Property SFProjectName is empty!"
-#: ulazautoupdate.c_sourceforgedownload
-msgid "SourceForge download"
-msgstr "SourceForge download"
-
#: ulazautoupdate.c_takingtoolong
msgid "Check is taking too long (bad/slow internet connection?). Try again later?"
msgstr "Check is taking too long (bad/slow internet connection?). Try again later?"
@@ -164,3 +160,4 @@ msgstr "This application is up-to-date"
#: ulazautoupdate.rsvewversionsh
msgid "Vew version %s has downloaded. Click OK to update now."
msgstr "Vew version %s has downloaded. Click OK to update now."
+
diff --git a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.es.po b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.es.po
index df1b1a32e..99e40cd19 100644
--- a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.es.po
+++ b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.es.po
@@ -87,10 +87,6 @@ msgstr "Espera. Procesamiento de..."
msgid "Property SFProjectName is empty!"
msgstr "¡Propiedad SFProjectName está vacía!"
-#: ulazautoupdate.c_sourceforgedownload
-msgid "SourceForge download"
-msgstr "Descargar de SourceForge"
-
#: ulazautoupdate.c_takingtoolong
msgid "Check is taking too long (bad/slow internet connection?). Try again later?"
msgstr "Cheque tarda demasiado (mala/lenta conexión a internet?). ¿Inténtalo más tarde?"
@@ -164,3 +160,4 @@ msgstr "Esta aplicación es actualizada"
#: ulazautoupdate.rsvewversionsh
msgid "Vew version %s has downloaded. Click OK to update now."
msgstr "Ver versión %s se ha descargado. Haga clic en Aceptar para actualizar ahora."
+
diff --git a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.po b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.po
index 8b3d913d9..e015a8bbf 100644
--- a/components/lazautoupdate/latest_stable/locale/ulazautoupdate.po
+++ b/components/lazautoupdate/latest_stable/locale/ulazautoupdate.po
@@ -77,10 +77,6 @@ msgstr ""
msgid "Property SFProjectName is empty!"
msgstr ""
-#: ulazautoupdate.c_sourceforgedownload
-msgid "SourceForge download"
-msgstr ""
-
#: ulazautoupdate.c_takingtoolong
msgid "Check is taking too long (bad/slow internet connection?). Try again later?"
msgstr ""
diff --git a/components/lazautoupdate/latest_stable/testapp/testapp.lps b/components/lazautoupdate/latest_stable/testapp/testapp.lps
index d0415f1ad..f469693cb 100644
--- a/components/lazautoupdate/latest_stable/testapp/testapp.lps
+++ b/components/lazautoupdate/latest_stable/testapp/testapp.lps
@@ -10,7 +10,7 @@
-
+
@@ -19,10 +19,9 @@
-
-
-
-
+
+
+
@@ -33,7 +32,7 @@
-
+
@@ -45,14 +44,15 @@
-
-
-
+
+
+
-
-
-
+
+
+
+
@@ -145,8 +145,8 @@
-
-
+
+
@@ -162,129 +162,126 @@
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/components/lazautoupdate/latest_stable/ulazautoupdate.pas b/components/lazautoupdate/latest_stable/ulazautoupdate.pas
index 2271c16be..4356597dd 100644
--- a/components/lazautoupdate/latest_stable/ulazautoupdate.pas
+++ b/components/lazautoupdate/latest_stable/ulazautoupdate.pas
@@ -1,12 +1,26 @@
unit ulazautoupdate;
{
+ Summary and Copyright
+ =====================
LazAutoUpdate (c)2015 Gordon Bamber (minesadorada@charcodelvalle.com)
+ A Lazarus Visual component that enables an update service for Executables.
+ Web References
+ ==============
+ Wiki Page: http://wiki.freepascal.org/LazAutoUpdater
+ Forum thread: http://forum.lazarus.freepascal.org/index.php/topic,25444.0.html
+ SourceForge project: https://sourceforge.net/projects/lazautoupdate/
+
+ Other Credits
+ =============
VersionSupport: Mike Thompson - mike.cornflake@gmail.com
- Added to and modified by minesadorada@charcodelvalle.com
- Windows admin function: Vincent at freepascal forum
+ (added to and modified by minesadorada@charcodelvalle.com)
+ Windows admin RunAs function: Vincent at freepascal forum
+ THpttpClient code: GetMem at freepascal forum
+ License
+ =======
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
@@ -31,6 +45,12 @@ unit ulazautoupdate;
You should have received a copy of the GNU Library General Public License
along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Version Control and History
+ ===========================
+ Via SVN: https://svn.code.sf.net/p/lazarus-ccr/svn/components/lazautoupdate/
+ Via SourceForge: https://sourceforge.net/projects/lazautoupdate/
+ Also see 'Version History' below
}
{$mode objfpc}{$H+}
@@ -62,6 +82,8 @@ const
C_LAUTRayINI = 'lauimport.ini';
{
+ Version History
+ ===============
V0.0.1: Initial alpha
V0.0.2: Added auOther properties
V0.0.3: Limit to download time
@@ -130,21 +152,31 @@ const
C_GUIEntry = 'GUI';
C_ModuleEntry = 'Module';
C_MASTER = 'master';
+ // Compiler mode directives
+ // (note: nothing for Mac/Darwin)
{$IFDEF WINDOWS}
- {$IFDEF CPU32}C_UPDATER = 'updatehmwin32.exe';
- C_LOCALUPDATER = 'lauupdatewin32.exe';{$ENDIF}
- {$IFDEF CPU64}C_UPDATER = 'updatehmwin64.exe';
- C_LOCALUPDATER = 'lauupdatewin64.exe';{$ENDIF}
- // Windows Constants
- C_RUNONCEKEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce';
- C_RUNKEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run';
+ {$IFDEF CPU32}
+ C_UPDATER = 'updatehmwin32.exe';
+ C_LOCALUPDATER = 'lauupdatewin32.exe';
+ {$ENDIF}
+ {$IFDEF CPU64}
+ C_UPDATER = 'updatehmwin64.exe';
+ C_LOCALUPDATER = 'lauupdatewin64.exe';
+ {$ENDIF}
{$ENDIF}
{$IFDEF LINUX}
- {$IFDEF CPU32}C_UPDATER = 'updatehmlinux32';
- C_LOCALUPDATER = 'lauupdatelinux32';{$ENDIF}
- {$IFDEF CPU64}C_UPDATER = 'updatehmlinux64';
- C_LOCALUPDATER = 'lauupdatelinux64';{$ENDIF}
+ {$IFDEF CPU32}
+ C_UPDATER = 'updatehmlinux32';
+ C_LOCALUPDATER = 'lauupdatelinux32';
+ {$ENDIF}
+ {$IFDEF CPU64}
+ C_UPDATER = 'updatehmlinux64';
+ C_LOCALUPDATER = 'lauupdatelinux64';
+ {$ENDIF}
{$ENDIF}
+ // Windows Constants (unused)
+ C_RUNONCEKEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce';
+ C_RUNKEY = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run';
resourcestring
C_ComponentPrettyName = 'Lazarus Auto-Update Component';
@@ -174,7 +206,7 @@ resourcestring
C_FolderMissing = 'Missing %s folder';
C_NotApplicable = '';
C_ThreadStarted = 'Thread Started';
- C_SourceForgeDownload = 'SourceForge download';
+ // C_SourceForgeDownload = 'SourceForge download';
C_CannotLoadFromRemote = 'Cannot load document from remote server';
C_DownloadIsEmpty = 'Downloaded document is empty.';
C_DownloadFailedErrorCode = 'Download failed with error code ';
@@ -464,6 +496,11 @@ type
fLastError: string; // Propagated to TThreadedDownload
constructor Create(URL, FileName: string);
procedure Execute; override; // Starts thread
+ // Todo:
+ {
+ procedure GetDownloadSize;
+ procedure ShowProgress;
+ }
end;
diff --git a/components/lazautoupdate/latest_stable/updatehmsource/updatehm.lpr b/components/lazautoupdate/latest_stable/updatehmsource/updatehm.lpr
index 5cd7026c9..c094bc499 100644
--- a/components/lazautoupdate/latest_stable/updatehmsource/updatehm.lpr
+++ b/components/lazautoupdate/latest_stable/updatehmsource/updatehm.lpr
@@ -1,12 +1,13 @@
program updatehm;
+
{$ifdef Linux}
{$ifdef FPC_CROSSCOMPILING}
{$ifdef CPUARM}
- //if GUI, then uncomment
+//if GUI, then uncomment
- //{$linklib GLESv2}
+//{$linklib GLESv2}
{$endif}
@@ -56,7 +57,9 @@ program updatehm;
uses
SysUtils,
- LazUTF8,LazFileUtils,FileUtil,
+ LazUTF8,
+ LazFileUtils,
+ FileUtil,
process,
eventlog,
DateUtils,
@@ -119,7 +122,7 @@ var
begin
if ParamCount = 0 then
- begin
+ begin
WriteLn('==========================================================');
Writeln(LineEnding + '==== updatehm v' + C_Version +
' - an lazautoupdate application ====');
@@ -128,10 +131,10 @@ begin
WriteLn('Press any key to continue');
ReadLn;
Halt;
- end;
+ end;
if (ParamStrUTF8(1) = '-h') or (ParamStrUTF8(1) = '/h') then
- begin
+ begin
WriteLn('==========================================================');
Writeln('Normal usage: updatehm exename.exe [updatesfoldername] [whatnewfilename] [exePrettyName] [copytree]');
WriteLn('- where exename.exe is a single application to be updated');
@@ -142,14 +145,20 @@ begin
WriteLn('Press any key to continue');
ReadLn;
Halt;
- end;
+ end;
Logger := TEventLog.Create(nil);
- Logger.LogType := ltFile;
- Logger.FileName := C_LogFileName;
- if FileExistsUTF8(C_LogFileName) then
- DeleteFile(C_LogFileName);
- Logger.Active := True;
+ try
+ Logger.LogType := ltFile;
+ Logger.FileName := C_LogFileName;
+ if FileExistsUTF8(C_LogFileName) then
+ DeleteFile(C_LogFileName);
+ Logger.Active := True;
+ except
+ Logger.Active := False;
+ FreeAndNil(Logger);
+ Halt(1);
+ end;
Logger.Info('Start of Log');
bCopyTreeSuccess := False;
@@ -195,31 +204,31 @@ begin
Logger.Info('Updated whatsNew path = ' + szUpdatedWNPath);
if not FileExistsUTF8(szUpdatedEXEPath) then
- begin
+ begin
WriteAndLog('Couldn''t find szUpdatedEXEPath');
Logger.Active := False;
FreeAndNil(Logger);
Halt(1);
- end;
+ end;
if FileExistsUTF8(szUpdatedWNPath) then
- begin
+ begin
// Write a file to disk that the app keeps checking for.
- try
+ try
Fileutil.CopyFile(szUpdatedWNPath, szOldWNPath, [cffOverWriteFile]);
WriteAndLog('Writing.. ' + szWhatsNewName);
- except
+ except
On E: Exception do
- begin
+ begin
WriteAndLog(Format('There was a problem writing %s. Reason: %s',
[szWhatsNewName, E.Message]));
Logger.Active := False;
FreeAndNil(Logger);
Halt(1);
- end;
end;
end;
+ end;
// The calling app is in a loop - waiting to detect
// a Whatsnew file in it's home directory
@@ -242,61 +251,62 @@ begin
// Copied to the global application data folder
// Add entry 'Location'
if FileExistsUTF8(szUpdatesFullPath + C_LAUTRayINI) then
- begin
- szLAUTrayAppPath := GetAppConfigDirUTF8(False, True);;
- try
+ begin
+ szLAUTrayAppPath := GetAppConfigDirUTF8(False, True);
+ ;
+ try
ForceDirectory(szLAUTrayAppPath);
Fileutil.CopyFile(szUpdatesFullPath + C_LAUTRayINI, szLAUTrayAppPath +
C_LAUTRayINI, [cffOverWriteFile]);
WriteAndLog(Format('Successfully copied %s to %s ',
[C_LAUTRayINI, szLAUTrayAppPath]));
if FileExistsUTF8(szLAUTrayAppPath + C_LAUTRayINI) then
- begin
+ begin
INI := TINIFile.Create(szLAUTrayAppPath + C_LAUTRayINI);
SectionStringList := TStringList.Create;
- try
+ try
INI.ReadSections(SectionStringList);
if SectionStringList.Count > 0 then
- begin
+ begin
INI.WriteString(SectionStringList[0], 'Location', ProgramDirectory);
WriteAndLog(Format('Wrote new entry in section %s. Location=%s',
[SectionStringList[0], ProgramDirectory]));
- end
+ end
else
WriteAndLog('Failed to find a valid section in ' + C_LAUTRayINI);
- finally
+ finally
FreeAndNil(SectionStringList);
FreeAndNil(INI);
- end;
- end
+ end;
+ end
else
WriteAndLog('Failed to copy ' + C_LAUTRayINI + ' to ' + szLAUTrayAppPath);
- except
+ except
On E: Exception do
WriteAndLog(Format('Could not copy %s. Error: %s ', [C_LAUTrayApp, E.Message]));
- end;
end;
+ end;
// If CopyTree, then just copy the whole of the /updates folder (inc directories) to the App Directory
- try
+ try
if ParamStrUTF8(5) = 'copytree' then
// Copy a whole directory tree?
bCopyTreeSuccess := CopyDirTree(szUpdatesFullPath, ProgramDirectory,
[cffOverwriteFile, cffCreateDestDirectory]);
- except
+ except
On E: Exception do
WriteAndLog('Copytree error: ' + E.Message);
- end;
+ end;
// CopyTree not specified, or operation failed
// Just copy the updated app over the old one
if FileExistsUTF8(szUpdatedEXEPath) then
- begin
+ begin
if (bCopyTreeSuccess = False) then
// Copy over exe file
if Fileutil.CopyFile(szUpdatedEXEPath, szOldEXEPath, [cffOverWriteFile]) then
- begin
+ begin
WriteAndLog('Copying over executeable, then sleeping...');
{$IFDEF HAS_SLEEP}
WriteAndLog('Sleeping...');
@@ -305,27 +315,27 @@ begin
WriteAndLog('Waiting 1 second...');
WaitFor(1000);
{$ENDIF}
- end
+ end
else
WriteAndLog('Copy to ' + szUpdatedEXEPath + ' failed');
// Restart updated app
if FileExistsUTF8(szOldEXEPath) then
- begin
+ begin
WriteAndLog('Restarting ' + szPrettyName + '...');
AppProcess := TProcess.Create(nil);
- try
+ try
AppProcess.CurrentDirectory := ExtractFileDir(szOldEXEPath);
AppProcess.Executable := szOldEXEPath;
AppProcess.StartupOptions := [suoUseShowWindow];
AppProcess.Execute;
- finally
+ finally
AppProcess.Free;
- end;
- end
+ end;
+ end
else
WriteAndLog('Failure. Couldn''t find ' + szOldEXEPath);
- end
+ end
else
WriteAndLog('Failure. Couldn''t find ' + szUpdatedEXEPath);
diff --git a/components/lazautoupdate/latest_stable/updatepack/umainform.lfm b/components/lazautoupdate/latest_stable/updatepack/umainform.lfm
index ac4f1b1db..91083e036 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 = 767
+ Left = 715
Height = 481
- Top = 215
+ Top = 197
Width = 587
AllowDropFiles = True
BorderIcons = [biSystemMenu, biMinimize]
@@ -188,6 +188,7 @@ object mainform: Tmainform
OnCloseUp = cmb_profileCloseUp
ParentShowHint = False
ShowHint = True
+ Sorted = True
Style = csDropDownList
TabOrder = 0
Text = 'Default'
diff --git a/components/lazautoupdate/latest_stable/updatepack/umainform.pas b/components/lazautoupdate/latest_stable/updatepack/umainform.pas
index f6ef1a75d..f4b385436 100644
--- a/components/lazautoupdate/latest_stable/updatepack/umainform.pas
+++ b/components/lazautoupdate/latest_stable/updatepack/umainform.pas
@@ -36,7 +36,7 @@ unit umainform;
interface
uses
- Classes, SysUtils, LazUTF8,LazFileUtils,FileUtil, Forms, Controls, Dialogs,
+ Classes, SysUtils, LazUTF8, LazFileUtils, FileUtil, Forms, Controls, Dialogs,
Buttons, Menus, StdCtrls, EditBtn, Spin, ComCtrls, ulazautoupdate, inifiles,
eventlog, umemoform, Zipper, strutils, asyncprocess, lclintf, types;
@@ -196,7 +196,7 @@ type
procedure spn3Change(Sender: TObject);
procedure spn4Change(Sender: TObject);
procedure tab_configureContextPopup(Sender: TObject; MousePos: TPoint;
- var Handled: Boolean);
+ var Handled: boolean);
private
{ private declarations }
AppConfig: TINIFile; // Application config file. Holds current Profile name
@@ -205,7 +205,8 @@ type
ProfilenameList: TStringList; // Used to populate the combo box
szCurrentProfileName: string; // Name used to Save/Load profiles to the INI file
bCurrentProfileSaved, bComponentDownloaded, bIsVirgin: boolean;
- bShowCodeWindow, bShowFileManager, bShowOnlineWebsite, bOverRideUserPrefs,DebugMode: boolean;
+ bShowCodeWindow, bShowFileManager, bShowOnlineWebsite,
+ bOverRideUserPrefs, DebugMode: boolean;
// DragFileStringList:TStringList;
procedure ReadProfileFromINI(AProfileName: string); // Writes ProfileRec to disk
procedure WriteProfileToINI(AProfileName: string); // Reads ProfileRec from disk
@@ -358,19 +359,21 @@ begin
end;
procedure Tmainform.tab_configureContextPopup(Sender: TObject;
- MousePos: TPoint; var Handled: Boolean);
+ MousePos: TPoint; var Handled: boolean);
begin
end;
procedure Tmainform.FormCreate(Sender: TObject);
begin
- If LowerCase(ParamStr(1))='debug' then DebugMode:=TRUE
- else DebugMode:=FALSE;
+ if LowerCase(ParamStr(1)) = 'debug' then
+ DebugMode := True
+ else
+ DebugMode := False;
Caption := Application.Title;
Icon := Application.Icon;
- AppConfig := TINIFile.Create(GetAppConfigDir(false) + C_APPCONFIGNAME);
- ProfileConfig := TINIFile.Create(GetAppConfigDir(false) + C_PROFILECONFIGNAME);
+ AppConfig := TINIFile.Create(GetAppConfigDir(False) + C_APPCONFIGNAME);
+ ProfileConfig := TINIFile.Create(GetAppConfigDir(False) + C_PROFILECONFIGNAME);
ProfilenameList := TStringList.Create;
ProfileRec.DragFileStringList := TStringList.Create;
if FileExistsUTF8('readme.txt') then
@@ -416,18 +419,22 @@ begin
cmb_profile.Clear;
cmb_profile.Items := ProfileNameList;
cmb_profile.ItemIndex := cmb_profile.Items.IndexOf(szCurrentProfileName);
- If LazAutoUpdate1.CreateLocalLauImportFile
- then LazAutoUpdate1.RelocateLauImportFile;
+ if LazAutoUpdate1.CreateLocalLauImportFile then
+ LazAutoUpdate1.RelocateLauImportFile;
if bIsVirgin then
PageControl1.ActivePage := tab_intro
else
PageControl1.ActivePage := tab_configure;
- If DebugMode then EventLog1.FileName := ChangeFileExt(ParamStr(0), '.log');
- If DebugMode then if FileExistsUTF8(EventLog1.FileName) then
- SysUtils.DeleteFile(EventLog1.FileName);
- If DebugMode then EventLog1.AppendContent := True;
- If DebugMode then EventLog1.Active := True;
- LazAutoUpdate1.DebugMode:=DebugMode;
+ if DebugMode then
+ EventLog1.FileName := ChangeFileExt(ParamStr(0), '.log');
+ if DebugMode then
+ if FileExistsUTF8(EventLog1.FileName) then
+ SysUtils.DeleteFile(EventLog1.FileName);
+ if DebugMode then
+ EventLog1.AppendContent := True;
+ if DebugMode then
+ EventLog1.Active := True;
+ LazAutoUpdate1.DebugMode := DebugMode;
end;
procedure Tmainform.FormDestroy(Sender: TObject);
@@ -453,10 +460,10 @@ var
begin
for i := Low(FileNames) to High(FileNames) do
if ((ProfileRec.DragFileStringList.IndexOf(FileNames[i]) = -1) and
- (FileNames[i] <> ProfileRec.AppPath) and (FileNames[i] <>
- ProfileRec.WhatsNewPath) and (FileNames[i] <>
- LazAutoUpdate1.UpdateExe) and (FileNames[i] <>
- LazAutoUpdate1.UpdateExeSilent)) then
+ (FileNames[i] <> ProfileRec.AppPath) and
+ (FileNames[i] <> ProfileRec.WhatsNewPath) and
+ (FileNames[i] <> LazAutoUpdate1.UpdateExe) and
+ (FileNames[i] <> LazAutoUpdate1.UpdateExeSilent)) then
if (DirPathExists(FileNames[i]) = True) then
begin // Not allowed to drag a directory into the list
ShowMessage('You dragged a directory. For whole directories, use the CopyTree facility');
@@ -483,7 +490,8 @@ end;
procedure Tmainform.LazAutoUpdate1DebugEvent(Sender: TObject; WhereAt, Message: string);
begin
- If DebugMode AND (EventLog1.Active=TRUE) then EventLog1.Log(Format('LazAutoUpdate: Source=%s, Message=%s', [WhereAt, Message]));
+ if DebugMode and (EventLog1.Active = True) then
+ EventLog1.Log(Format('LazAutoUpdate: Source=%s, Message=%s', [WhereAt, Message]));
end;
procedure Tmainform.lst_dragfilesDblClick(Sender: TObject);
@@ -681,7 +689,8 @@ begin
CanClose := True;
end;
if CanClose then
- If DebugMode then EventLog1.Active := False;
+ if DebugMode then
+ EventLog1.Active := False;
end;
procedure Tmainform.cmd_UseAppnameVersionsINIClick(Sender: TObject);
@@ -715,7 +724,7 @@ begin
ZipFileName := 'packagesource.zip';
ShowUpdateInCaption := True;
VersionINI := TIniFile.Create('new' + VersionsININame);
-// VersionINI := TIniFile.Create(VersionsININame);
+ // VersionINI := TIniFile.Create(VersionsININame);
AppVersion := VersionINI.ReadString('versions', 'GUI', '0.0.0.0');
VersionINI.Free;
if NewVersionAvailable then
@@ -750,22 +759,22 @@ end;
procedure Tmainform.cmb_profileClick(Sender: TObject);
begin
- szCurrentProfileName := cmb_profile.Items[cmb_profile.ItemIndex];
-// Auto-save current profile
- AppConfig.WriteString('Current', 'Profilename', szCurrentProfileName);
- ReadFromGUI(szCurrentProfileName); // Read from GUI
- WriteProfileToINI(szCurrentProfileName); // Write to disk
- bCurrentProfileSaved := True;
+ szCurrentProfileName := cmb_profile.Items[cmb_profile.ItemIndex];
+ // Auto-save current profile
+ AppConfig.WriteString('Current', 'Profilename', szCurrentProfileName);
+ ReadFromGUI(szCurrentProfileName); // Read from GUI
+ WriteProfileToINI(szCurrentProfileName); // Write to disk
+ bCurrentProfileSaved := True;
end;
procedure Tmainform.cmb_profileCloseUp(Sender: TObject);
begin
- // Read selected profile into ProfileRec and GUI
- szCurrentProfileName := cmb_profile.Items[cmb_profile.ItemIndex];
- ReadProfileFromINI(szCurrentProfileName); // Read from disk
- WriteToGUI(szCurrentProfileName); // Display in GUI
- AppConfig.WriteString('Current', 'Profilename', szCurrentProfileName);
- bCurrentProfileSaved := False;
+ // Read selected profile into ProfileRec and GUI
+ szCurrentProfileName := cmb_profile.Items[cmb_profile.ItemIndex];
+ ReadProfileFromINI(szCurrentProfileName); // Read from disk
+ WriteToGUI(szCurrentProfileName); // Display in GUI
+ AppConfig.WriteString('Current', 'Profilename', szCurrentProfileName);
+ bCurrentProfileSaved := False;
end;
@@ -923,12 +932,13 @@ begin
Execute;
end;
if bShowOnlineWebsite then
- If LazAutoUpdate1.ProjectType=auSourceForge then
- OpenURL('https://sourceforge.net/projects/' + ProfileRec.SFProjectName + '/');
- If LazAutoUpdate1.ProjectType=auGitHubReleaseZip then
- OpenURL('https://github.com/' + LazAutoUpdate1.GitHubProjectName + '/' + LazAutoUpdate1.GitHubBranchOrTag + '/');
- If LazAutoUpdate1.ProjectType=auOther then
- OpenURL(LazAutoUpdate1.auOtherSourceURL + '/');
+ if LazAutoUpdate1.ProjectType = auSourceForge then
+ OpenURL('https://sourceforge.net/projects/' + ProfileRec.SFProjectName + '/');
+ if LazAutoUpdate1.ProjectType = auGitHubReleaseZip then
+ OpenURL('https://github.com/' + LazAutoUpdate1.GitHubProjectName +
+ '/' + LazAutoUpdate1.GitHubBranchOrTag + '/');
+ if LazAutoUpdate1.ProjectType = auOther then
+ OpenURL(LazAutoUpdate1.auOtherSourceURL + '/');
{$ELSE}
// Use generic linux command
@@ -941,12 +951,14 @@ begin
if bShowFileManager then
Execute;
Parameters.Clear;
- If LazAutoUpdate1.ProjectType=auSourceForge then
- Parameters.Add('https://sourceforge.net/projects/' + ProfileRec.SFProjectName + '/');
- If LazAutoUpdate1.ProjectType=auGitHubReleaseZip then
- Parameters.Add('https://github.com/' + LazAutoUpdate1.GitHubProjectName + '/' + LazAutoUpdate1.GitHubBranchOrTag + '/');
- If LazAutoUpdate1.ProjectType=auOther then
- Parameters.Add(LazAutoUpdate1.auOtherSourceURL + '/');
+ if LazAutoUpdate1.ProjectType = auSourceForge then
+ Parameters.Add('https://sourceforge.net/projects/' +
+ ProfileRec.SFProjectName + '/');
+ if LazAutoUpdate1.ProjectType = auGitHubReleaseZip then
+ Parameters.Add('https://github.com/' + LazAutoUpdate1.GitHubProjectName +
+ '/' + LazAutoUpdate1.GitHubBranchOrTag + '/');
+ if LazAutoUpdate1.ProjectType = auOther then
+ Parameters.Add(LazAutoUpdate1.auOtherSourceURL + '/');
if bShowOnlineWebsite then
Execute;
end;
@@ -962,13 +974,15 @@ begin
end;
procedure Tmainform.cmd_NewProfileClick(Sender: TObject);
-Var
- szProfileName:String;
+var
+ szProfileName: string;
begin
szProfileName := '';
- if NOT InputQuery('New Profile Name',
- 'Type new profile name here',FALSE,szProfilename) then exit;
- if szProfileName = '' then exit;
+ if not InputQuery('New Profile Name', 'Type new profile name here',
+ False, szProfilename) then
+ exit;
+ if szProfileName = '' then
+ exit;
// We have a valid profile name...
// Does it already exist?
@@ -985,8 +999,13 @@ begin
// Set last item in list as current
cmb_profile.ItemIndex := cmb_profile.Items.Count - 1;
bCurrentProfileSaved := False;
+ end
+ else
+ begin
+ ShowMessage('This profile name already exists. Please choose a new name');
+ Exit;
end;
-if (ProfilenameList.IndexOf(cmb_profile.Text) >= 0) then
+ if (ProfilenameList.IndexOf(cmb_profile.Text) >= 0) then
MessageDlg(Application.Title,
Format(rsNewProfileCreated, [szCurrentProfileName]),
mtInformation, [mbOK], 0);
@@ -1023,7 +1042,8 @@ begin
begin
ProfileName := AProfileName;
AppPath := ReadString(AProfileName, 'AppPath', ProgramDirectory + 'myapp.exe');
- OutDir := CleanAndExpandDirectory(ReadString(AProfileName, 'OutDir', ProgramDirectory));
+ OutDir := CleanAndExpandDirectory(ReadString(AProfileName,
+ 'OutDir', ProgramDirectory));
NewVersion.VString := ReadString(AProfileName, 'NewVersion', '0.0.0.0');
FillVersionInteger(NewVersion);
VersionsINI := ReadString(AProfileName, 'VersionsINI', 'versions.ini');
@@ -1228,7 +1248,8 @@ begin
DeleteFile(ProfileRec.Zipfilename);
Application.ProcessMessages;
if FileExistsUTF8(ProfileRec.Zipfilename) then
- If DebugMode then EventLog1.Error('Unable to delete %s', [ProfileRec.Zipfilename]);
+ if DebugMode then
+ EventLog1.Error('Unable to delete %s', [ProfileRec.Zipfilename]);
end;
AZipper := TZipper.Create;
@@ -1326,7 +1347,8 @@ begin
DeleteFile(ProfileRec.Outdir + C_LAUTRayINI);
Application.ProcessMessages;
if FileExistsUTF8(ProfileRec.Outdir + C_LAUTRayINI) then
- If DebugMode then EventLog1.Error('Unable to delete %s', [ProfileRec.Outdir + C_LAUTRayINI]);
+ if DebugMode then
+ EventLog1.Error('Unable to delete %s', [ProfileRec.Outdir + C_LAUTRayINI]);
LAUTRayINI := TINIFile.Create(ProfileRec.Outdir + C_LAUTRayINI);
try
diff --git a/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi b/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi
index 4df46f28f..080830b85 100644
--- a/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi
+++ b/components/lazautoupdate/latest_stable/updatepack/updatepack.lpi
@@ -23,7 +23,7 @@
-
+
diff --git a/components/lazautoupdate/latest_stable/updatepack/updatepack.res b/components/lazautoupdate/latest_stable/updatepack/updatepack.res
index e0072bff1..00bc91899 100644
Binary files a/components/lazautoupdate/latest_stable/updatepack/updatepack.res and b/components/lazautoupdate/latest_stable/updatepack/updatepack.res differ