V0.2.3.0: WIP

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5655 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
gbamber
2017-01-15 19:00:32 +00:00
parent fe451a5fc9
commit f092ed6dd7
11 changed files with 197 additions and 82 deletions

View File

@ -55,8 +55,8 @@ More information in the Wiki Home Page http://wiki.freepascal.org/LazAutoUpdater
along with this library; if not, write to the Free Software Foundation, along with this library; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"/> "/>
<Version Minor="2" Release="2"/> <Version Minor="2" Release="3"/>
<Files Count="5"> <Files Count="6">
<Item1> <Item1>
<Filename Value="ulazautoupdate.pas"/> <Filename Value="ulazautoupdate.pas"/>
<HasRegisterProc Value="True"/> <HasRegisterProc Value="True"/>
@ -79,6 +79,10 @@ More information in the Wiki Home Page http://wiki.freepascal.org/LazAutoUpdater
<Filename Value="lazautoupdate_httpclient.pas"/> <Filename Value="lazautoupdate_httpclient.pas"/>
<UnitName Value="lazautoupdate_httpclient"/> <UnitName Value="lazautoupdate_httpclient"/>
</Item5> </Item5>
<Item6>
<Filename Value="open_ssl.pas"/>
<UnitName Value="open_ssl"/>
</Item6>
</Files> </Files>
<i18n> <i18n>
<EnableI18N Value="True"/> <EnableI18N Value="True"/>

View File

@ -4,11 +4,12 @@
unit lazupdate; unit lazupdate;
{$warn 5023 off : no warning about unused units}
interface interface
uses uses
ulazautoupdate, aboutlazautoupdateunit, VersionSupport, uappisrunning, ulazautoupdate, aboutlazautoupdateunit, VersionSupport, uappisrunning,
lazautoupdate_httpclient, LazarusPackageIntf; lazautoupdate_httpclient, open_ssl, LazarusPackageIntf;
implementation implementation

View File

@ -0,0 +1,82 @@
unit open_ssl;
{$mode objfpc}{$H+}
interface
uses
// Built-in: fphttpclient
Classes, SysUtils,lazautoupdate_httpclient,LazFileUtils,FileUtil,zipper;
function CheckForOpenSSL:Boolean;
function OpenSSLInstalled:Boolean;
implementation
const
{$ifdef win64}
cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-x64_86-win64.zip';
{$endif}
{$ifdef win32}
cOpenSSLURL = 'http://packages.lazarus-ide.org/openssl-1.0.2j-i386-win32.zip';
{$endif}
Var FHTTPClient:TFPHttpClient;
function OpenSSLInstalled:Boolean;
begin
{$IFDEF MSWINDOWS}
Result:= FileExistsUTF8(ExtractFilePath(ParamStr(0)) + 'libeay32.dll') and
FileExistsUTF8(ExtractFilePath(ParamStr(0)) + 'ssleay32.dll');
// Look in Windows system dir?
{$ELSE}
Result:=True;
{$ENDIF}
end;
Function CheckForOpenSSL:Boolean;
var
ZipFile: String;
UnZipper: TUnZipper;
begin
{$IFDEF MSWINDOWS}
Result:=FALSE;
if not OpenSSLInstalled then
begin
ZipFile := ExtractFilePath(ParamStr(0)) + ExtractFileName(cOpenSSLURL);
try
FHTTPClient.Get(cOpenSSLURL, ZipFile);
except
end;
if FileExistsUTF8(ZipFile) then
begin
UnZipper := TUnZipper.Create;
try
try
UnZipper.FileName := ZipFile;
UnZipper.Examine;
UnZipper.UnZipAllFiles;
except
end;
finally
UnZipper.Free;
end;
DeleteFileUTF8(ZipFile);
Result:=OpenSSLInstalled;
end;
end
else
Result:=True;
{$ELSE}
Result:=True;
{$ENDIF}
end;
initialization
begin
FHTTPClient:=TFPHttpClient.Create(nil);
end;
finalization
begin
FreeAndNil(FHTTPClient);
end;
end.

