diff --git a/components/lazautoupdate/latest_stable/lazupdate.lpk b/components/lazautoupdate/latest_stable/lazupdate.lpk
index 8a18a41c9..a751c762c 100644
--- a/components/lazautoupdate/latest_stable/lazupdate.lpk
+++ b/components/lazautoupdate/latest_stable/lazupdate.lpk
@@ -66,7 +66,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/testinstaller/lauinstaller.ico b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.ico
new file mode 100644
index 000000000..0341321b5
Binary files /dev/null and b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.ico differ
diff --git a/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpi b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpi
new file mode 100644
index 000000000..5e15dc4c4
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpi
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpr b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpr
new file mode 100644
index 000000000..4cf204e48
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lpr
@@ -0,0 +1,54 @@
+program lauinstaller;
+{
+License (MIT)
+=============
+LazAutoUpdate Universal Installer (c)2017 Gordon Bamber (minesadorada@charcodelvalle.com)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal in the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+}
+
+{$mode objfpc}{$H+}
+{$ifdef Linux}
+ {$ifdef FPC_CROSSCOMPILING}
+ {$ifdef CPUARM}
+ //if GUI, then uncomment
+ //{$linklib GLESv2}
+ {$endif}
+ {$linklib libc_nonshared.a}
+ {$endif}
+{$endif}
+
+uses
+ {$IFDEF UNIX}{$IFDEF UseCThreads}
+ cthreads,
+ {$ENDIF}{$ENDIF}
+ Interfaces, // this includes the LCL widgetset
+ Forms, umainform
+ { you can add units after this };
+
+{$R *.res}
+
+begin
+ Application.Title:='LazAutoupdate Universal Installer';
+ RequireDerivedFormResource:=True;
+ Application.Initialize;
+ Application.CreateForm(Tmainform, mainform);
+ Application.Run;
+end.
+
diff --git a/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lps b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lps
new file mode 100644
index 000000000..93cc22594
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.lps
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.res b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.res
new file mode 100644
index 000000000..44b761133
Binary files /dev/null and b/components/lazautoupdate/latest_stable/testinstaller/lauinstaller.res differ
diff --git a/components/lazautoupdate/latest_stable/testinstaller/locale/lauinstaller.po b/components/lazautoupdate/latest_stable/testinstaller/locale/lauinstaller.po
new file mode 100644
index 000000000..736538622
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/locale/lauinstaller.po
@@ -0,0 +1,31 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: tmainform.caption
+msgid "mainform"
+msgstr ""
+
+#: tmainform.cmd_install.caption
+msgid "Install"
+msgstr ""
+
+#: tmainform.cmd_run.caption
+msgid "Run"
+msgstr ""
+
+#: tmainform.grp_action.caption
+msgid "Action"
+msgstr ""
+
+#: tmainform.grp_application.caption
+msgid "Application"
+msgstr ""
+
+#: tmainform.mnu_file.caption
+msgid "&File"
+msgstr ""
+
+#: tmainform.mnu_fileexit.caption
+msgid "E&xit"
+msgstr ""
+
diff --git a/components/lazautoupdate/latest_stable/testinstaller/umainform.lfm b/components/lazautoupdate/latest_stable/testinstaller/umainform.lfm
new file mode 100644
index 000000000..8f0b363a5
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/umainform.lfm
@@ -0,0 +1,131 @@
+object mainform: Tmainform
+ Left = 737
+ Height = 241
+ Top = 222
+ Width = 320
+ BorderIcons = [biSystemMenu, biMinimize]
+ BorderStyle = bsSingle
+ Caption = 'mainform'
+ ClientHeight = 221
+ ClientWidth = 320
+ Menu = MainMenu1
+ OnClose = FormClose
+ OnCloseQuery = FormCloseQuery
+ OnCreate = FormCreate
+ Position = poWorkAreaCenter
+ LCLVersion = '1.7'
+ Scaled = True
+ object cmd_close: TBitBtn
+ Left = 125
+ Height = 30
+ Top = 179
+ Width = 75
+ Anchors = [akRight, akBottom]
+ DefaultCaption = True
+ Kind = bkClose
+ ModalResult = 11
+ OnClick = mnu_fileExitClick
+ TabOrder = 0
+ end
+ object grp_Application: TRadioGroup
+ Left = 0
+ Height = 113
+ Top = 0
+ Width = 320
+ Align = alTop
+ AutoFill = True
+ Caption = 'Application'
+ ChildSizing.LeftRightSpacing = 6
+ ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+ ChildSizing.EnlargeVertical = crsHomogenousChildResize
+ ChildSizing.ShrinkHorizontal = crsScaleChilds
+ ChildSizing.ShrinkVertical = crsScaleChilds
+ ChildSizing.Layout = cclLeftToRightThenTopToBottom
+ ChildSizing.ControlsPerLine = 1
+ ClientHeight = 93
+ ClientWidth = 316
+ ItemIndex = 2
+ Items.Strings = (
+ 'LazAutoUpdate Update Pack'
+ 'LazAutoUpdate Tray Updater'
+ 'LazAutoUpdate Test Application'
+ 'Retro Ski Run'
+ )
+ OnSelectionChanged = grp_ApplicationSelectionChanged
+ TabOrder = 1
+ end
+ object grp_Action: TGroupBox
+ Left = 0
+ Height = 57
+ Top = 113
+ Width = 320
+ Align = alTop
+ Caption = 'Action'
+ ClientHeight = 37
+ ClientWidth = 316
+ TabOrder = 2
+ object cmd_Install: TButton
+ Left = 8
+ Height = 25
+ Top = 0
+ Width = 75
+ Caption = 'Install'
+ OnClick = cmd_InstallClick
+ TabOrder = 0
+ end
+ object cmd_Run: TButton
+ Left = 88
+ Height = 25
+ Top = 0
+ Width = 75
+ Caption = 'Run'
+ OnClick = cmd_RunClick
+ TabOrder = 1
+ end
+ end
+ object LazAutoUpdate1: TLazAutoUpdate
+ About.Description.Strings = (
+ 'A component for updating your application'#13#10'Designed for projects hosted by SourceForge'#13#10#13#10'Main methods:'#13#10'Procedure AutoUpdate'#13#10'Function NewVersionAvailable: Boolean'#13#10'Function DownloadNewVersion: Boolean'#13#10'Function UpdateToNewVersion: Boolean'#13#10'Procedure ShowWhatsNewIfAvailable'#13#10'For troubleshooting, set DebugMode=TRUE'
+ )
+ About.Title = 'About LazAutoUpdate'
+ About.Height = 450
+ About.Width = 400
+ About.Font.Color = clNavy
+ About.Font.Height = -13
+ About.BackGroundColor = clWindow
+ About.Version = '0.3.4.0'
+ About.Authorname = 'Gordon Bamber'
+ About.Organisation = 'Public Domain'
+ About.AuthorEmail = 'minesadorada@charcodelvalle.com'
+ About.ComponentName = 'Laz Auto-update v0.3.4.0'
+ About.LicenseType = abModifiedGPL
+ OnDebugEvent = LazAutoUpdate1DebugEvent
+ auOtherSourceURL = ''
+ auOtherSourceFilename = ''
+ UpdatesFolder = 'updates'
+ VersionsININame = 'versions.ini'
+ ShowUpdateInCaption = True
+ VersionCountLimit = 1000000
+ DownloadCountLimit = 10000000
+ ZipfileName = 'versions.zip'
+ GitHubProjectname = ''
+ GitHubRepositoryName = ''
+ GitHubBranchOrTag = ''
+ WorkingMode = lauUpdate
+ ShortCut.ShortcutName = 'MyShortcutName'
+ ShortCut.Category = scAudioVideo
+ Left = 80
+ Top = 16
+ end
+ object MainMenu1: TMainMenu
+ Left = 104
+ Top = 16
+ object mnu_file: TMenuItem
+ Caption = '&File'
+ object mnu_fileExit: TMenuItem
+ Caption = 'E&xit'
+ OnClick = mnu_fileExitClick
+ end
+ end
+ end
+end
diff --git a/components/lazautoupdate/latest_stable/testinstaller/umainform.lrj b/components/lazautoupdate/latest_stable/testinstaller/umainform.lrj
new file mode 100644
index 000000000..d5a2838a1
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/umainform.lrj
@@ -0,0 +1,9 @@
+{"version":1,"strings":[
+{"hash":134533565,"name":"tmainform.caption","sourcebytes":[109,97,105,110,102,111,114,109],"value":"mainform"},
+{"hash":265345406,"name":"tmainform.grp_application.caption","sourcebytes":[65,112,112,108,105,99,97,116,105,111,110],"value":"Application"},
+{"hash":75149406,"name":"tmainform.grp_action.caption","sourcebytes":[65,99,116,105,111,110],"value":"Action"},
+{"hash":5941372,"name":"tmainform.cmd_install.caption","sourcebytes":[73,110,115,116,97,108,108],"value":"Install"},
+{"hash":22974,"name":"tmainform.cmd_run.caption","sourcebytes":[82,117,110],"value":"Run"},
+{"hash":2805797,"name":"tmainform.mnu_file.caption","sourcebytes":[38,70,105,108,101],"value":"&File"},
+{"hash":4710148,"name":"tmainform.mnu_fileexit.caption","sourcebytes":[69,38,120,105,116],"value":"E&xit"}
+]}
diff --git a/components/lazautoupdate/latest_stable/testinstaller/umainform.pas b/components/lazautoupdate/latest_stable/testinstaller/umainform.pas
new file mode 100644
index 000000000..aef4ec866
--- /dev/null
+++ b/components/lazautoupdate/latest_stable/testinstaller/umainform.pas
@@ -0,0 +1,238 @@
+unit umainform;
+{
+License (MIT)
+=============
+LazAutoUpdate Universal Installer (c)2017 Gordon Bamber (minesadorada@charcodelvalle.com)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal in the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ IN THE SOFTWARE.
+}
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+ Classes, SysUtils, LazUTF8, FileUtil, LazFileUtils, Forms, Controls,
+ Graphics, Dialogs, Buttons,
+ Menus, StdCtrls, ExtCtrls, asyncprocess,
+ ulazautoupdate, eventlog;
+
+// resourcestring
+
+
+type
+
+ { Tmainform }
+
+ Tmainform = class(TForm)
+ cmd_Run: TButton;
+ cmd_Install: TButton;
+ cmd_close: TBitBtn;
+ grp_Action: TGroupBox;
+ LazAutoUpdate1: TLazAutoUpdate;
+ MainMenu1: TMainMenu;
+ mnu_fileExit: TMenuItem;
+ mnu_file: TMenuItem;
+ grp_Application: TRadioGroup;
+ procedure cmd_InstallClick(Sender: TObject);
+ procedure cmd_RunClick(Sender: TObject);
+ procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+ procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
+ procedure FormCreate(Sender: TObject);
+ procedure grp_ApplicationSelectionChanged(Sender: TObject);
+ procedure LazAutoUpdate1DebugEvent(Sender: TObject;
+ lauMethodName, lauMessage: string);
+ procedure mnu_fileExitClick(Sender: TObject);
+ private
+ Logger: TEventLog;
+ procedure ConfigureLazAutoUpdate(const AItemIndex: integer);
+ procedure RunInstalledApp;
+ public
+
+ end;
+
+var
+ mainform: Tmainform;
+
+implementation
+
+{$R *.lfm}
+Var
+ sDirectoryToInstallTo:String;
+
+{ Tmainform }
+
+procedure Tmainform.FormCreate(Sender: TObject);
+begin
+ Caption := Application.Title;
+ Icon := Application.Icon;
+ sDirectoryToInstallTo:=ProgramDirectory + 'installed';
+ LazAutoUpdate1.DebugMode:=TRUE;
+ LazAutoUpdate1.ShowUpdateInCaption:=True;
+ ConfigureLazAutoUpdate(2); // Default is TestApp
+ Logger := TEventLog.Create(nil);
+ Logger.LogType := ltFile;
+ Logger.FileName := Application.Title + '.log';
+ Logger.Active := True; // Logging uses OnDebugEvent of LazAutoUpdate
+end;
+
+procedure Tmainform.cmd_InstallClick(Sender: TObject);
+begin
+ LazAutoUpdate1.WorkingMode := lauInstall;
+ // Uses SilentUpdate method to install the app if it isn't running
+ // Else uses UpdateToNewVersion to close/update it
+
+ // Let the component do the work!
+ if LazAutoUpdate1.DownloadNewVersion then
+ if LazAutoUpdate1.UpdateToNewVersion then
+ begin
+ ShowMessageFmt('Success. %s installed.', [LazAutoUpdate1.AppFileWithPath]);
+ end
+ else
+ begin
+ ShowMessageFmt('Failure. See logfile %s', [Logger.FileName]);
+ end;
+ // Restore standard mode
+ LazAutoUpdate1.WorkingMode := lauUpdate;
+end;
+
+procedure Tmainform.cmd_RunClick(Sender: TObject);
+begin
+ RunInstalledApp;
+end;
+
+procedure Tmainform.RunInstalledApp;
+var
+ AProcess: TAsyncProcess;
+begin
+ if not FileExistsUTF8(LazAutoUpdate1.AppFileWithPath) then
+ begin
+ ShowMessageFmt('%s does not exist! Install it first.',
+ [LazAutoUpdate1.AppFileWithPath]);
+ Exit;
+ end;
+ AProcess := TAsyncProcess.Create(nil);
+ try
+ AProcess.Executable := LazAutoUpdate1.AppFileWithPath;
+ AProcess.Execute;
+ finally
+ Aprocess.Free;
+ end;
+end;
+
+procedure Tmainform.FormClose(Sender: TObject; var CloseAction: TCloseAction);
+begin
+ if Assigned(Logger) then
+ begin
+ Logger.Active := False;
+ FreeAndNil(Logger);
+ end;
+end;
+
+procedure Tmainform.FormCloseQuery(Sender: TObject; var CanClose: boolean);
+begin
+ If LazAutoUpdate1.DownloadInProgress Then
+ Begin
+ CanClose := False;
+ ShowMessage('Please wait. Download is still in progress.');
+ End;
+end;
+
+procedure Tmainform.grp_ApplicationSelectionChanged(Sender: TObject);
+begin
+ ConfigureLazAutoUpdate(grp_Application.ItemIndex);
+end;
+
+procedure Tmainform.LazAutoUpdate1DebugEvent(Sender: TObject;
+ lauMethodName, lauMessage: string);
+begin
+ Logger.Log(lauMethodName + ' - ' + lauMessage);
+end;
+
+procedure Tmainform.mnu_fileExitClick(Sender: TObject);
+begin
+ Close;
+end;
+
+procedure Tmainform.ConfigureLazAutoUpdate(const AItemIndex: integer);
+begin
+ // Note: This routine relies on a consistent naming convention for your
+ // executables in Windows 32/64-bit and Linux 32/64-bit (see Const C_PFX declaration)
+ case AItemIndex of
+ 0: //Update Pack
+ begin
+ LazAutoUpdate1.ProjectType := auSourceForge; // can be auGitHubReleaseZip or auOther
+ LazAutoUpdate1.SFProjectname := 'lazautoupdate'; // Or GitHub properties
+ LazAutoUpdate1.UpdatesFolder := 'updates'; // Subfolder in repository
+ LazAutoUpdate1.VersionsININame := 'updatepack' + C_PFX + '.ini'; // as specified
+ LazAutoUpdate1.ZipfileName := 'updatepack' + C_PFX + '.zip'; // as specified
+ // Note: sDirectoryToInstallTo does not end in a DirectorySeparator
+ {$IFDEF WINDOWS}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'updatepack.exe';
+ {$ELSE}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'updatepack';
+ {$ENDIF}
+ // Our responsibility to make the folder
+ if not DirectoryExistsUTF8(sDirectoryToInstallTo) then
+ ForceDirectoriesUTF8(sDirectoryToInstallTo);
+ LazAutoUpdate1.Appversion := '0.0.0.0';
+ end;
+ 1: // Tray Updater
+ ;
+ 2: // Test Application
+ begin
+ LazAutoUpdate1.ProjectType := auSourceForge;
+ LazAutoUpdate1.SFProjectname := 'lazautoupdate';
+ LazAutoUpdate1.UpdatesFolder := 'updates';
+ LazAutoUpdate1.VersionsININame := 'testapp' + C_PFX + '.ini';
+ LazAutoUpdate1.ZipfileName := 'testapp' + C_PFX + '.zip';
+ {$IFDEF WINDOWS}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'testapp' + C_PFX + '.exe';
+ {$ELSE}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'testapp' + C_PFX;
+ {$ENDIF}
+ if not DirectoryExistsUTF8(sDirectoryToInstallTo) then
+ ForceDirectoriesUTF8(sDirectoryToInstallTo);
+ LazAutoUpdate1.Appversion := '0.0.0.0';
+ end;
+ 3: // Retro Ski Run
+ begin
+ LazAutoUpdate1.ProjectType := auSourceForge;
+ LazAutoUpdate1.SFProjectname := 'lazautoupdate';
+ LazAutoUpdate1.UpdatesFolder := 'updates';
+ LazAutoUpdate1.VersionsININame := 'ski' + C_PFX + '.ini';
+ LazAutoUpdate1.ZipfileName := 'ski' + C_PFX + '.zip';
+ {$IFDEF WINDOWS}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'ski' + C_PFX + '.exe';
+ {$ELSE}
+ LazAutoUpdate1.AppFileWithPath := sDirectoryToInstallTo +
+ DirectorySeparator + 'ski' + C_PFX;
+ {$ENDIF}
+ if not DirectoryExistsUTF8(sDirectoryToInstallTo) then
+ ForceDirectoriesUTF8(sDirectoryToInstallTo);
+ LazAutoUpdate1.Appversion := '0.0.0.0';
+ end;
+ end;
+end;
+
+end.
diff --git a/components/lazautoupdate/latest_stable/ulazautoupdate.pas b/components/lazautoupdate/latest_stable/ulazautoupdate.pas
index e3c4cd434..c7fa62a76 100644
--- a/components/lazautoupdate/latest_stable/ulazautoupdate.pas
+++ b/components/lazautoupdate/latest_stable/ulazautoupdate.pas
@@ -142,8 +142,11 @@ const
V0.3.4: Added unit ushortcut (CreateDesktopShortCut) for installers
V0.3.5: Rule #3:There is to be NO v0.3.5.0
V0.3.6: Bugfixed CreateShortCut code
+ V0.3.7: Added public property Mode=(lauUpdate|lauInstall)
+ V0.3.7.1: Added (DoSilentUpdate) copy C_UPDATEHMNAME to installed folder
+ V0.3.8: ??
}
- C_TLazAutoUpdateComponentVersion = '0.3.6.0';
+ C_TLazAutoUpdateComponentVersion = '0.3.7.1';
C_TThreadedDownloadComponentVersion = '0.0.3.0';
{
V0.0.1: Initial alpha
@@ -242,8 +245,6 @@ type
procedure Execute; override;
end;
-
-type
// This type is currently unused
TProjectType = (auSourceForge, auGitHubReleaseZip, auOther);
// Array of these records used for multiple updates
@@ -254,6 +255,8 @@ type
VersionNumber: cardinal;
end;
+ TWorkingMode = (lauUpdate,lauInstall);
+
TThreadedDownload = class; // Forward declaration
TShortCutClass = class; // Forward declaration
{TLAZAUTOUPDATE}
@@ -292,6 +295,7 @@ type
fDownloadInprogress: boolean;
fWindowsAdminCheck: boolean;
fShortCutClass: TShortCutClass;
+ fWorkingMode:TWorkingMode;
{$IFDEF UNIX}
FUpdateHMProcess: TAsyncProcess;
{$ENDIF}
@@ -460,17 +464,17 @@ type
write fGitHubRepositoryName;
// Default=master but any branchname or tagname is OK
property GitHubBranchOrTag: string read fGitHubBranchOrTag write fGitHubBranchOrTag;
-
+ // Install or Update (default=Update)
+ property WorkingMode:TworkingMode read fWorkingMode write fWorkingMode;
+ // Subproperties available
property ShortCut: TShortCutClass read fShortCutClass write fShortCutClass;
end;
-type
TShortCutCategory = (scAudioVideo, scAudio, scDevelopment,
scEducation, scGame, scGraphics, scNetwork, scOffice, scScience, scSettings,
scSystem, scUtility);
// TShortCutCategoryFlags = Set of TShortCutCategory;
-type
TShortCutClass = class(TPersistent)
private
// ShortCut stuff for CreateDesktopShortCut in ushortcut.pas
@@ -559,7 +563,6 @@ type
}
end;
-type
// For the TShortCutClass filename properties (needs propedits unit)
TMyFileNamePropertyEditor = class(TFileNamePropertyEditor)
public
@@ -833,7 +836,7 @@ begin
fCopyTree := True; // User can change
// UpdateList: Redundant?
AddToUpdateList('', LazUTF8.ParamStrUTF8(0), GetFileVersion, 0);
-
+ fWorkingMode:=lauUpdate; // Default
fProjectType := auSourceForge; // User can change
fUpdatesFolder := C_UpdatesFolder; // User can change
fVersionsININame := C_OnlineVersionsININame; // User can change
@@ -876,11 +879,11 @@ begin
// AboutBox properties
AboutBoxComponentName := Format('Laz Auto-update v%s',
[C_TLazAutoUpdateComponentVersion]);
- ;
+ AboutBoxVersion := C_TLazAutoUpdateComponentVersion;
AboutBoxWidth := 400;
AboutBoxHeight := 450;
sz := 'A component for updating your application' + LineEnding;
- sz += 'Designed for projects hosted by SourceForge' + LineEnding + LineEnding;
+ sz += 'Designed for projects hosted by SourceForge and GitHub' + LineEnding + LineEnding;
sz += 'Main methods:' + LineEnding;
sz += 'Procedure AutoUpdate' + LineEnding;
sz += 'Function NewVersionAvailable: Boolean' + LineEnding;
@@ -893,7 +896,6 @@ begin
// AboutBoxBackgroundColor:=clWindow;
//AboutBoxFontName (string)
//AboutBoxFontSize (integer)
- AboutBoxVersion := C_TLazAutoUpdateComponentVersion;
AboutBoxAuthorname := 'Gordon Bamber';
//AboutBoxOrganisation (string)
AboutBoxAuthorEmail := 'minesadorada@charcodelvalle.com';
@@ -1822,6 +1824,7 @@ var
SectionStringList: TStrings;
szTempUpdatesFolder: string;
begin
+// fWorkingMode=lauInstall or lauUpdate
Result := False;
// read the VMT once
if Assigned(fOndebugEvent) then
@@ -1829,15 +1832,23 @@ begin
if fFireDebugEvent then
fOndebugEvent(Self, 'DoSilentUpdate', 'Starting DoSilentUpdate');
+ if fFireDebugEvent then
+ If fWorkingMode=lauUpdate then
+ fOndebugEvent(Self, 'DoSilentUpdate','Update mode')
+ else
+ fOndebugEvent(Self, 'DoSilentUpdate','Install mode');
- if not FileExistsUTF8(fAppFilename) then
+ If fWorkingMode=lauUpdate then
begin
- if fFireDebugEvent then
- fOndebugEvent(Self, 'DoSilentUpdate',
- Format('AppFilename %s is missing. Exiting routine', [fAppFilename]));
- Exit;
-
+ if not FileExistsUTF8(fAppFilename) then
+ begin
+ if fFireDebugEvent then
+ fOndebugEvent(Self, 'DoSilentUpdate',
+ Format('AppFilename %s is missing. Exiting routine', [fAppFilename]));
+ Exit;
+ end;
end;
+
// uses fUpdatesFolder
szTempUpdatesFolder := AppendPathDelim(ExtractFilePath(fAppFilename) + fUpdatesFolder);
@@ -1908,6 +1919,25 @@ begin
[szTempUpdatesFolder + 'whatsnew.txt', szAppFolder + 'whatsnew.txt']));
end;
+
+ If (fWorkingMode=lauInstall) then
+ If FileExistsUTF8(C_UPDATEHMNAME) then
+ begin
+ If FileUtil.CopyFile(C_UPDATEHMNAME,szAppFolder + C_UPDATEHMNAME) then
+ if fFireDebugEvent then
+ fOndebugEvent(Self, 'DoSilentUpdate',
+ Format('Sucessfully copied %s to %s',
+ [C_UPDATEHMNAME, szAppFolder]))
+ else
+ if fFireDebugEvent then
+ fOndebugEvent(Self, 'DoSilentUpdate',
+ Format('Unabled to copy %s to %s',
+ [C_UPDATEHMNAME, szAppFolder]));
+ end
+ else
+ if fFireDebugEvent then
+ fOndebugEvent(Self, 'DoSilentUpdate','Unable to locate ' + C_UPDATEHMNAME);
+
// Deal with C_LAUTRayINI
// Copied to the global application data folder
// Add entry 'Location'
@@ -1929,6 +1959,7 @@ begin
if fFireDebugEvent then
fOndebugEvent(Self, 'DoSilentUpdate',
Format('App data directory changed to %s', [szLAUTrayAppPath]));
+
// Now AppDataDirectory/updatehm(+C_PFX)/
try
if ForceDirectory(szLAUTrayAppPath) then
@@ -2023,6 +2054,7 @@ begin
Exit;
end;
{$ENDIF}
+ // fWorkingMode=lauInstall or lauUpdate
szAppDir := AppendPathDelim(ExtractFilePath(fAppFilename));
// read the VMT once
diff --git a/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip b/components/lazautoupdate/latest_stable/updates/lazautoupdate.zip
index 790f7a8bb..1c787f2cc 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 cf884dd5f..43442831d 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.3.6.0"
+ "Version" : "0.3.7.1"
}
]
}