V0.2.5.0: Cleanup code

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5669 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
gbamber
2017-01-17 10:40:22 +00:00
parent 9571180d03
commit 3bb5d192ae
2 changed files with 44 additions and 25 deletions

View File

@ -8,7 +8,7 @@
<Unit0>
<Filename Value="testapp.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="6"/>
<EditorIndex Value="2"/>
<CursorPos X="33" Y="27"/>
<UsageCount Value="47"/>
<Loaded Value="True"/>
@ -37,22 +37,21 @@
</Unit2>
<Unit3>
<Filename Value="..\lazautoupdate_httpclient.pas"/>
<EditorIndex Value="3"/>
<EditorIndex Value="-1"/>
<CursorPos X="97" Y="12"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<UsageCount Value="23"/>
</Unit3>
<Unit4>
<Filename Value="..\ulazautoupdate.pas"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="4"/>
<CursorPos X="70" Y="493"/>
<EditorIndex Value="1"/>
<CursorPos X="40" Y="10"/>
<ExtraEditorCount Value="2"/>
<ExtraEditor1>
<IsVisibleTab Value="True"/>
<WindowIndex Value="1"/>
<TopLine Value="555"/>
<CursorPos Y="564"/>
<TopLine Value="578"/>
<CursorPos Y="587"/>
</ExtraEditor1>
<ExtraEditor2>
<EditorIndex Value="-1"/>
@ -60,7 +59,7 @@
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
</ExtraEditor2>
<UsageCount Value="22"/>
<UsageCount Value="23"/>
<Loaded Value="True"/>
</Unit4>
<Unit5>
@ -101,11 +100,10 @@
</Unit9>
<Unit10>
<Filename Value="..\..\..\..\applications\foobot\monitor\umainform.pas"/>
<EditorIndex Value="2"/>
<EditorIndex Value="-1"/>
<TopLine Value="25"/>
<CursorPos X="25" Y="55"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<CursorPos X="22" Y="36"/>
<UsageCount Value="21"/>
</Unit10>
<Unit11>
<Filename Value="C:\trunklatest\fpc\rtl\objpas\sysutils\osutilsh.inc"/>
@ -116,11 +114,10 @@
<Unit12>
<Filename Value="..\versionsupport.pas"/>
<UnitName Value="VersionSupport"/>
<EditorIndex Value="5"/>
<TopLine Value="25"/>
<CursorPos X="71" Y="44"/>
<UsageCount Value="17"/>
<Loaded Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="4"/>
<CursorPos X="8" Y="31"/>
<UsageCount Value="18"/>
</Unit12>
<Unit13>
<Filename Value="C:\laztrunk\fpc\examples\httpd22\minimain.pas"/>
@ -149,17 +146,16 @@
<WindowIndex Value="1"/>
<TopLine Value="35"/>
<CursorPos X="40" Y="51"/>
<UsageCount Value="12"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit16>
<Unit17>
<Filename Value="C:\NewPascal\projects\snippets\usefulunits\uuser.pas"/>
<UnitName Value="uUser"/>
<EditorIndex Value="1"/>
<TopLine Value="6"/>
<CursorPos X="33" Y="16"/>
<UsageCount Value="11"/>
<Loaded Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="24"/>
<CursorPos Y="33"/>
<UsageCount Value="12"/>
</Unit17>
</Units>
<JumpHistory Count="30" HistoryIndex="29">

View File

@ -1,8 +1,11 @@
unit ulazautoupdate;
{
LazAutoUpdate (c)2015 Gordon Bamber (minesadorada@charcodelvalle.com)
VersionSupport: Mike Thompson - mike.cornflake@gmail.com
Added to and modified by minesadorada@charcodelvalle.com
Windows admin function: Vincent at freepascal forum
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
@ -55,7 +58,7 @@ const
C_GITHUBFILE_URL_UPDATES = 'https://raw.github.com/%s/%s/%s/%s/%s';
// https://raw.github.com/<username>/<repo>/<branch>/some_directory/file
C_TLazAutoUpdateComponentVersion = '0.2.3';
C_TLazAutoUpdateComponentVersion = '0.2.5';
C_LAUTRayINI = 'lauimport.ini';
{
@ -108,6 +111,8 @@ const
V0.1.26:Updated uses clause for FileUtils.
V0.2.0: Rewritten for 2017
V0.2.4: GitHub integration with branches
V0.2.5: IsWindowsAdministrator check added and property to control it
V0.2.6:
}
C_TThreadedDownloadComponentVersion = '0.0.3';
{
@ -117,6 +122,8 @@ const
}
C_OnlineVersionsININame = 'versions.ini'; // User can change
C_UpdatesFolder = 'updates'; // User can change
// Don't change these without some thought..
C_WhatsNewFilename = 'whatsnew.txt';
C_INISection = 'versions';
C_GUIEntry = 'GUI';
@ -128,6 +135,8 @@ const
{$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';
{$ENDIF}
{$IFDEF LINUX}
{$IFDEF CPU32}C_UPDATER = 'updatehmlinux32';
@ -493,6 +502,20 @@ begin
MessageDlg(rsApplicationU, sMessage, mtInformation, [MBOK], 0);
end;
function IsXP: boolean;
var
osVinfo: TOSVERSIONINFO;
begin
ZeroMemory(@osVinfo, SizeOf(osVinfo));
OsVinfo.dwOSVersionInfoSize := SizeOf(TOSVERSIONINFO);
if ((GetVersionEx(osVInfo) = True) and (osVinfo.dwPlatformId =
VER_PLATFORM_WIN32_NT) and (osVinfo.dwMajorVersion = 5) and
(osVinfo.dwMinorVersion = 1)) then
Result := True
else
Result := False;
end;
function IsWindowsAdmin: Boolean;
const
SECURITY_NT_AUTHORITY: TSIDIdentifierAuthority =