View File

@ -0,0 +1,2 @@
http://indy.fulgan.com/SSL/openssl-1.0.2j-i386-win32.zip
http://indy.fulgan.com/SSL/openssl-1.0.2j-x64_86-win64.zip

View File

@ -33,6 +33,7 @@
</Target> </Target>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/> <IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value=".."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
@ -165,7 +166,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item2> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="2"> <Units Count="3">
<Unit0> <Unit0>
<Filename Value="testapp.lpr"/> <Filename Value="testapp.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -177,6 +178,10 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit1> </Unit1>
<Unit2>
<Filename Value="..\open_ssl.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -35,7 +35,7 @@ uses
cthreads, cthreads,
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, umainform Forms, umainform, open_ssl
{ you can add units after this }; { you can add units after this };
{$R *.res} {$R *.res}

View File

@ -4,13 +4,13 @@
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="10"/> <Version Value="10"/>
<BuildModes Active="Win32"/> <BuildModes Active="Win32"/>
<Units Count="12"> <Units Count="13">
<Unit0> <Unit0>
<Filename Value="testapp.lpr"/> <Filename Value="testapp.lpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<CursorPos X="33" Y="27"/> <CursorPos X="33" Y="27"/>
<UsageCount Value="36"/> <UsageCount Value="38"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -19,32 +19,31 @@
<ComponentName Value="mainform"/> <ComponentName Value="mainform"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<TopLine Value="74"/> <TopLine Value="12"/>
<CursorPos X="3" Y="76"/> <CursorPos X="43" Y="13"/>
<UsageCount Value="36"/> <UsageCount Value="38"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit1> </Unit1>
<Unit2> <Unit2>
<Filename Value="..\lazautoupdate_httpclient.pas"/> <Filename Value="..\lazautoupdate_httpclient.pas"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="2"/> <EditorIndex Value="2"/>
<TopLine Value="251"/> <CursorPos X="28" Y="15"/>
<CursorPos X="27" Y="282"/> <UsageCount Value="18"/>
<UsageCount Value="17"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<EditorIndex Value="3"/> <WindowIndex Value="1"/>
<TopLine Value="1210"/> <TopLine Value="28"/>
<CursorPos X="23" Y="1029"/> <CursorPos X="3" Y="746"/>
<ExtraEditorCount Value="2"/> <ExtraEditorCount Value="2"/>
<ExtraEditor1> <ExtraEditor1>
<IsVisibleTab Value="True"/> <EditorIndex Value="3"/>
<WindowIndex Value="1"/> <TopLine Value="1135"/>
<TopLine Value="903"/> <CursorPos X="11" Y="1225"/>
<CursorPos X="6" Y="922"/>
</ExtraEditor1> </ExtraEditor1>
<ExtraEditor2> <ExtraEditor2>
<EditorIndex Value="-1"/> <EditorIndex Value="-1"/>
@ -52,7 +51,7 @@
<TopLine Value="-1"/> <TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/> <CursorPos X="-1" Y="-1"/>
</ExtraEditor2> </ExtraEditor2>
<UsageCount Value="17"/> <UsageCount Value="18"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
@ -96,7 +95,7 @@
<EditorIndex Value="1"/> <EditorIndex Value="1"/>
<TopLine Value="25"/> <TopLine Value="25"/>
<CursorPos X="25" Y="55"/> <CursorPos X="25" Y="55"/>
<UsageCount Value="15"/> <UsageCount Value="16"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
@ -111,130 +110,140 @@
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<TopLine Value="25"/> <TopLine Value="25"/>
<CursorPos X="71" Y="44"/> <CursorPos X="71" Y="44"/>
<UsageCount Value="12"/> <UsageCount Value="13"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit11> </Unit11>
<Unit12>
<Filename Value="..\open_ssl.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="1"/>
<TopLine Value="22"/>
<CursorPos X="25" Y="35"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit12>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="30" HistoryIndex="29">
<Position1> <Position1>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="910" Column="37" TopLine="872"/> <Caret Line="182" Column="58" TopLine="154"/>
</Position1> </Position1>
<Position2> <Position2>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="1062" Column="3" TopLine="1021"/> <Caret Line="913" Column="35" TopLine="875"/>
</Position2> </Position2>
<Position3> <Position3>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="51" Column="9" TopLine="25"/> <Caret Line="123" Column="52" TopLine="115"/>
</Position3> </Position3>
<Position4> <Position4>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="900" Column="21" TopLine="894"/> <Caret Line="56" Column="3" TopLine="33"/>
</Position4> </Position4>
<Position5> <Position5>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="371" TopLine="351"/> <Caret Line="165" Column="36" TopLine="147"/>
</Position5> </Position5>
<Position6> <Position6>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="909" Column="37" TopLine="891"/> <Caret Line="913" Column="38" TopLine="891"/>
</Position6> </Position6>
<Position7> <Position7>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="1071" Column="38" TopLine="1039"/> <Caret Line="1074" Column="38" TopLine="1053"/>
</Position7> </Position7>
<Position8> <Position8>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="48" Column="19" TopLine="25"/> <Caret Line="182" Column="51" TopLine="159"/>
</Position8> </Position8>
<Position9> <Position9>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="923" TopLine="887"/> <Caret Line="935" TopLine="900"/>
</Position9> </Position9>
<Position10> <Position10>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="1075" TopLine="1040"/> <Caret Line="1059" TopLine="1037"/>
</Position10> </Position10>
<Position11> <Position11>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="48" Column="19" TopLine="25"/> <Caret Line="1974" TopLine="1945"/>
</Position11> </Position11>
<Position12> <Position12>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="929" TopLine="890"/> <Caret Line="54" Column="18" TopLine="44"/>
</Position12> </Position12>
<Position13> <Position13>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="182" Column="58" TopLine="154"/> <Caret Line="935" Column="89" TopLine="901"/>
</Position13> </Position13>
<Position14> <Position14>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="913" Column="35" TopLine="875"/> <Caret Line="108" Column="43" TopLine="88"/>
</Position14> </Position14>
<Position15> <Position15>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="123" Column="52" TopLine="115"/> <Caret Line="51" Column="20" TopLine="35"/>
</Position15> </Position15>
<Position16> <Position16>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="56" Column="3" TopLine="33"/> <Caret Line="914" TopLine="893"/>
</Position16> </Position16>
<Position17> <Position17>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="165" Column="36" TopLine="147"/> <Caret Line="1076" TopLine="1039"/>
</Position17> </Position17>
<Position18> <Position18>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\ulazautoupdate.pas"/>
<Caret Line="913" Column="38" TopLine="891"/> <Caret Line="180" Column="33" TopLine="157"/>
</Position18> </Position18>
<Position19> <Position19>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="1074" Column="38" TopLine="1053"/> <Caret Line="76" Column="3" TopLine="74"/>
</Position19> </Position19>
<Position20> <Position20>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="182" Column="51" TopLine="159"/> <Caret Line="129" Column="3" TopLine="92"/>
</Position20> </Position20>
<Position21> <Position21>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="umainform.pas"/>
<Caret Line="935" TopLine="900"/> <Caret Line="122" Column="3" TopLine="92"/>
</Position21> </Position21>
<Position22> <Position22>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="1059" TopLine="1037"/> <Caret Line="8" Column="25"/>
</Position22> </Position22>
<Position23> <Position23>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="1974" TopLine="1945"/> <Caret Line="6" Column="43"/>
</Position23> </Position23>
<Position24> <Position24>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="54" Column="18" TopLine="44"/> <Caret Line="8" Column="37"/>
</Position24> </Position24>
<Position25> <Position25>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="935" Column="89" TopLine="901"/> <Caret Line="25" Column="26" TopLine="5"/>
</Position25> </Position25>
<Position26> <Position26>
<Filename Value="umainform.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="108" Column="43" TopLine="88"/> <Caret Line="8" Column="47"/>
</Position26> </Position26>
<Position27> <Position27>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="51" Column="20" TopLine="35"/> <Caret Line="71" Column="23" TopLine="32"/>
</Position27> </Position27>
<Position28> <Position28>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="914" TopLine="893"/> <Caret Line="68" Column="27" TopLine="34"/>
</Position28> </Position28>
<Position29> <Position29>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="1076" TopLine="1039"/> <Caret Line="48" Column="6" TopLine="25"/>
</Position29> </Position29>
<Position30> <Position30>
<Filename Value="..\ulazautoupdate.pas"/> <Filename Value="..\open_ssl.pas"/>
<Caret Line="180" Column="33" TopLine="157"/> <Caret Line="29" Column="18"/>
</Position30> </Position30>
</JumpHistory> </JumpHistory>
</ProjectSession> </ProjectSession>

View File

@ -1,7 +1,7 @@
object mainform: Tmainform object mainform: Tmainform
Left = 716 Left = 682
Height = 209 Height = 209
Top = 296 Top = 277
Width = 335 Width = 335
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
Caption = 'mainform' Caption = 'mainform'
@ -112,7 +112,7 @@ object mainform: Tmainform
OnDownloaded = LazAutoUpdate1Downloaded OnDownloaded = LazAutoUpdate1Downloaded
OnDebugEvent = LazAutoUpdate1DebugEvent OnDebugEvent = LazAutoUpdate1DebugEvent
SFProjectName = 'lazautoupdate' SFProjectName = 'lazautoupdate'
auOtherSourceURL = '<not applicable>' auOtherSourceURL = '<not applicable>/'
auOtherSourceFilename = '<not applicable>' auOtherSourceFilename = '<not applicable>'
CopyTree = False CopyTree = False
UpdatesFolder = 'updates' UpdatesFolder = 'updates'

View File

@ -39,7 +39,7 @@ uses
LazUTF8, FileUtil, LazFileUtils, Dialogs, StdCtrls, LazUTF8, FileUtil, LazFileUtils, Dialogs, StdCtrls,
Buttons, DateUtils, asyncprocess, zipper, LResources, Buttons, DateUtils, asyncprocess, zipper, LResources,
VersionSupport, inifiles, aboutlazautoupdateunit, uappisrunning, LCLProc, VersionSupport, inifiles, aboutlazautoupdateunit, uappisrunning, LCLProc,
fileinfo, winpeimagereader {need this for reading exe info} fileinfo,open_ssl, winpeimagereader {need this for reading exe info}
, elfreader {needed for reading ELF executables} , elfreader {needed for reading ELF executables}
, machoreader {needed for reading MACH-O executables} , machoreader {needed for reading MACH-O executables}
{$IFDEF WINDOWS}, Windows, ShellAPI{$ENDIF}; // Thanks to Windows 10 and 704 error {$IFDEF WINDOWS}, Windows, ShellAPI{$ENDIF}; // Thanks to Windows 10 and 704 error
@ -48,10 +48,12 @@ const
C_SOURCEFORGEURL = C_SOURCEFORGEURL =
'https://sourceforge.net/projects/%s/files/%s/%s/download'; 'https://sourceforge.net/projects/%s/files/%s/%s/download';
// [updatepath,projectname,filename] // [updatepath,projectname,filename]
C_GITHUBFILEURL = 'https://raw.github.com/%s/%s/master/%s/%s'; // C_GITHUBFILE_URL = 'https://raw.github.com/%s/%s/master/%s/%s';
C_GITHUBFILE_URL = 'https://raw.github.com/%s/%s/%s/%s/%s';
C_GITHUBFILE_URL_UPDATES = 'https://raw.github.com/%s/%s/%s/%s/%s/%s';
// https://raw.github.com/<username>/<repo>/<branch>/some_directory/file // https://raw.github.com/<username>/<repo>/<branch>/some_directory/file
// GitHubUserName,GitHubProjectName,updatepath,filename // GitHubUserName,GitHubProjectName,updatepath,filename
C_TLazAutoUpdateComponentVersion = '0.2.2'; C_TLazAutoUpdateComponentVersion = '0.2.3';
C_LAUTRayINI = 'lauimport.ini'; C_LAUTRayINI = 'lauimport.ini';
{ {
@ -116,6 +118,7 @@ const
C_INISection = 'versions'; C_INISection = 'versions';
C_GUIEntry = 'GUI'; C_GUIEntry = 'GUI';
C_ModuleEntry = 'Module'; C_ModuleEntry = 'Module';
C_MASTER = 'master';
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
{$IFDEF CPU32}C_UPDATER = 'updatehmwin32.exe'; {$IFDEF CPU32}C_UPDATER = 'updatehmwin32.exe';
C_LOCALUPDATER = 'lauupdatewin32.exe';{$ENDIF} C_LOCALUPDATER = 'lauupdatewin32.exe';{$ENDIF}
@ -177,7 +180,7 @@ type
type type
TProjectType = (auSourceForge,auGitHubUpdateZip, auOther); TProjectType = (auSourceForge,auGitHubReleaseZip,auOther);
// Array of these records used for multiple updates // Array of these records used for multiple updates
UpdateListRecord = record UpdateListRecord = record
PrettyName: string; PrettyName: string;
@ -199,6 +202,7 @@ type
fSourceForgeProjectName: string; fSourceForgeProjectName: string;
fGitHubUsername:String; fGitHubUsername:String;
fGitHubProjectName:String; fGitHubProjectName:String;
fGitHubBranch:String;
fApplicationVersionString: string; fApplicationVersionString: string;
fApplicationVersionQuad: TVersionQuad; fApplicationVersionQuad: TVersionQuad;
fGuiQuad: TVersionQuad; fGuiQuad: TVersionQuad;
@ -367,7 +371,7 @@ type
property UpdateExeSilent:String read fUpdateSilentExe; property UpdateExeSilent:String read fUpdateSilentExe;
property GitHubUsername:String read fGitHubUsername write fGitHubUsername; property GitHubUsername:String read fGitHubUsername write fGitHubUsername;
Property GitHubProjectName:String read fGitHubProjectName write fGitHubProjectName; Property GitHubProjectName:String read fGitHubProjectName write fGitHubProjectName;
Property GitHubBranch:String read fGitHubBranch write fGitHubBranch;
end; end;
{TThreadedDownload } {TThreadedDownload }
@ -882,7 +886,6 @@ var
szOldCaption: string; szOldCaption: string;
begin begin
Result := False; Result := False;
// read the VMT once // read the VMT once
if Assigned(fOndebugEvent) then if Assigned(fOndebugEvent) then
fFireDebugEvent := True; fFireDebugEvent := True;
@ -908,7 +911,7 @@ begin
szURL := Format(C_SOURCEFORGEURL, [fSourceForgeProjectName, szURL := Format(C_SOURCEFORGEURL, [fSourceForgeProjectName,
fUpdatesFolder, fVersionsININame]); fUpdatesFolder, fVersionsININame]);
end; end;
if fProjectType = auGitHubUpdateZip then if fProjectType = auGitHubReleaseZip then
begin begin
if ((fGitHubUserName = '') or (fGitHubProjectName = '')) then if ((fGitHubUserName = '') or (fGitHubProjectName = '')) then
begin begin
@ -918,8 +921,8 @@ begin
fOndebugEvent(Self, 'NewVersionAvailable', C_PropIsEmpty); fOndebugEvent(Self, 'NewVersionAvailable', C_PropIsEmpty);
Exit; Exit;
end; end;
szURL := Format(C_GITHUBFILEURL, szURL := Format(C_GITHUBFILE_URL,
[fGitHubUserName,fGitHubProjectName,fUpdatesFolder,fVersionsININame]); [fGitHubUserName,fGitHubProjectName,fGitHubBranch,fVersionsININame]);
end; end;
if fProjectType = auOther then if fProjectType = auOther then
// fauOtherSourceURL ends with '/' // fauOtherSourceURL ends with '/'
@ -967,6 +970,7 @@ begin
fDownloadInprogress := True; fDownloadInprogress := True;
if not fSilentMode then if not fSilentMode then
fParentForm.Caption := C_Checking; fParentForm.Caption := C_Checking;
CheckForOpenSSL;
// Start the thread // Start the thread
ThreadDownloadHTTP; ThreadDownloadHTTP;
if fFireDebugEvent then if fFireDebugEvent then
@ -1070,8 +1074,11 @@ begin
if fProjectType = auSourceForge then if fProjectType = auSourceForge then
szURL := Format(C_SOURCEFORGEURL, [fSourceForgeProjectName, fUpdatesFolder, szURL := Format(C_SOURCEFORGEURL, [fSourceForgeProjectName, fUpdatesFolder,
ExtractFileName(szTargetPath)]); ExtractFileName(szTargetPath)]);
if fProjectType = auGitHubUpdateZip then if fProjectType = auGitHubReleaseZip then
szURL := Format(C_GITHUBFILEURL, [fGitHubUserName,fGitHubProjectName,fUpdatesFolder,fZipfileName]); If ((fUpdatesFolder=C_NotApplicable) or (fUpdatesFolder='')) then
szURL := Format(C_GITHUBFILE_URL, [fGitHubUserName,fGitHubProjectName,fGitHubBranch,fZipfileName])
else
szURL := Format(C_GITHUBFILE_URL_UPDATES, [fGitHubUserName,fGitHubProjectName,fGitHubBranch,fUpdatesFolder,fZipfileName]);
if fProjectType = auOther then if fProjectType = auOther then
// fauOtherSourceURL ends with '/' // fauOtherSourceURL ends with '/'
begin begin
@ -1152,6 +1159,7 @@ begin
end; end;
fDownloadInprogress := True; fDownloadInprogress := True;
CheckForOpenSSL;
// Do the download // Do the download
with fThreadDownload do with fThreadDownload do
begin begin
@ -1931,6 +1939,7 @@ begin
fSourceForgeProjectName := C_NotApplicable; fSourceForgeProjectName := C_NotApplicable;
fGitHubProjectName := C_NotApplicable; fGitHubProjectName := C_NotApplicable;
fGitHubUserName := C_NotApplicable; fGitHubUserName := C_NotApplicable;
fGitHubBranch:=C_NotApplicable;
fauOtherSourceFilename:=''; fauOtherSourceFilename:='';
fauOtherSourceURL:=''; fauOtherSourceURL:='';
end; end;
@ -1942,16 +1951,19 @@ begin
fauOtherSourceURL := C_NotApplicable; fauOtherSourceURL := C_NotApplicable;
fGitHubProjectName := C_NotApplicable; fGitHubProjectName := C_NotApplicable;
fGitHubUserName := C_NotApplicable; fGitHubUserName := C_NotApplicable;
fGitHubBranch:=C_NotApplicable;
end; end;
if fProjectType = auGitHubUpdateZip then if fProjectType = auGitHubReleaseZip then
begin begin
fZipFileName:=ChangeFileExt(fVersionsININame,'.zip'); fZipFileName:=ChangeFileExt(fVersionsININame,'.zip');
fUpdatesFolder := C_UpdatesFolder; fUpdatesFolder := C_UpdatesFolder;
fSourceForgeProjectName := C_NotApplicable; fSourceForgeProjectName := C_NotApplicable;
fauOtherSourceFilename := C_NotApplicable; fauOtherSourceFilename := C_NotApplicable;
fauOtherSourceURL := C_NotApplicable; fauOtherSourceURL := C_NotApplicable;
fGitHubBranch:= C_MASTER;
fGitHubProjectName := ''; fGitHubProjectName := '';
fGitHubUserName := ''; fGitHubUserName := '';
fUpdatesFolder:=C_NotApplicable;
end; end;

View File

@ -9,7 +9,7 @@
"ForceNotify" : true, "ForceNotify" : true,
"InternalVersion" : 2, "InternalVersion" : 2,
"Name" : "lazupdate.lpk", "Name" : "lazupdate.lpk",
"Version" : "0.2.2.0" "Version" : "0.2.3.0"
} }
] ]
} }