You've already forked lazarus-ccr
TrayIcon for LazAutoUpdate.
Initial Commit git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5687 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="LazUpdate Updater"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
<XPManifest>
|
||||
<ExecutionLevel Value="highestAvailable"/>
|
||||
<UIAccess Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<RevisionNr Value="4"/>
|
||||
<StringTable Comments="lauupdate -h for list of parameters" CompanyName="minesadorada@charcodelvalle.com" FileDescription="Console updater for LazAutoUpdate systray component" InternalName="lauupdate" LegalCopyright="LGPLv2" OriginalFilename="lauupdate" ProductName="LazAutoUpdate" ProductVersion="0.0.3.0"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="4">
|
||||
<Item1 Name="Win32 Release" Default="True"/>
|
||||
<Item2 Name="Win64 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\compiledlauupdate\win64\lauupdatewin64"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="x86_64"/>
|
||||
<TargetOS Value="win64"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
<SmallerCode Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item2>
|
||||
<Item3 Name="Linux32 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\compiledlauupdate\linux32\lauupdatelinux32"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="i386"/>
|
||||
<TargetOS Value="linux"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
<SmallerCode Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item3>
|
||||
<Item4 Name="Linux64 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\compiledlauupdate\linux64\lauupdatelinux64"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="x86_64"/>
|
||||
<TargetOS Value="linux"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
<SmallerCode Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item4>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<CommandLineParams Value="healthmonitor32sqlite3.exe"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LCLBase"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LazUtils"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\compiledlauupdate\win32\lauupdatewin32"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="i386"/>
|
||||
<TargetOS Value="win32"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
<SmallerCode Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="10"/>
|
||||
<BuildModes Active="Linux64 Release"/>
|
||||
<Units Count="25">
|
||||
<Unit0>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="98"/>
|
||||
<CursorPos X="68" Y="105"/>
|
||||
<UsageCount Value="77"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="..\copydir.pas"/>
|
||||
<TopLine Value="333"/>
|
||||
<CursorPos X="22" Y="333"/>
|
||||
<UsageCount Value="32"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\upoweredby.pas"/>
|
||||
<TopLine Value="6"/>
|
||||
<CursorPos X="47" Y="27"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="D:\Lazarus32_production\components\splashabout\usplashabout.pas"/>
|
||||
<TopLine Value="65"/>
|
||||
<CursorPos X="79" Y="86"/>
|
||||
<UsageCount Value="6"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="..\ulazautoupdate.pas"/>
|
||||
<TopLine Value="112"/>
|
||||
<CursorPos X="43" Y="24"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="..\..\..\..\healthmonitor\svn\trunk\updatefromsourceforge.pas"/>
|
||||
<TopLine Value="22"/>
|
||||
<CursorPos X="44" Y="49"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="D:\Lazarus32_production\components\ideintf\propedits.pp"/>
|
||||
<TopLine Value="619"/>
|
||||
<UsageCount Value="7"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="D:\Lazarus32_production\components\lazutils\fileutil.pas"/>
|
||||
<TopLine Value="76"/>
|
||||
<CursorPos X="9" Y="77"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="..\..\..\..\copydir.pas"/>
|
||||
<TopLine Value="94"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="D:\development\fpc\rtl\objpas\sysutils\osutilsh.inc"/>
|
||||
<CursorPos Y="27"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="D:\development\lazarus\lcl\extctrls.pp"/>
|
||||
<TopLine Value="165"/>
|
||||
<CursorPos X="47" Y="198"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="D:\development\lazarus\lcl\customtimer.pas"/>
|
||||
<TopLine Value="91"/>
|
||||
<CursorPos X="30" Y="129"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="D:\development\lazarus\lcl\interfacebase.pp"/>
|
||||
<CursorPos X="19" Y="18"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="D:\development\fpc\rtl\linux\linux.pp"/>
|
||||
<CursorPos X="45" Y="28"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="D:\development\fpc\packages\fcl-base\src\eventlog.pp"/>
|
||||
<TopLine Value="70"/>
|
||||
<CursorPos X="30" Y="26"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="D:\development\lazarus\components\lazutils\fileutil.pas"/>
|
||||
<TopLine Value="194"/>
|
||||
<CursorPos X="21" Y="218"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit15>
|
||||
<Unit16>
|
||||
<Filename Value="D:\development\lazarus\components\lazutils\fileutil.inc"/>
|
||||
<TopLine Value="680"/>
|
||||
<CursorPos X="3" Y="714"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
<Filename Value="D:\development\fpc\rtl\objpas\dateutils.pp"/>
|
||||
<CursorPos X="13"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit17>
|
||||
<Unit18>
|
||||
<Filename Value="D:\development\fpc\rtl\objpas\dateutil.inc"/>
|
||||
<TopLine Value="196"/>
|
||||
<CursorPos X="29" Y="214"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit18>
|
||||
<Unit19>
|
||||
<Filename Value="D:\development\fpc\rtl\objpas\dateutil.pp"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="103"/>
|
||||
<CursorPos X="43" Y="126"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
<Filename Value="..\updatepack\updatepack.lpr"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="89" Y="24"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<Filename Value="..\packagesource\ulazautoupdate.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<TopLine Value="1376"/>
|
||||
<CursorPos X="54" Y="1392"/>
|
||||
<UsageCount Value="11"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\strutils.pp"/>
|
||||
<TopLine Value="277"/>
|
||||
<CursorPos X="3" Y="279"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
<Filename Value="..\..\updatehmsource\updatehm.lpr"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<TopLine Value="124"/>
|
||||
<CursorPos Y="162"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit24>
|
||||
</Units>
|
||||
<JumpHistory Count="5" HistoryIndex="4">
|
||||
<Position1>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<Caret Line="67" Column="12" TopLine="46"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<Caret Line="49" Column="5" TopLine="26"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<Caret Line="65" Column="21" TopLine="31"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<Caret Line="44" Column="16" TopLine="20"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="lauupdate.pas"/>
|
||||
<Caret Line="187" Column="25" TopLine="298"/>
|
||||
</Position5>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
@ -0,0 +1,352 @@
|
||||
program lauupdate;
|
||||
|
||||
{ LazAutoUpdate companion application
|
||||
This application should be deployed in the same directory
|
||||
as any application that uses the LazAutoUpdate component.
|
||||
Actions:
|
||||
1. Checks for correct parameters
|
||||
2. Copies a whatsnew.txt file from the updates directory to the ProgramDirectory
|
||||
3. Waits for 2 seconds whilst the calling app shuts itself down
|
||||
4. If present, copies TrayNotifier info to the common data directory
|
||||
and adds a new entry: Location=<ProgramDirectory>
|
||||
5(a) If CopyTree=TRUE, copies the whole directory tree from
|
||||
the updates folder to the ProgramDirectory
|
||||
5(b) If CopyTree=FALSE, copies the new executable from the
|
||||
updates folder to the ProgramDirectory
|
||||
6. Uses TProcess to start up the new executable
|
||||
7. Closes.
|
||||
|
||||
Note that an application log (C_LogFileName) is written anew, and
|
||||
can be checked for error information
|
||||
|
||||
Copyright (C)2014 Gordon Bamber (minesadorada@charcodelvalle.com)
|
||||
|
||||
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
|
||||
option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
|
||||
for more details.
|
||||
|
||||
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.
|
||||
}
|
||||
|
||||
// Takes 5 parameters
|
||||
|
||||
{$ifdef Linux}
|
||||
|
||||
{$ifdef FPC_CROSSCOMPILING}
|
||||
|
||||
{$ifdef CPUARM}
|
||||
//if GUI, then uncomment
|
||||
|
||||
//{$linklib GLESv2}
|
||||
|
||||
{$endif}
|
||||
|
||||
{$linklib libc_nonshared.a}
|
||||
|
||||
{$endif}
|
||||
|
||||
{$endif}
|
||||
uses
|
||||
SysUtils,
|
||||
LazFileUtils,
|
||||
FileUtil,
|
||||
LazUTF8,
|
||||
process,
|
||||
eventlog,
|
||||
DateUtils,
|
||||
inifiles,
|
||||
Classes;
|
||||
|
||||
|
||||
{$R *.res}
|
||||
const
|
||||
{$IFDEF WINDOWS}
|
||||
C_OS = 'win';
|
||||
{$ELSE}
|
||||
C_OS = 'linux';
|
||||
{$ENDIF}
|
||||
{$IFDEF CPU32}
|
||||
C_BITNESS = '32';
|
||||
{$ELSE}
|
||||
C_BITNESS = '64';
|
||||
{$ENDIF}
|
||||
C_PFX = C_OS + C_BITNESS;
|
||||
C_Version = '0.0.4';
|
||||
C_LogFileName = 'lauupdatelog.txt';
|
||||
C_LAUTRayINI = 'lauimport.ini';
|
||||
{$IFDEF WINDOWS}
|
||||
C_LAUTrayApp = 'lautraynotify' + C_PFX + '.exe';
|
||||
{$ELSE}
|
||||
C_LAUTrayApp = 'lautraynotify' + C_PFX;
|
||||
{$ENDIF}
|
||||
|
||||
var
|
||||
szBasePath,szAppPath, szUpdatesFolder, szWhatsNewName, szPrettyName: string;
|
||||
szUpdatedEXEPath, szOldEXEPath: string;
|
||||
szUpdatedWNPath, szOldWNPath: string;
|
||||
szUpdatesFullPath: string;
|
||||
AppProcess: TProcess;
|
||||
Logger: TEventLog;
|
||||
bCopyTreeSuccess: boolean;
|
||||
szLAUTrayAppPath: string;
|
||||
INI: TINIFile;
|
||||
SectionStringList: TStrings;
|
||||
|
||||
procedure WaitFor(const MillisecondDelay: longword);
|
||||
// Linux - this proc is intentionally thread-blocking
|
||||
var
|
||||
ThisSecond: longword;
|
||||
begin
|
||||
ThisSecond := MilliSecondOfTheDay(Now);
|
||||
while MilliSecondOfTheDay(Now) < (ThisSecond + MillisecondDelay) do ;
|
||||
end;
|
||||
|
||||
procedure WriteAndLog(szText: string);
|
||||
begin
|
||||
Logger.Info(szText);
|
||||
writeln(szText);
|
||||
end;
|
||||
|
||||
begin
|
||||
if ParamCount = 0 then
|
||||
begin
|
||||
Writeln(LineEnding + '==== lauupdate v' + C_Version +
|
||||
' - an lazautoupdate application ====');
|
||||
Writeln('Usage: lauupdate exename.exe [updatesfoldername] [whatnewfilename] [exePrettyName] [copytree]');
|
||||
WriteLn('Press any key to continue');
|
||||
Readln;
|
||||
Halt;
|
||||
end;
|
||||
|
||||
if (ParamStrUTF8(1) = '-h') or (ParamStrUTF8(1) = '/h') then
|
||||
begin
|
||||
WriteLn('==========================================================');
|
||||
Writeln('Normal usage: lauupdate exename.exe [updatesfoldername] [whatnewfilename] [exePrettyName] [copytree]');
|
||||
WriteLn('- where exename.exe is a single application to be updated');
|
||||
WriteLn(LineEnding);
|
||||
WriteLn('optional parameters are');
|
||||
WriteLn('-h or /h - this screen');
|
||||
WriteLn('==========================================================');
|
||||
WriteLn('Press any key to continue');
|
||||
Readln;
|
||||
Halt;
|
||||
end;
|
||||
|
||||
Logger := TEventLog.Create(nil);
|
||||
TRY
|
||||
Logger.LogType := ltFile;
|
||||
Logger.FileName := C_LogFileName;
|
||||
if FileExistsUTF8(C_LogFileName) then
|
||||
DeleteFile(C_LogFileName);
|
||||
Logger.Active := True;
|
||||
Logger.Info('Start of Log');
|
||||
except
|
||||
Logger.Active := False;
|
||||
FreeAndNil(Logger);
|
||||
Halt(1);
|
||||
end;
|
||||
|
||||
bCopyTreeSuccess := False;
|
||||
|
||||
szAppPath := ParamStrUTF8(1);
|
||||
if szAppPath = '' then
|
||||
begin
|
||||
WriteAndLog('Quitting. Application path missing in 1st parameter');
|
||||
Halt;
|
||||
end;
|
||||
|
||||
szUpdatesFolder := ParamStrUTF8(2);
|
||||
if szUpdatesFolder = '' then
|
||||
begin
|
||||
WriteAndLog('Quitting. Updates folder missing in 2nd parameter');
|
||||
Halt;
|
||||
end;
|
||||
|
||||
szWhatsNewName := ParamStrUTF8(3);
|
||||
if szWhatsNewName = '' then
|
||||
begin
|
||||
WriteAndLog('Quitting. WhatsNew filename missing in 3rd parameter');
|
||||
Halt;
|
||||
end;
|
||||
|
||||
szPrettyName := ParamStrUTF8(4);
|
||||
if szPrettyName = '' then
|
||||
begin
|
||||
WriteAndLog('Quitting. App display name missing in 4th parameter');
|
||||
Halt;
|
||||
end;
|
||||
|
||||
WriteAndLog('lauupdate.exe version ' + C_Version);
|
||||
Logger.Info('Given parameters follow:');
|
||||
Logger.Info('App name = ' + szAppPath);
|
||||
Logger.Info('Updates folder = ' + szUpdatesFolder);
|
||||
Logger.Info('WhatsNew filename = ' + szWhatsNewName);
|
||||
Logger.Info('Pretty Name = ' + szPrettyName);
|
||||
if ParamStrUTF8(5) = 'copytree' then
|
||||
Logger.Info('CopyTree = TRUE')
|
||||
else
|
||||
Logger.Info('CopyTree = FALSE');
|
||||
WriteAndLog('Please wait. Updating ' + szPrettyName + '....');
|
||||
// Set up paths
|
||||
|
||||
szBasePath:=AppendPathDelim(ExtractFilePath(szAppPath));
|
||||
szOldEXEPath := CleanAndExpandFilename(szAppPath);
|
||||
Logger.Info('Application path = ' + szOldEXEPath);
|
||||
|
||||
szUpdatedEXEPath := CleanAndExpandFilename(szBasePath +
|
||||
szUpdatesFolder + PathDelim + ExtractFileName(szAppPath));
|
||||
Logger.Info('Updated application path = ' + szUpdatedEXEPath);
|
||||
szOldWNPath := CleanAndExpandFilename(szBasePath + szWhatsNewName);
|
||||
Logger.Info('WhatsNew path = ' + szOldWNPath);
|
||||
szUpdatedWNPath := CleanAndExpandFilename(szBasePath +
|
||||
szUpdatesFolder + PathDelim + szWhatsNewName);
|
||||
Logger.Info('Updated whatsNew path = ' + szUpdatedWNPath);
|
||||
|
||||
if not FileExistsUTF8(szUpdatedEXEPath) then
|
||||
begin
|
||||
WriteAndLog('Couldn''t find szUpdatedEXEPath');
|
||||
Logger.Active := False;
|
||||
FreeAndNil(Logger);
|
||||
Halt(1);
|
||||
end;
|
||||
|
||||
|
||||
if FileExistsUTF8(szUpdatedWNPath) then
|
||||
begin
|
||||
// Write a file to disk that the app keeps checking for.
|
||||
try
|
||||
Fileutil.CopyFile(szUpdatedWNPath, szOldWNPath, [cffOverWriteFile]);
|
||||
WriteAndLog('Writing.. ' + szWhatsNewName);
|
||||
except
|
||||
On E: Exception do
|
||||
begin
|
||||
WriteAndLog(Format('There was a problem writing %s. Reason: %s',
|
||||
[szWhatsNewName, E.Message]));
|
||||
Logger.Active := False;
|
||||
FreeAndNil(Logger);
|
||||
Halt(1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
// The calling app is in a loop - waiting to detect
|
||||
// a Whatsnew file in it's home directory
|
||||
// As soon as the call: If FileExists(WhatsNew) returns TRUE
|
||||
// then the app will close itself
|
||||
// The following code is to give the App time to do all this..
|
||||
{$IFDEF HAS_SLEEP}
|
||||
WriteAndLog('Sleeping...');
|
||||
Sleep(2000); // give time for calling app to close
|
||||
{$ELSE}
|
||||
WriteAndLog('Waiting 2 seconds...');
|
||||
WaitFor(2000);
|
||||
{$ENDIF}
|
||||
// App should now be closed. OK to overwrite it.
|
||||
|
||||
// Define Updates directory
|
||||
szUpdatesFullPath := CleanAndExpandDirectory(szBasePath + szUpdatesFolder);
|
||||
|
||||
// Deal with C_LAUTRayINI
|
||||
// Copied to the global application data folder
|
||||
// Add entry 'Location'
|
||||
if FileExistsUTF8(szUpdatesFullPath + C_LAUTRayINI) then
|
||||
begin
|
||||
szLAUTrayAppPath := GetAppConfigDirUTF8(False, True);
|
||||
szLAUTrayAppPath := StringReplace(szLAUTrayAppPath,'lauupdate','updatehm',[rfIgnoreCase]);
|
||||
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
|
||||
INI := TINIFile.Create(szLAUTrayAppPath + C_LAUTRayINI);
|
||||
SectionStringList := TStringList.Create;
|
||||
try
|
||||
INI.ReadSections(SectionStringList);
|
||||
if SectionStringList.Count > 0 then
|
||||
begin
|
||||
INI.WriteString(SectionStringList[0], 'Location', szBasePath);
|
||||
WriteAndLog(Format('Wrote new entry in section %s. Location=%s',
|
||||
[SectionStringList[0], szBasePath]));
|
||||
end
|
||||
else
|
||||
WriteAndLog('Failed to find a valid section in ' + C_LAUTRayINI);
|
||||
finally
|
||||
FreeAndNil(SectionStringList);
|
||||
FreeAndNil(INI);
|
||||
end;
|
||||
end
|
||||
else
|
||||
WriteAndLog('Failed to copy ' + C_LAUTRayINI + ' to ' + szLAUTrayAppPath);
|
||||
except
|
||||
On E: Exception do
|
||||
WriteAndLog(Format('Could not copy %s. Error: %s ', [C_LAUTrayApp, E.Message]));
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
// If CopyTree, then just copy the whole of the /updates folder (inc directories) to the App Directory
|
||||
try
|
||||
if ParamStrUTF8(5) = 'copytree' then
|
||||
// Copy a whole directory tree?
|
||||
bCopyTreeSuccess := CopyDirTree(szUpdatesFullPath, szBasePath,
|
||||
[cffOverwriteFile, cffCreateDestDirectory]);
|
||||
except
|
||||
On E: Exception do
|
||||
WriteAndLog('Copytree error: ' + E.Message);
|
||||
end;
|
||||
|
||||
// CopyTree not specified, or operation failed
|
||||
// Just copy the updated app over the old one
|
||||
if FileExistsUTF8(szUpdatedEXEPath) then
|
||||
begin
|
||||
if (bCopyTreeSuccess = False) then
|
||||
// Copy over exe file
|
||||
if Fileutil.CopyFile(szUpdatedEXEPath, szOldEXEPath, [cffOverWriteFile]) then
|
||||
begin
|
||||
WriteAndLog('Copying over executeable, then sleeping...');
|
||||
{$IFDEF HAS_SLEEP}
|
||||
WriteAndLog('Sleeping...');
|
||||
Sleep(1000); // give more time for calling app to close
|
||||
{$ELSE}
|
||||
WriteAndLog('Waiting 1 second...');
|
||||
WaitFor(1000);
|
||||
{$ENDIF}
|
||||
end
|
||||
else
|
||||
WriteAndLog('Copy to ' + szUpdatedEXEPath + ' failed');
|
||||
|
||||
// Restart updated app
|
||||
if FileExistsUTF8(szOldEXEPath) then
|
||||
begin
|
||||
WriteAndLog('Restarting ' + szPrettyName + '...');
|
||||
AppProcess := TProcess.Create(nil);
|
||||
try
|
||||
AppProcess.CurrentDirectory := szBasePath;
|
||||
AppProcess.Executable := szOldEXEPath;
|
||||
AppProcess.StartupOptions := [suoUseShowWindow];
|
||||
AppProcess.Execute;
|
||||
finally
|
||||
AppProcess.Free;
|
||||
end;
|
||||
end
|
||||
else
|
||||
WriteAndLog('Failure. Couldn''t find ' + szOldEXEPath);
|
||||
end
|
||||
else
|
||||
WriteAndLog('Failure. Couldn''t find ' + szUpdatedEXEPath);
|
||||
|
||||
Logger.Info('End of Log');
|
||||
Logger.Active := False;
|
||||
FreeAndNil(Logger);
|
||||
end.
|
Binary file not shown.
@ -0,0 +1,143 @@
|
||||
msgid "to happen.to happen.to happen."
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Run at startup..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_test.caption
|
||||
msgid "Test"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s Notifier"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_deleteappprofile.caption
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_lastupdated.caption
|
||||
msgid "Last updated: never"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_about.caption
|
||||
msgid "About..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_selfcheck.caption
|
||||
msgid "Update current profile now"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Runs at startup"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s service"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_deleteappprofile.caption
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_lastupdated.caption
|
||||
msgid "Last updated: never"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_about.caption
|
||||
msgid "About..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_selfcheck.caption
|
||||
msgid "Update current profile now"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Runs at startup"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s service"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_deleteappprofile.caption
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_lastupdated.caption
|
||||
msgid "Last updated: never"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_about.caption
|
||||
msgid "About..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_selfcheck.caption
|
||||
msgid "Update current profile now"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Runs at startup"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s service"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_deleteappprofile.caption
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_lastupdated.caption
|
||||
msgid "Last updated: never"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_about.caption
|
||||
msgid "About..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_selfcheck.caption
|
||||
msgid "Update current profile now"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Runs at startup"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s service"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
@ -0,0 +1,155 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: tconfigform.caption
|
||||
msgid "configform"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.chk_update.caption
|
||||
msgid "Include this profile in the updating schedule"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaldate.text
|
||||
msgid "1"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalday.text
|
||||
msgid "Monday"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervalhour.text
|
||||
msgid "Midnight"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmb_intervaltype.text
|
||||
msgid "Day"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_close.caption
|
||||
msgid "&Close this window"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_deleteappprofile.caption
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_newappprofile.caption
|
||||
msgid "New"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.cmd_savechanges.caption
|
||||
msgid "&Save all changes"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_appversion.text
|
||||
msgid "edt_AppVersion"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_inipath.text
|
||||
msgid "edt_INIPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfprojectname.text
|
||||
msgid "edt_SFProjectName"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_sfupdatesdirectory.text
|
||||
msgid "edt_SFUpdatesDirectory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.edt_zippath.text
|
||||
msgid "edt_ZipPath"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_configapp.caption
|
||||
msgid "Application details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.grp_updateinterval.caption
|
||||
msgid "Updating details"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_apppath.caption
|
||||
msgid "Path to app"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appprofile.caption
|
||||
msgid "Application Profile"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_appversion.caption
|
||||
msgid "Version"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_inipath.caption
|
||||
msgid "Version INI"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaldate.caption
|
||||
msgid "Use Monthdate.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervalday.caption
|
||||
msgid "Use Weekday.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_intervaltype.caption
|
||||
msgid "Check for updates every.."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_lastupdated.caption
|
||||
msgid "Last updated: never"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfprojectname.caption
|
||||
msgid "S.F. project name"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory.caption
|
||||
msgid "S.F. updates directory"
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_sfupdatesdirectory2.caption
|
||||
msgid "...at..."
|
||||
msgstr ""
|
||||
|
||||
#: tconfigform.lbl_zippath.caption
|
||||
msgid "ZipFile name"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.caption
|
||||
msgid "mainform"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_about.caption
|
||||
msgid "About..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_configure.caption
|
||||
msgid "Configure..."
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_fileexit.caption
|
||||
msgid "Shutdown and E&xit"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_selfcheck.caption
|
||||
msgid "Update current profile now"
|
||||
msgstr ""
|
||||
|
||||
#: tmainform.mnu_startatosstartup.caption
|
||||
msgid "Runs at startup"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_balloontitle
|
||||
msgid "%s service"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_newversionavailable
|
||||
msgid "A new version of %s (v%s) is available"
|
||||
msgstr ""
|
||||
|
||||
#: umainform.rs_trayloaded
|
||||
msgid "%s Loaded"
|
||||
msgstr ""
|
||||
|
BIN
components/lazautoupdate/latest_stable/trayicon/trayupdater.ico
Normal file
BIN
components/lazautoupdate/latest_stable/trayicon/trayupdater.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
220
components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi
Normal file
220
components/lazautoupdate/latest_stable/trayicon/trayupdater.lpi
Normal file
@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="LazAutoUpdater"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ResourceType Value="res"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
<ExecutionLevel Value="highestAvailable"/>
|
||||
<UIAccess Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N Value="True"/>
|
||||
<OutDir Value="locale"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<UseVersionInfo Value="True"/>
|
||||
<MinorVersionNr Value="1"/>
|
||||
<RevisionNr Value="12"/>
|
||||
<BuildNr Value="2"/>
|
||||
<StringTable CompanyName="minesadorada" FileDescription="Tray app that works with LazAutoUpdate apps" InternalName="lazautoupdater" LegalCopyright="LGPLv2" LegalTrademarks="(c)2014 Gordon Bamber" OriginalFilename="trayupdater" ProductName="Lazarus 1.x FPC 2.6.x" ProductVersion="0.1.11.2"/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="4">
|
||||
<Item1 Name="Win32 Release" Default="True"/>
|
||||
<Item2 Name="Win64 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="compiled\win64\lautraynotifywin64"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\packagesource"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="x86_64"/>
|
||||
<TargetOS Value="win64"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item2>
|
||||
<Item3 Name="Linux32 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="compiled\linux32\lautraynotifylinux32"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\packagesource"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="i386"/>
|
||||
<TargetOS Value="linux"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item3>
|
||||
<Item4 Name="Linux64 Release">
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="compiled\linux64\lautraynotifylinux64"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..;..\packagesource"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="x86_64"/>
|
||||
<TargetOS Value="linux"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
</Item4>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<CommandLineParams Value="debug"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="4">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="longtimerpackage"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="lazupdate"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="mainform"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="configform"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="compiled\win32\lautraynotifywin32"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<Libraries Value="C:\codetyphon\linux\i386-linux\;C:\codetyphon\linux\x86_64-linux\"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<TargetCPU Value="i386"/>
|
||||
<TargetOS Value="win32"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="3"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<GenerateDebugInfo Value="False"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
@ -0,0 +1,66 @@
|
||||
program trayupdater;
|
||||
{ LazAutoUpdate Tray Updater
|
||||
|
||||
Copyright (C)2014 Gordon Bamber minesadorada@charcodelvalle.com
|
||||
|
||||
An example of using LazAutoUpdate as a ´start when windows starts' way
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
}
|
||||
{$ifdef Linux}
|
||||
{$ifdef FPC_CROSSCOMPILING}
|
||||
{$ifdef CPUARM}
|
||||
//if GUI on RPi, then uncomment
|
||||
//{$linklib GLESv2}
|
||||
{$endif}
|
||||
{$linklib libc_nonshared.a}
|
||||
{$endif}
|
||||
{$endif}
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, umainform, uconfigform;
|
||||
|
||||
{$R *.res}
|
||||
{
|
||||
Const
|
||||
{$IFDEF WINDOWS}
|
||||
C_OS = 'win';
|
||||
{$ELSE}
|
||||
C_OS = 'linux';
|
||||
{$ENDIF}
|
||||
{$IFDEF CPU32}
|
||||
C_BITNESS = '32';
|
||||
{$ELSE}
|
||||
C_BITNESS = '64';
|
||||
{$ENDIF}
|
||||
C_PFX = C_OS + C_BITNESS;
|
||||
}
|
||||
begin
|
||||
Application.Title:='LazTrayUpdater';
|
||||
// Application.Title:=Application.Title + ' (' + C_PFX + ' edition)';
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(Tmainform, mainform);
|
||||
Application.CreateForm(Tconfigform, configform);
|
||||
Application.ShowMainForm := false;
|
||||
Application.Run;
|
||||
end.
|
||||
|
350
components/lazautoupdate/latest_stable/trayicon/trayupdater.lps
Normal file
350
components/lazautoupdate/latest_stable/trayicon/trayupdater.lps
Normal file
@ -0,0 +1,350 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="10"/>
|
||||
<BuildModes Active="Linux64 Release"/>
|
||||
<Units Count="27">
|
||||
<Unit0>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="19"/>
|
||||
<CursorPos X="30" Y="57"/>
|
||||
<UsageCount Value="176"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="mainform"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="660"/>
|
||||
<CursorPos X="52" Y="672"/>
|
||||
<ComponentState Value="1"/>
|
||||
<UsageCount Value="176"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="3" Y="478" ID="2"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="configform"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="206"/>
|
||||
<CursorPos X="67" Y="231"/>
|
||||
<UsageCount Value="172"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="..\..\..\..\healthmonitor\svn\ministaller\umainform.pas"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="315"/>
|
||||
<CursorPos X="57" Y="323"/>
|
||||
<UsageCount Value="2"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="D:\Lazarus32_production\lcl\menus.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="214"/>
|
||||
<UsageCount Value="2"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="..\..\..\..\longtimer\longtimer.pas"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="29" Y="14"/>
|
||||
<UsageCount Value="1"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="..\..\..\longtimer\ulongtimer.pas"/>
|
||||
<UnitName Value="uLongTimer"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="4"/>
|
||||
<CursorPos X="54" Y="10"/>
|
||||
<UsageCount Value="49"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="C:\development\lazarus\lcl\lclclasses.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="5"/>
|
||||
<CursorPos X="24" Y="24"/>
|
||||
<UsageCount Value="5"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="D:\Lazarus32_production\components\lazutils\fileutil.pas"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="202"/>
|
||||
<CursorPos X="29" Y="225"/>
|
||||
<UsageCount Value="70"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\packages\fcl-base\src\inifiles.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="125"/>
|
||||
<CursorPos X="34" Y="143"/>
|
||||
<UsageCount Value="44"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="..\updatepack\umainform.pas"/>
|
||||
<ComponentName Value="mainform"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="25"/>
|
||||
<CursorPos X="56" Y="214"/>
|
||||
<UsageCount Value="40"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\strutils.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos Y="33"/>
|
||||
<UsageCount Value="47"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\packages\fcl-registry\src\registry.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="11" Y="20"/>
|
||||
<UsageCount Value="37"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\packages\fcl-registry\src\regdef.inc"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="17" Y="18"/>
|
||||
<UsageCount Value="37"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="..\packagesource\ulazautoupdate.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="78"/>
|
||||
<CursorPos X="12" Y="68"/>
|
||||
<UsageCount Value="70"/>
|
||||
<Bookmarks Count="1">
|
||||
<Item0 X="7" Y="1165"/>
|
||||
</Bookmarks>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="..\packagesource\versionsupport.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="31" Y="109"/>
|
||||
<UsageCount Value="69"/>
|
||||
</Unit15>
|
||||
<Unit16>
|
||||
<Filename Value="D:\fpc_trunk\packages\winunits-jedi\src\jwatlhelp32.pas"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="76"/>
|
||||
<CursorPos X="54" Y="27"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
<Filename Value="..\packagesource\uappisrunning.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="47" Y="104"/>
|
||||
<UsageCount Value="51"/>
|
||||
</Unit17>
|
||||
<Unit18>
|
||||
<Filename Value="D:\Lazarus32_production\packager\registration\fcllaz.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit18>
|
||||
<Unit19>
|
||||
<Filename Value="..\updatehm.lpr"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="54"/>
|
||||
<CursorPos X="17" Y="68"/>
|
||||
<UsageCount Value="24"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<Filename Value="..\packagesource\aboutlazautoupdateunit.pas"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="157"/>
|
||||
<CursorPos X="29" Y="182"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
<Filename Value="D:\development\fpc\packages\fcl-base\src\inifiles.pp"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="142"/>
|
||||
<UsageCount Value="8"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<Filename Value="D:\Lazarus32_production\fpc\2.6.4\source\rtl\objpas\sysutils\sysstrh.inc"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<CursorPos X="4" Y="27"/>
|
||||
<UsageCount Value="20"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<Filename Value="umainform.lfm"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="22"/>
|
||||
<CursorPos X="29" Y="11"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="LFM"/>
|
||||
</Unit23>
|
||||
<Unit24>
|
||||
<Filename Value="uconfigform.lfm"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
<DefaultSyntaxHighlighter Value="LFM"/>
|
||||
</Unit24>
|
||||
<Unit25>
|
||||
<Filename Value="C:\codetyphon\fpcsrc\packages\rtl-objpas\src\inc\strutils.pp"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="221"/>
|
||||
<CursorPos X="63" Y="225"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
<Filename Value="C:\laztrunk\config_lazarus\onlinepackagemanager\packages\longtimer\ulongtimer.pas"/>
|
||||
<UnitName Value="uLongTimer"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<WindowIndex Value="1"/>
|
||||
<TopLine Value="299"/>
|
||||
<CursorPos X="14" Y="323"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit26>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="151" Column="52" TopLine="117"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="152" Column="58" TopLine="118"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="498" Column="41" TopLine="489"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="50" Column="20" TopLine="16"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="151" Column="52" TopLine="117"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="152" Column="58" TopLine="118"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="179" Column="41" TopLine="145"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="309" Column="57" TopLine="276"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="310" Column="72" TopLine="277"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="349" Column="46" TopLine="315"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="405" Column="52" TopLine="369"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<Caret Column="38"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<Caret Line="107" Column="73"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="30" Column="43" TopLine="28"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="83" Column="41" TopLine="77"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="691" TopLine="677"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="695" Column="8" TopLine="693"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="434" Column="3" TopLine="432"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="697" Column="19" TopLine="693"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="438" Column="23" TopLine="432"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<Caret Line="8" Column="16"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<Caret Line="82" Column="3" TopLine="80"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<Caret Line="285" Column="3" TopLine="238"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="124" Column="15" TopLine="118"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="umainform.pas"/>
|
||||
<Caret Line="672" Column="52" TopLine="660"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<Caret Line="63" TopLine="14"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<Caret Line="53" Column="3" TopLine="14"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uconfigform.pas"/>
|
||||
<Caret Line="231" Column="67" TopLine="206"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<Caret Line="63" TopLine="14"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="trayupdater.lpr"/>
|
||||
<Caret Line="57" Column="30" TopLine="19"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
BIN
components/lazautoupdate/latest_stable/trayicon/trayupdater.res
Normal file
BIN
components/lazautoupdate/latest_stable/trayicon/trayupdater.res
Normal file
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
365
components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm
Normal file
365
components/lazautoupdate/latest_stable/trayicon/uconfigform.lfm
Normal file
@ -0,0 +1,365 @@
|
||||
object configform: Tconfigform
|
||||
Left = 1101
|
||||
Height = 495
|
||||
Top = 511
|
||||
Width = 604
|
||||
BorderIcons = [biSystemMenu]
|
||||
BorderStyle = bsSingle
|
||||
Caption = 'configform'
|
||||
ClientHeight = 495
|
||||
ClientWidth = 604
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '1.7'
|
||||
object grp_configapp: TGroupBox
|
||||
Left = 0
|
||||
Height = 252
|
||||
Top = 0
|
||||
Width = 604
|
||||
Align = alTop
|
||||
Caption = 'Application details'
|
||||
ClientHeight = 232
|
||||
ClientWidth = 600
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object cmb_AppProfile: TComboBox
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 12
|
||||
Width = 276
|
||||
ItemHeight = 15
|
||||
OnClick = cmb_AppProfileClick
|
||||
OnCloseUp = cmb_AppProfileCloseUp
|
||||
Style = csDropDownList
|
||||
TabOrder = 0
|
||||
end
|
||||
object lbl_AppProfile: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 16
|
||||
Width = 98
|
||||
Caption = 'Application Profile'
|
||||
ParentColor = False
|
||||
end
|
||||
object cmd_NewAppProfile: TButton
|
||||
Left = 431
|
||||
Height = 25
|
||||
Top = 12
|
||||
Width = 64
|
||||
Caption = 'New'
|
||||
OnClick = cmd_NewAppProfileClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object edt_AppPath: TFileNameEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 44
|
||||
Width = 412
|
||||
FilterIndex = 0
|
||||
HideDirectories = False
|
||||
ButtonWidth = 23
|
||||
NumGlyphs = 1
|
||||
MaxLength = 0
|
||||
TabOrder = 2
|
||||
end
|
||||
object lbl_AppPath: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 44
|
||||
Width = 61
|
||||
Caption = 'Path to app'
|
||||
ParentColor = False
|
||||
end
|
||||
object lbl_AppVersion: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 76
|
||||
Width = 38
|
||||
Caption = 'Version'
|
||||
ParentColor = False
|
||||
end
|
||||
object lbl_INIPath: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 108
|
||||
Width = 56
|
||||
Caption = 'Version INI'
|
||||
ParentColor = False
|
||||
end
|
||||
object edt_INIPath: TEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 108
|
||||
Width = 428
|
||||
TabOrder = 3
|
||||
Text = 'edt_INIPath'
|
||||
end
|
||||
object lbl_ZipPath: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 140
|
||||
Width = 68
|
||||
Caption = 'ZipFile name'
|
||||
ParentColor = False
|
||||
end
|
||||
object edt_ZipPath: TEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 140
|
||||
Width = 428
|
||||
TabOrder = 4
|
||||
Text = 'edt_ZipPath'
|
||||
end
|
||||
object lbl_SFProjectName: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 172
|
||||
Width = 91
|
||||
Caption = 'S.F. project name'
|
||||
ParentColor = False
|
||||
end
|
||||
object edt_SFProjectName: TEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 172
|
||||
Width = 428
|
||||
TabOrder = 5
|
||||
Text = 'edt_SFProjectName'
|
||||
end
|
||||
object lbl_SFUpdatesDirectory: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 204
|
||||
Width = 113
|
||||
Caption = 'S.F. updates directory'
|
||||
ParentColor = False
|
||||
end
|
||||
object edt_SFUpdatesDirectory: TEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 204
|
||||
Width = 428
|
||||
TabOrder = 6
|
||||
Text = 'edt_SFUpdatesDirectory'
|
||||
end
|
||||
object edt_AppVersion: TEdit
|
||||
Left = 148
|
||||
Height = 23
|
||||
Top = 76
|
||||
Width = 428
|
||||
TabOrder = 7
|
||||
Text = 'edt_AppVersion'
|
||||
end
|
||||
object cmd_DeleteAppProfile: TButton
|
||||
Left = 496
|
||||
Height = 25
|
||||
Top = 12
|
||||
Width = 83
|
||||
Caption = 'Delete'
|
||||
OnClick = cmd_DeleteAppProfileClick
|
||||
TabOrder = 8
|
||||
end
|
||||
end
|
||||
object grp_updateinterval: TGroupBox
|
||||
Left = 0
|
||||
Height = 243
|
||||
Top = 252
|
||||
Width = 604
|
||||
Align = alClient
|
||||
Caption = 'Updating details'
|
||||
ClientHeight = 223
|
||||
ClientWidth = 600
|
||||
TabOrder = 1
|
||||
OnClick = grp_updateintervalClick
|
||||
object cmd_Close: TBitBtn
|
||||
Left = 228
|
||||
Height = 30
|
||||
Top = 184
|
||||
Width = 151
|
||||
Caption = '&Close this window'
|
||||
Default = True
|
||||
Kind = bkClose
|
||||
ModalResult = 11
|
||||
OnClick = cmd_CloseClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object lbl_IntervalType: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 24
|
||||
Width = 133
|
||||
Caption = 'Check for updates every..'
|
||||
ParentColor = False
|
||||
end
|
||||
object cmb_IntervalType: TComboBox
|
||||
Left = 172
|
||||
Height = 23
|
||||
Top = 20
|
||||
Width = 104
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Day'
|
||||
'Week'
|
||||
'Month'
|
||||
)
|
||||
OnChange = cmb_IntervalTypeChange
|
||||
Style = csDropDownList
|
||||
TabOrder = 1
|
||||
Text = 'Day'
|
||||
end
|
||||
object lbl_SFUpdatesDirectory2: TLabel
|
||||
Left = 296
|
||||
Height = 15
|
||||
Top = 24
|
||||
Width = 28
|
||||
Caption = '...at...'
|
||||
ParentColor = False
|
||||
end
|
||||
object cmb_IntervalHour: TComboBox
|
||||
Left = 352
|
||||
Height = 23
|
||||
Top = 20
|
||||
Width = 104
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Midnight'
|
||||
'1am'
|
||||
'2am'
|
||||
'3am'
|
||||
'4am'
|
||||
'5am'
|
||||
'6am'
|
||||
'7am'
|
||||
'8am'
|
||||
'9am'
|
||||
'10am'
|
||||
'11am'
|
||||
'Noon'
|
||||
'1pm'
|
||||
'2pm'
|
||||
'3pm'
|
||||
'4pm'
|
||||
'5pm'
|
||||
'6pm'
|
||||
'7pm'
|
||||
'8pm'
|
||||
'9pm'
|
||||
'10pm'
|
||||
'11pm'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 2
|
||||
Text = 'Midnight'
|
||||
end
|
||||
object cmb_IntervalDay: TComboBox
|
||||
Left = 172
|
||||
Height = 23
|
||||
Top = 56
|
||||
Width = 104
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'Monday'
|
||||
'Tuesday'
|
||||
'Wednesday'
|
||||
'Thursday'
|
||||
'Friday'
|
||||
'Saturday'
|
||||
'Sunday'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 3
|
||||
Text = 'Monday'
|
||||
end
|
||||
object lbl_IntervalDay: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 60
|
||||
Width = 76
|
||||
Caption = 'Use Weekday..'
|
||||
ParentColor = False
|
||||
end
|
||||
object lbl_IntervalDate: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 92
|
||||
Width = 87
|
||||
Caption = 'Use Monthdate..'
|
||||
ParentColor = False
|
||||
end
|
||||
object cmb_IntervalDate: TComboBox
|
||||
Left = 172
|
||||
Height = 23
|
||||
Top = 88
|
||||
Width = 104
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'1'
|
||||
'2'
|
||||
'3'
|
||||
'4'
|
||||
'5'
|
||||
'6'
|
||||
'7'
|
||||
'8'
|
||||
'9'
|
||||
'10'
|
||||
'11'
|
||||
'12'
|
||||
'13'
|
||||
'14'
|
||||
'15'
|
||||
'16'
|
||||
'17'
|
||||
'18'
|
||||
'19'
|
||||
'20'
|
||||
'21'
|
||||
'22'
|
||||
'23'
|
||||
'24'
|
||||
'25'
|
||||
'26'
|
||||
'27'
|
||||
'28'
|
||||
'29'
|
||||
'30'
|
||||
'31'
|
||||
)
|
||||
Style = csDropDownList
|
||||
TabOrder = 4
|
||||
Text = '1'
|
||||
end
|
||||
object chk_Update: TCheckBox
|
||||
Left = 12
|
||||
Height = 19
|
||||
Top = 132
|
||||
Width = 252
|
||||
Caption = 'Include this profile in the updating schedule'
|
||||
OnClick = chk_UpdateClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object cmd_SaveChanges: TBitBtn
|
||||
Left = 424
|
||||
Height = 30
|
||||
Top = 184
|
||||
Width = 155
|
||||
Caption = '&Save all changes'
|
||||
Kind = bkYes
|
||||
OnClick = cmd_SaveChangesClick
|
||||
TabOrder = 6
|
||||
end
|
||||
object lbl_LastUpdated: TLabel
|
||||
Left = 12
|
||||
Height = 15
|
||||
Top = 157
|
||||
Width = 103
|
||||
Caption = 'Last updated: never'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
{"version":1,"strings":[
|
||||
{"hash":217805005,"name":"tconfigform.caption","sourcebytes":[99,111,110,102,105,103,102,111,114,109],"value":"configform"},
|
||||
{"hash":169079171,"name":"tconfigform.grp_configapp.caption","sourcebytes":[65,112,112,108,105,99,97,116,105,111,110,32,100,101,116,97,105,108,115],"value":"Application details"},
|
||||
{"hash":124535205,"name":"tconfigform.lbl_appprofile.caption","sourcebytes":[65,112,112,108,105,99,97,116,105,111,110,32,80,114,111,102,105,108,101],"value":"Application Profile"},
|
||||
{"hash":21703,"name":"tconfigform.cmd_newappprofile.caption","sourcebytes":[78,101,119],"value":"New"},
|
||||
{"hash":134734544,"name":"tconfigform.lbl_apppath.caption","sourcebytes":[80,97,116,104,32,116,111,32,97,112,112],"value":"Path to app"},
|
||||
{"hash":214540302,"name":"tconfigform.lbl_appversion.caption","sourcebytes":[86,101,114,115,105,111,110],"value":"Version"},
|
||||
{"hash":1869193,"name":"tconfigform.lbl_inipath.caption","sourcebytes":[86,101,114,115,105,111,110,32,73,78,73],"value":"Version INI"},
|
||||
{"hash":239456920,"name":"tconfigform.edt_inipath.text","sourcebytes":[101,100,116,95,73,78,73,80,97,116,104],"value":"edt_INIPath"},
|
||||
{"hash":73861941,"name":"tconfigform.lbl_zippath.caption","sourcebytes":[90,105,112,70,105,108,101,32,110,97,109,101],"value":"ZipFile name"},
|
||||
{"hash":24040184,"name":"tconfigform.edt_zippath.text","sourcebytes":[101,100,116,95,90,105,112,80,97,116,104],"value":"edt_ZipPath"},
|
||||
{"hash":223006597,"name":"tconfigform.lbl_sfprojectname.caption","sourcebytes":[83,46,70,46,32,112,114,111,106,101,99,116,32,110,97,109,101],"value":"S.F. project name"},
|
||||
{"hash":209000565,"name":"tconfigform.edt_sfprojectname.text","sourcebytes":[101,100,116,95,83,70,80,114,111,106,101,99,116,78,97,109,101],"value":"edt_SFProjectName"},
|
||||
{"hash":34002313,"name":"tconfigform.lbl_sfupdatesdirectory.caption","sourcebytes":[83,46,70,46,32,117,112,100,97,116,101,115,32,100,105,114,101,99,116,111,114,121],"value":"S.F. updates directory"},
|
||||
{"hash":74170009,"name":"tconfigform.edt_sfupdatesdirectory.text","sourcebytes":[101,100,116,95,83,70,85,112,100,97,116,101,115,68,105,114,101,99,116,111,114,121],"value":"edt_SFUpdatesDirectory"},
|
||||
{"hash":124395454,"name":"tconfigform.edt_appversion.text","sourcebytes":[101,100,116,95,65,112,112,86,101,114,115,105,111,110],"value":"edt_AppVersion"},
|
||||
{"hash":78392485,"name":"tconfigform.cmd_deleteappprofile.caption","sourcebytes":[68,101,108,101,116,101],"value":"Delete"},
|
||||
{"hash":39973363,"name":"tconfigform.grp_updateinterval.caption","sourcebytes":[85,112,100,97,116,105,110,103,32,100,101,116,97,105,108,115],"value":"Updating details"},
|
||||
{"hash":34647463,"name":"tconfigform.cmd_close.caption","sourcebytes":[38,67,108,111,115,101,32,116,104,105,115,32,119,105,110,100,111,119],"value":"&Close this window"},
|
||||
{"hash":13221934,"name":"tconfigform.lbl_intervaltype.caption","sourcebytes":[67,104,101,99,107,32,102,111,114,32,117,112,100,97,116,101,115,32,101,118,101,114,121,46,46],"value":"Check for updates every.."},
|
||||
{"hash":19081,"name":"tconfigform.cmb_intervaltype.text","sourcebytes":[68,97,121],"value":"Day"},
|
||||
{"hash":21525534,"name":"tconfigform.lbl_sfupdatesdirectory2.caption","sourcebytes":[46,46,46,97,116,46,46,46],"value":"...at..."},
|
||||
{"hash":263518404,"name":"tconfigform.cmb_intervalhour.text","sourcebytes":[77,105,100,110,105,103,104,116],"value":"Midnight"},
|
||||
{"hash":88492681,"name":"tconfigform.cmb_intervalday.text","sourcebytes":[77,111,110,100,97,121],"value":"Monday"},
|
||||
{"hash":143513582,"name":"tconfigform.lbl_intervalday.caption","sourcebytes":[85,115,101,32,87,101,101,107,100,97,121,46,46],"value":"Use Weekday.."},
|
||||
{"hash":167558974,"name":"tconfigform.lbl_intervaldate.caption","sourcebytes":[85,115,101,32,77,111,110,116,104,100,97,116,101,46,46],"value":"Use Monthdate.."},
|
||||
{"hash":49,"name":"tconfigform.cmb_intervaldate.text","sourcebytes":[49],"value":"1"},
|
||||
{"hash":184836069,"name":"tconfigform.chk_update.caption","sourcebytes":[73,110,99,108,117,100,101,32,116,104,105,115,32,112,114,111,102,105,108,101,32,105,110,32,116,104,101,32,117,112,100,97,116,105,110,103,32,115,99,104,101,100,117,108,101],"value":"Include this profile in the updating schedule"},
|
||||
{"hash":246152035,"name":"tconfigform.cmd_savechanges.caption","sourcebytes":[38,83,97,118,101,32,97,108,108,32,99,104,97,110,103,101,115],"value":"&Save all changes"},
|
||||
{"hash":139853858,"name":"tconfigform.lbl_lastupdated.caption","sourcebytes":[76,97,115,116,32,117,112,100,97,116,101,100,58,32,110,101,118,101,114],"value":"Last updated: never"}
|
||||
]}
|
@ -0,0 +1,29 @@
|
||||
TCONFIGFORM.CAPTION=configform
|
||||
TCONFIGFORM.GRP_CONFIGAPP.CAPTION=Application details
|
||||
TCONFIGFORM.LBL_APPPROFILE.CAPTION=Application Profile
|
||||
TCONFIGFORM.CMD_NEWAPPPROFILE.CAPTION=New
|
||||
TCONFIGFORM.LBL_APPPATH.CAPTION=Path to app
|
||||
TCONFIGFORM.LBL_APPVERSION.CAPTION=Version
|
||||
TCONFIGFORM.LBL_INIPATH.CAPTION=Version INI
|
||||
TCONFIGFORM.EDT_INIPATH.TEXT=edt_INIPath
|
||||
TCONFIGFORM.LBL_ZIPPATH.CAPTION=ZipFile name
|
||||
TCONFIGFORM.EDT_ZIPPATH.TEXT=edt_ZipPath
|
||||
TCONFIGFORM.LBL_SFPROJECTNAME.CAPTION=S.F. project name
|
||||
TCONFIGFORM.EDT_SFPROJECTNAME.TEXT=edt_SFProjectName
|
||||
TCONFIGFORM.LBL_SFUPDATESDIRECTORY.CAPTION=S.F. updates directory
|
||||
TCONFIGFORM.EDT_SFUPDATESDIRECTORY.TEXT=edt_SFUpdatesDirectory
|
||||
TCONFIGFORM.EDT_APPVERSION.TEXT=edt_AppVersion
|
||||
TCONFIGFORM.CMD_DELETEAPPPROFILE.CAPTION=Delete
|
||||
TCONFIGFORM.GRP_UPDATEINTERVAL.CAPTION=Updating details
|
||||
TCONFIGFORM.CMD_CLOSE.CAPTION=&Close this window
|
||||
TCONFIGFORM.LBL_INTERVALTYPE.CAPTION=Check for updates every..
|
||||
TCONFIGFORM.CMB_INTERVALTYPE.TEXT=Day
|
||||
TCONFIGFORM.LBL_SFUPDATESDIRECTORY2.CAPTION=...at...
|
||||
TCONFIGFORM.CMB_INTERVALHOUR.TEXT=Midnight
|
||||
TCONFIGFORM.CMB_INTERVALDAY.TEXT=Monday
|
||||
TCONFIGFORM.LBL_INTERVALDAY.CAPTION=Use Weekday..
|
||||
TCONFIGFORM.LBL_INTERVALDATE.CAPTION=Use Monthdate..
|
||||
TCONFIGFORM.CMB_INTERVALDATE.TEXT=1
|
||||
TCONFIGFORM.CHK_UPDATE.CAPTION=Include this profile in the updating schedule
|
||||
TCONFIGFORM.CMD_SAVECHANGES.CAPTION=&Save all changes
|
||||
TCONFIGFORM.LBL_LASTUPDATED.CAPTION=Last updated: never
|
288
components/lazautoupdate/latest_stable/trayicon/uconfigform.pas
Normal file
288
components/lazautoupdate/latest_stable/trayicon/uconfigform.pas
Normal file
@ -0,0 +1,288 @@
|
||||
unit uconfigform;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Dialogs, Buttons,
|
||||
StdCtrls, EditBtn;
|
||||
|
||||
type
|
||||
|
||||
{ Tconfigform }
|
||||
|
||||
Tconfigform = class(TForm)
|
||||
cmd_DeleteAppProfile: TButton;
|
||||
cmd_SaveChanges: TBitBtn;
|
||||
chk_Update: TCheckBox;
|
||||
cmb_IntervalDate: TComboBox;
|
||||
cmb_IntervalHour: TComboBox;
|
||||
cmb_IntervalDay: TComboBox;
|
||||
cmd_Close: TBitBtn;
|
||||
cmd_NewAppProfile: TButton;
|
||||
cmb_AppProfile: TComboBox;
|
||||
cmb_IntervalType: TComboBox;
|
||||
edt_INIPath: TEdit;
|
||||
edt_AppPath: TFileNameEdit;
|
||||
edt_AppVersion: TEdit;
|
||||
edt_SFUpdatesDirectory: TEdit;
|
||||
edt_ZipPath: TEdit;
|
||||
edt_SFProjectName: TEdit;
|
||||
grp_updateinterval: TGroupBox;
|
||||
grp_configapp: TGroupBox;
|
||||
lbl_LastUpdated: TLabel;
|
||||
lbl_AppVersion: TLabel;
|
||||
lbl_AppProfile: TLabel;
|
||||
lbl_AppPath: TLabel;
|
||||
lbl_INIPath: TLabel;
|
||||
lbl_IntervalDate: TLabel;
|
||||
lbl_SFUpdatesDirectory: TLabel;
|
||||
lbl_IntervalType: TLabel;
|
||||
lbl_SFUpdatesDirectory2: TLabel;
|
||||
lbl_IntervalDay: TLabel;
|
||||
lbl_ZipPath: TLabel;
|
||||
lbl_SFProjectName: TLabel;
|
||||
procedure chk_UpdateClick(Sender: TObject);
|
||||
procedure cmb_AppProfileClick(Sender: TObject);
|
||||
procedure cmb_AppProfileCloseUp(Sender: TObject);
|
||||
procedure cmd_CloseClick(Sender: TObject);
|
||||
procedure cmd_DeleteAppProfileClick(Sender: TObject);
|
||||
procedure cmd_NewAppProfileClick(Sender: TObject);
|
||||
procedure cmd_SaveChangesClick(Sender: TObject);
|
||||
procedure cmb_IntervalTypeChange(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure grp_updateintervalClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
procedure DoInitialiseCombobox;
|
||||
procedure DoDisplayProfile(AIndex: integer);
|
||||
procedure DoSaveAllChanges;
|
||||
procedure DoEnableDisableIntervalCombos;
|
||||
public
|
||||
{ public declarations }
|
||||
bDetailsChanged: boolean;
|
||||
end;
|
||||
|
||||
var
|
||||
configform : Tconfigform;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
umainform;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ Tconfigform }
|
||||
|
||||
procedure Tconfigform.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Icon := Application.Icon;
|
||||
Caption := 'Configure ' + Application.Title;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.DoSaveAllChanges;
|
||||
begin
|
||||
with mainform.AppRecArray[cmb_AppProfile.ItemIndex] do
|
||||
begin
|
||||
AppPath := edt_AppPath.Text;
|
||||
AppVersion := edt_AppVersion.Text;
|
||||
INIPath := edt_INIPath.Text;
|
||||
ZipPath := edt_ZipPath.Text;
|
||||
SFProjectName := edt_SFProjectName.Text;
|
||||
SFUpdatesDirectory := edt_SFUpdatesDirectory.Text;
|
||||
IntervalType := cmb_IntervalType.ItemIndex;
|
||||
IntervalDay := cmb_IntervalDay.ItemIndex;
|
||||
IntervalDate := cmb_IntervalDate.ItemIndex;
|
||||
IntervalHour := cmb_IntervalHour.ItemIndex;
|
||||
Update := chk_Update.Checked;
|
||||
bDetailsChanged := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.DoDisplayProfile(AIndex: integer);
|
||||
begin
|
||||
with mainform.AppRecArray[AIndex] do
|
||||
begin
|
||||
edt_AppPath.Text := AppPath;
|
||||
edt_AppVersion.Text := AppVersion;
|
||||
edt_INIPath.Text := INIPath;
|
||||
edt_ZipPath.Text := ZipPath;
|
||||
edt_SFProjectName.Text := SFProjectName;
|
||||
edt_SFUpdatesDirectory.Text := SFUpdatesDirectory;
|
||||
cmb_IntervalType.ItemIndex := IntervalType;
|
||||
cmb_IntervalDay.ItemIndex := IntervalDay;
|
||||
cmb_IntervalDate.ItemIndex := IntervalDate;
|
||||
cmb_IntervalHour.ItemIndex := IntervalHour;
|
||||
chk_Update.Checked := Update;
|
||||
lbl_LastUpdated.Caption :=
|
||||
Format('Last successful update was %s',
|
||||
[FormatDateTime('c', LastCheckDateTime)]);
|
||||
DoEnableDisableIntervalCombos;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.DoEnableDisableIntervalCombos;
|
||||
begin
|
||||
case cmb_IntervalType.ItemIndex of
|
||||
0:
|
||||
begin
|
||||
cmb_IntervalDay.Enabled := False;
|
||||
cmb_IntervalDate.Enabled := False;
|
||||
end;
|
||||
1:
|
||||
begin
|
||||
cmb_IntervalDay.Enabled := True;
|
||||
cmb_IntervalDate.Enabled := False;
|
||||
end;
|
||||
2:
|
||||
begin
|
||||
cmb_IntervalDay.Enabled := False;
|
||||
cmb_IntervalDate.Enabled := True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmd_SaveChangesClick(Sender: TObject);
|
||||
begin
|
||||
DoSaveAllChanges;
|
||||
if (MessageDlg(Application.Title, 'Changes saved OK. Close window now?',
|
||||
mtConfirmation, [mbYes, mbNo], 0) = mrYes) then
|
||||
cmd_Close.Click;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmd_CloseClick(Sender: TObject);
|
||||
begin
|
||||
mainform.iCurrentRecIndex := cmb_AppProfile.ItemIndex;
|
||||
mainform.INI.WriteInteger('ProgramInfo', 'CurrentProfileIndex',
|
||||
mainform.iCurrentRecIndex);
|
||||
mainform.INI.UpdateFile;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.chk_UpdateClick(Sender: TObject);
|
||||
begin
|
||||
mainform.AppRecArray[cmb_AppProfile.ItemIndex].Update := chk_Update.Checked;
|
||||
// mainform.LongTimerArray[cmb_AppProfile.ItemIndex].Enabled := chk_Update.Checked;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmb_AppProfileClick(Sender: TObject);
|
||||
begin
|
||||
DoSaveAllChanges;
|
||||
DoDisplayProfile(cmb_AppProfile.ItemIndex);
|
||||
mainform.iCurrentRecIndex := cmb_AppProfile.ItemIndex;
|
||||
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmb_AppProfileCloseUp(Sender: TObject);
|
||||
begin
|
||||
DoDisplayProfile(cmb_AppProfile.ItemIndex);
|
||||
mainform.iCurrentRecIndex := cmb_AppProfile.ItemIndex;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmd_DeleteAppProfileClick(Sender: TObject);
|
||||
// Make a temp copy of AppRecArray
|
||||
// Copy over all but the deleted profile into the temp copy
|
||||
// Copy the temp copy back to AppRecArray
|
||||
// Delete the INIFile section
|
||||
var
|
||||
TempAppRecArray : array of TAppRec;
|
||||
i, iLastIndex : integer;
|
||||
begin
|
||||
if High(mainform.AppRecArray) = 0 then
|
||||
begin
|
||||
MessageDlg(Application.Title,
|
||||
'You cannot delete the only profile left',
|
||||
mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// Delete INI section
|
||||
mainform.INI.EraseSection(
|
||||
mainform.AppRecArray[cmb_AppProfile.ItemIndex].AppPrettyName);
|
||||
|
||||
SetLength(TempAppRecArray, High(mainform.AppRecArray)); // one less
|
||||
iLastIndex := -1;
|
||||
for i := Low(mainform.AppRecArray) to High(mainform.AppRecArray) do
|
||||
if (i <> cmb_AppProfile.ItemIndex) then
|
||||
begin
|
||||
Inc(iLastIndex);
|
||||
TempAppRecArray[iLastIndex] := mainform.AppRecArray[i];
|
||||
end;
|
||||
SetLength(mainform.AppRecArray, High(TempAppRecArray) + 1);
|
||||
mainform.AppRecArray := TempAppRecArray;
|
||||
|
||||
DoInitialiseCombobox;
|
||||
cmb_AppProfile.ItemIndex := 0;
|
||||
mainform.iCurrentRecIndex := 0;
|
||||
mainform.INI.WriteInteger('ProgramInfo', 'CurrentProfileIndex',
|
||||
mainform.iCurrentRecIndex);
|
||||
mainform.INI.UpdateFile;
|
||||
bDetailsChanged := True;
|
||||
mainform.DoWriteAppRecArrayIntoINI;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmd_NewAppProfileClick(Sender: TObject);
|
||||
var
|
||||
szProfileName : string;
|
||||
iLastIndex : integer;
|
||||
begin
|
||||
if InputQuery('New Profile', 'New Profile', False, szProfileName) then
|
||||
begin
|
||||
iLastIndex := High(mainform.AppRecArray);
|
||||
SetLength(mainform.AppRecArray, iLastIndex + 2);
|
||||
iLastIndex := High(mainform.AppRecArray);
|
||||
mainform.AppRecArray[iLastIndex] := mainform.AppRecArray[iLastIndex - 1];
|
||||
mainform.AppRecArray[iLastIndex].AppPrettyName := szProfileName;
|
||||
DoInitialiseCombobox;
|
||||
cmb_AppProfile.ItemIndex := iLastIndex;
|
||||
mainform.iCurrentRecIndex := iLastIndex;
|
||||
mainform.INI.WriteInteger('ProgramInfo', 'CurrentProfileIndex',
|
||||
mainform.iCurrentRecIndex);
|
||||
mainform.INI.UpdateFile;
|
||||
bDetailsChanged := True;
|
||||
mainform.DoWriteAppRecArrayIntoINI;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.cmb_IntervalTypeChange(Sender: TObject);
|
||||
begin
|
||||
DoEnableDisableIntervalCombos;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.DoInitialiseCombobox;
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
if (Length(mainform.AppRecArray) = 0) then
|
||||
begin
|
||||
ShowMessage('There are no profiles to configure!');
|
||||
ModalResult := mrOk;
|
||||
end;
|
||||
cmb_AppProfile.Clear;
|
||||
with mainform do
|
||||
begin
|
||||
for i := Low(AppRecArray) to High(AppRecArray) do
|
||||
begin
|
||||
cmb_AppProfile.Items.Add(AppRecArray[i].AppPrettyName);
|
||||
end;
|
||||
end;
|
||||
mainform.iCurrentRecIndex :=
|
||||
mainform.INI.ReadInteger('ProgramInfo', 'CurrentProfileIndex', 0);
|
||||
cmb_AppProfile.ItemIndex := mainform.iCurrentRecIndex;
|
||||
DoDisplayProfile(mainform.iCurrentRecIndex);
|
||||
end;
|
||||
|
||||
procedure Tconfigform.FormShow(Sender: TObject);
|
||||
begin
|
||||
DoInitialiseCombobox;
|
||||
bDetailsChanged := False;
|
||||
end;
|
||||
|
||||
procedure Tconfigform.grp_updateintervalClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
end.
|
@ -0,0 +1,95 @@
|
||||
object mainform: Tmainform
|
||||
Left = 1156
|
||||
Height = 129
|
||||
Top = 118
|
||||
Width = 185
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = 'mainform'
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
OnWindowStateChange = FormWindowStateChange
|
||||
Position = poScreenCenter
|
||||
ShowInTaskBar = stNever
|
||||
LCLVersion = '1.7'
|
||||
WindowState = wsMinimized
|
||||
object TrayIcon1: TTrayIcon
|
||||
BalloonFlags = bfInfo
|
||||
BalloonTimeout = 1000
|
||||
PopUpMenu = PopupMenu1
|
||||
Hint = 'LazAutoUpdate trayicon automatic updater'
|
||||
Visible = True
|
||||
OnClick = TrayIcon1Click
|
||||
OnDblClick = mnu_configureClick
|
||||
Left = 16
|
||||
Top = 56
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 16
|
||||
Top = 8
|
||||
object mnu_fileExit: TMenuItem
|
||||
Caption = 'Shutdown and E&xit'
|
||||
OnClick = mnu_fileExitClick
|
||||
end
|
||||
object mnu_configure: TMenuItem
|
||||
Caption = 'Configure...'
|
||||
OnClick = mnu_configureClick
|
||||
end
|
||||
object mnu_startAtOSStartUp: TMenuItem
|
||||
AutoCheck = True
|
||||
Caption = 'Runs at startup'
|
||||
ShowAlwaysCheckable = True
|
||||
OnClick = mnu_startAtOSStartUpClick
|
||||
end
|
||||
object mnu_SelfCheck: TMenuItem
|
||||
Caption = 'Update current profile now'
|
||||
OnClick = mnu_SelfCheckClick
|
||||
end
|
||||
object mnu_About: TMenuItem
|
||||
Caption = 'About...'
|
||||
OnClick = mnu_AboutClick
|
||||
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'Function NewVersionAvailable: Boolean'#13#10'Function DownloadNewVersion: Boolean'#13#10'Function UpdateToNewVersion: Boolean'#13#10'Procedure ShowWhatsNewIfAvailable'
|
||||
)
|
||||
About.Title = 'About LazAutoUpdate'
|
||||
About.Height = 450
|
||||
About.Width = 400
|
||||
About.Font.Color = clNavy
|
||||
About.Font.Height = -13
|
||||
About.BackGroundColor = clWindow
|
||||
About.Version = '0.0.8'
|
||||
About.Authorname = 'Gordon Bamber'
|
||||
About.Organisation = 'Public Domain'
|
||||
About.AuthorEmail = 'minesadorada@gmail.com'
|
||||
About.ComponentName = 'Laz Auto-update v0.0.8'
|
||||
About.LicenseType = abLGPL
|
||||
OnDebugEvent = LazAutoUpdate1DebugEvent
|
||||
SFProjectName = 'healthdailymonitor'
|
||||
UpdatesFolder = 'updates'
|
||||
VersionsININame = 'versions.ini'
|
||||
VersionCountLimit = 1000000
|
||||
DownloadCountLimit = 10000000
|
||||
end
|
||||
object idleReminder: TIdleTimer
|
||||
AutoEnabled = True
|
||||
Interval = 60000
|
||||
OnTimer = idleReminderTimer
|
||||
Left = 128
|
||||
Top = 16
|
||||
end
|
||||
object EventLog1: TEventLog
|
||||
AppendContent = False
|
||||
LogType = ltFile
|
||||
Active = False
|
||||
RaiseExceptionOnError = False
|
||||
DefaultEventType = etCustom
|
||||
CustomLogType = 0
|
||||
EventIDOffset = 0
|
||||
Paused = False
|
||||
Left = 132
|
||||
Top = 68
|
||||
end
|
||||
end
|
@ -0,0 +1,8 @@
|
||||
{"version":1,"strings":[
|
||||
{"hash":134533565,"name":"tmainform.caption","sourcebytes":[109,97,105,110,102,111,114,109],"value":"mainform"},
|
||||
{"hash":85488116,"name":"tmainform.mnu_fileexit.caption","sourcebytes":[83,104,117,116,100,111,119,110,32,97,110,100,32,69,38,120,105,116],"value":"Shutdown and E&xit"},
|
||||
{"hash":175001086,"name":"tmainform.mnu_configure.caption","sourcebytes":[67,111,110,102,105,103,117,114,101,46,46,46],"value":"Configure..."},
|
||||
{"hash":268321904,"name":"tmainform.mnu_startatosstartup.caption","sourcebytes":[82,117,110,115,32,97,116,32,115,116,97,114,116,117,112],"value":"Runs at startup"},
|
||||
{"hash":103935063,"name":"tmainform.mnu_selfcheck.caption","sourcebytes":[85,112,100,97,116,101,32,99,117,114,114,101,110,116,32,112,114,111,102,105,108,101,32,110,111,119],"value":"Update current profile now"},
|
||||
{"hash":158102910,"name":"tmainform.mnu_about.caption","sourcebytes":[65,98,111,117,116,46,46,46],"value":"About..."}
|
||||
]}
|
@ -0,0 +1,6 @@
|
||||
TMAINFORM.CAPTION=mainform
|
||||
TMAINFORM.MNU_FILEEXIT.CAPTION=Shutdown and E&xit
|
||||
TMAINFORM.MNU_CONFIGURE.CAPTION=Configure...
|
||||
TMAINFORM.MNU_STARTATOSSTARTUP.CAPTION=Runs at startup
|
||||
TMAINFORM.MNU_SELFCHECK.CAPTION=Update current profile now
|
||||
TMAINFORM.MNU_ABOUT.CAPTION=About...
|
755
components/lazautoupdate/latest_stable/trayicon/umainform.pas
Normal file
755
components/lazautoupdate/latest_stable/trayicon/umainform.pas
Normal file
@ -0,0 +1,755 @@
|
||||
unit umainform;
|
||||
|
||||
{ LazAutoUpdater Tray Updater
|
||||
|
||||
Copyright (C)2014 Gordon Bamber minesadorada@charcodelvalle.com
|
||||
|
||||
An example of using LazAutoUpdate as a silent updater
|
||||
|
||||
This source is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
details.
|
||||
|
||||
A copy of the GNU General Public License is available on the World Wide Web
|
||||
at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by writing
|
||||
to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
SUMMARY
|
||||
=======
|
||||
TrayUpdater is a companion to LazAutoUpdate and UpdatePack
|
||||
It sits in the system tray, and automatically checks for updates
|
||||
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.
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LazFileUtils,Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
Menus, uLongTimer, ulazautoupdate, inifiles, eventlog, strUtils, uconfigform
|
||||
{$IFDEF WINDOWS}, registry{$ENDIF};
|
||||
|
||||
type
|
||||
{ TAppRec - in-memory storage for all settings }
|
||||
TAppRec = record
|
||||
AppPrettyName: string;
|
||||
AppPath: string;
|
||||
INIPath: string;
|
||||
ZipPath: string;
|
||||
AppVersion: string;
|
||||
SFProjectName: string;
|
||||
SFUpdatesDirectory: string;
|
||||
Location: string;
|
||||
IntervalType: word;
|
||||
IntervalDay: word;
|
||||
IntervalDate: word;
|
||||
IntervalHour: word;
|
||||
Update: boolean;
|
||||
LastCheckDateTime: TDateTime;
|
||||
end;
|
||||
|
||||
{ Tmainform }
|
||||
Tmainform = class(TForm)
|
||||
EventLog1: TEventLog;
|
||||
idleReminder: TIdleTimer;
|
||||
LazAutoUpdate1: TLazAutoUpdate;
|
||||
mnu_About: TMenuItem;
|
||||
mnu_SelfCheck: TMenuItem;
|
||||
mnu_startAtOSStartUp: TMenuItem;
|
||||
mnu_configure: TMenuItem;
|
||||
mnu_fileExit: TMenuItem;
|
||||
PopupMenu1: TPopupMenu;
|
||||
TrayIcon1: TTrayIcon;
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormWindowStateChange(Sender: TObject);
|
||||
procedure idleReminderTimer(Sender: TObject);
|
||||
procedure LazAutoUpdate1DebugEvent(Sender: TObject; WhereAt, Message: string);
|
||||
procedure mnu_AboutClick(Sender: TObject);
|
||||
procedure mnu_configureClick(Sender: TObject);
|
||||
procedure mnu_fileExitClick(Sender: TObject);
|
||||
procedure mnu_startAtOSStartUpClick(Sender: TObject);
|
||||
procedure mnu_SelfCheckClick(Sender: TObject);
|
||||
procedure TrayIcon1Click(Sender: TObject);
|
||||
function UT_DateTimeToStr(TheDate: TDateTime): string;
|
||||
function UT_StrToDate(str: string): TDateTime;
|
||||
|
||||
private
|
||||
{ private declarations }
|
||||
szImportINIPath: string;
|
||||
DebugMode: boolean;
|
||||
procedure DoAlert(aAppname, aVersion: string);
|
||||
// Transfers info from lauimport.ini to local ini
|
||||
function ImportINIFile: boolean;
|
||||
// When first run, Populates INI and AppRecArray with default entry
|
||||
procedure PopulateOwnProfile;
|
||||
// Transfers info from local INI to AppRecArray
|
||||
procedure DoReadINIIntoAppRecArray;
|
||||
// Re-initialises a LongTimer array from AppRecArray info
|
||||
procedure DoSetupLongTimerArray;
|
||||
// All LongTimers use this for their OnTimer event
|
||||
procedure DoLongTimerEvent(Sender: TObject);
|
||||
// Do a silent check/install for this AppRecArray member
|
||||
procedure CheckAndUpdate(ARecIndex: integer);
|
||||
public
|
||||
{ public declarations }
|
||||
INI: TIniFile;
|
||||
AppRecArray: array of TAppRec; // Dynamic array
|
||||
LongTimerArray: array of TLongTimer; // Dynamic array
|
||||
iCurrentRecIndex: integer;
|
||||
// Transfers info from AppRecArray to local INI
|
||||
procedure DoWriteAppRecArrayIntoINI;
|
||||
end;
|
||||
|
||||
var
|
||||
mainform : Tmainform;
|
||||
|
||||
Const
|
||||
{$IFDEF WINDOWS}
|
||||
C_OS = 'win';
|
||||
{$ELSE}
|
||||
C_OS = 'linux';
|
||||
{$ENDIF}
|
||||
{$IFDEF CPU32}
|
||||
C_BITNESS = '32';
|
||||
{$ELSE}
|
||||
C_BITNESS = '64';
|
||||
{$ENDIF}
|
||||
C_PFX = C_OS + C_BITNESS;
|
||||
C_LAUTRayINI = 'lauimport' + C_PFX + '.ini';
|
||||
C_INIFilename = 'trayupdater' + C_PFX + '.ini';
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
resourcestring
|
||||
rs_balloontitle = '%s service';
|
||||
rs_trayloaded = '%s Loaded';
|
||||
rs_newversionavailable = 'A new version of %s (v%s) is available';
|
||||
// TODO: Put all the other strings here
|
||||
{$R *.lfm}
|
||||
|
||||
{ Tmainform }
|
||||
procedure Tmainform.DoWriteAppRecArrayIntoINI;
|
||||
// AppRecArray is an in-memory copy of the INI file
|
||||
var
|
||||
i : integer;
|
||||
szSection : string;
|
||||
begin
|
||||
if High(AppRecArray) = 0 then
|
||||
Exit;
|
||||
for i := Low(AppRecArray) to High(AppRecArray) do
|
||||
begin
|
||||
szSection := AppRecArray[i].AppPrettyName;
|
||||
try
|
||||
INI.WriteString(szSection, 'AppPrettyName', AppRecArray[i].AppPrettyName);
|
||||
INI.WriteString(szSection, 'AppPath', AppRecArray[i].AppPath);
|
||||
INI.WriteString(szSection, 'INIPath', AppRecArray[i].INIPath);
|
||||
INI.WriteString(szSection, 'ZipPath', AppRecArray[i].ZipPath);
|
||||
INI.WriteString(szSection, 'AppVersion', AppRecArray[i].AppVersion);
|
||||
INI.WriteString(szSection, 'SFProjectName', AppRecArray[i].SFProjectName);
|
||||
INI.WriteString(szSection, 'SFUpdatesDirectory',
|
||||
AppRecArray[i].SFUpdatesDirectory);
|
||||
INI.WriteString(szSection, 'Location', AppRecArray[i].Location);
|
||||
INI.WriteInteger(szSection, 'IntervalType', AppRecArray[i].IntervalType);
|
||||
INI.WriteInteger(szSection, 'IntervalDate', AppRecArray[i].IntervalDate);
|
||||
INI.WriteInteger(szSection, 'IntervalDay', AppRecArray[i].IntervalDay);
|
||||
INI.WriteInteger(szSection, 'IntervalHour', AppRecArray[i].IntervalHour);
|
||||
INI.WriteInteger(szSection, 'IntervalHour', AppRecArray[i].IntervalHour);
|
||||
INI.WriteBool(szSection, 'Update', AppRecArray[i].Update);
|
||||
INI.WriteString(szSection, 'LastCheckDateTime',
|
||||
UT_DateTimeToStr(AppRecArray[i].LastCheckDateTime));
|
||||
INI.UpdateFile;
|
||||
except
|
||||
if DebugMode then
|
||||
EventLog1.Error('Failed to write AppRecArray to %s', [INI.Filename])
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tmainform.DoLongTimerEvent(Sender: TObject);
|
||||
// All LongTimerArray.OnTimer events go here
|
||||
// The Tag property is the same as the AppRecArray entry it relates to
|
||||
var
|
||||
iTag : integer;
|
||||
begin
|
||||
iTag := 0;
|
||||
// Assertion check
|
||||
if Sender is TLongTimer then
|
||||
begin
|
||||
iTag := TLongTimer(Sender).Tag;
|
||||
end;
|
||||
if DebugMode then
|
||||
EventLog1.Log('Timer for %s fired', [AppRecArray[iTag].AppPrettyName]);
|
||||
TrayIcon1.BalloonHint :=
|
||||
Format('Checking %s for updates', [AppRecArray[iTag].AppPrettyName]);
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
CheckAndUpdate(iTag);
|
||||
// AppRecArray[iTag].LastCheckDateTime := Now();
|
||||
end;
|
||||
|
||||
procedure Tmainform.DoSetupLongTimerArray;
|
||||
// This is called every time the AppRecArray is changed
|
||||
// Each profile has a LongTimer associated with it in LongTimerArray()
|
||||
// If the AppRecArray.Update=TRUE then the associated LongTimer is enabled
|
||||
// 1. Destroy and clear all the LongTimers aready allocated
|
||||
// 2. Iterate through the AppRecArray, setting up a new LongTimer for each element
|
||||
// 3. Enable the LongTimers for which AppArray.Update=TRUE
|
||||
var
|
||||
i, iArrayElement : integer;
|
||||
begin
|
||||
// Start with an empty array
|
||||
for i := Low(LongTimerArray) to High(LongTimerArray) do
|
||||
if LongTimerArray[i] <> nil then
|
||||
begin
|
||||
LongTimerArray[i].Enabled := False;
|
||||
FreeAndNil(LongTimerArray[i]);
|
||||
end;
|
||||
SetLength(LongTimerArray, 0); // Zeros the array
|
||||
iArrayElement := -1;
|
||||
for i := Low(AppRecArray) to High(AppRecArray) do
|
||||
begin
|
||||
Inc(iArrayElement); // initially to zero
|
||||
SetLength(LongTimerArray, iArrayElement + 1);
|
||||
LongTimerArray[iArrayElement] := TLongTimer.Create(nil);
|
||||
with AppRecArray[i] do
|
||||
begin
|
||||
case IntervalType of
|
||||
0: LongTimerArray[iArrayElement].IntervalType := lt1Daily;
|
||||
1: LongTimerArray[iArrayElement].IntervalType := lt2Weekly;
|
||||
2: LongTimerArray[iArrayElement].IntervalType := lt3Monthly;
|
||||
end;
|
||||
case IntervalDay of
|
||||
0: LongTimerArray[iArrayElement].WeeklyDay := lt1Monday;
|
||||
1: LongTimerArray[iArrayElement].WeeklyDay := lt2Tuesday;
|
||||
2: LongTimerArray[iArrayElement].WeeklyDay := lt3Wednesday;
|
||||
3: LongTimerArray[iArrayElement].WeeklyDay := lt4Thursday;
|
||||
4: LongTimerArray[iArrayElement].WeeklyDay := lt5Friday;
|
||||
5: LongTimerArray[iArrayElement].WeeklyDay := lt6Saturday;
|
||||
6: LongTimerArray[iArrayElement].WeeklyDay := lt7Sunday;
|
||||
end;
|
||||
LongTimerArray[iArrayElement].MonthlyDate := IntervalDate;
|
||||
LongTimerArray[iArrayElement].Daily24Hour := IntervalHour;
|
||||
LongTimerArray[iArrayElement].Tag := i;
|
||||
LongTimerArray[iArrayElement].OnTimer := @DoLongTimerEvent;
|
||||
// Make sure timer doesn't fire right after a self-update
|
||||
LongTimerArray[iArrayElement].SampleInterval := lt5Every45Minutes;
|
||||
LongTimerArray[iArrayElement].Enabled := Update;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function Tmainform.UT_DateTimeToStr(TheDate: TDateTime): string;
|
||||
var
|
||||
frmstg : TFormatSettings;
|
||||
// Ensures consitent String dates across platforms
|
||||
begin
|
||||
//GetLocaleFormatSettings(0, frmstg);
|
||||
frmstg.DateSeparator := '-';
|
||||
frmstg.ShortDateFormat := 'yyyy-mm-dd';
|
||||
frmstg.TimeSeparator := '-';
|
||||
frmstg.LongTimeFormat := 'hh-nn';
|
||||
Result := DateTimeToStr(TheDate, frmstg);
|
||||
end;
|
||||
|
||||
function Tmainform.UT_StrToDate(str: string): TDateTime;
|
||||
var
|
||||
frmstg : TFormatSettings;
|
||||
// Ensures consitent String dates across platforms
|
||||
begin
|
||||
//GetLocaleFormatSettings(0, frmstg);
|
||||
frmstg.DateSeparator := '-';
|
||||
frmstg.ShortDateFormat := 'yyyy-mm-dd';
|
||||
frmstg.TimeSeparator := '-';
|
||||
frmstg.LongTimeFormat := 'hh-nn';
|
||||
if not TryStrToDateTime(str, Result, frmstg) then
|
||||
Result := Now();
|
||||
end;
|
||||
|
||||
procedure Tmainform.DoReadINIIntoAppRecArray;
|
||||
// AppRecArray is an in-memory copy of the INI file
|
||||
var
|
||||
SectionStringList : TStringList;
|
||||
szSection : string;
|
||||
i, iArrayElement : integer;
|
||||
begin
|
||||
SetLength(AppRecArray, 0); // Zeros the array
|
||||
SectionStringList := TStringList.Create;
|
||||
try
|
||||
try
|
||||
// Fetch all the section names
|
||||
INI.ReadSections(SectionStringList);
|
||||
iArrayElement := -1;
|
||||
if SectionStringList.Count > 0 then
|
||||
for i := 0 to SectionStringList.Count - 1 do
|
||||
begin // Loop through all the INI file sections
|
||||
szSection := SectionStringList[i];
|
||||
// Skip over the ProgramInfo section
|
||||
if (szSection <> 'ProgramInfo') then
|
||||
begin
|
||||
Inc(iArrayElement); // initially to zero
|
||||
SetLength(AppRecArray, iArrayElement + 1);
|
||||
AppRecArray[iArrayElement].AppPrettyName :=
|
||||
INI.ReadString(szSection, 'AppPrettyName', '');
|
||||
AppRecArray[iArrayElement].AppPath :=
|
||||
INI.ReadString(szSection, 'AppPath', '');
|
||||
AppRecArray[iArrayElement].INIPath :=
|
||||
INI.ReadString(szSection, 'INIPath', '');
|
||||
AppRecArray[iArrayElement].ZipPath :=
|
||||
INI.ReadString(szSection, 'ZipPath', '');
|
||||
AppRecArray[iArrayElement].AppVersion :=
|
||||
INI.ReadString(szSection, 'AppVersion', '');
|
||||
AppRecArray[iArrayElement].SFProjectName :=
|
||||
INI.ReadString(szSection, 'SFProjectName', '');
|
||||
AppRecArray[iArrayElement].SFUpdatesDirectory :=
|
||||
INI.ReadString(szSection, 'SFUpdatesDirectory', '');
|
||||
AppRecArray[iArrayElement].Location :=
|
||||
INI.ReadString(szSection, 'Location', '');
|
||||
AppRecArray[iArrayElement].IntervalType :=
|
||||
INI.ReadInteger(szSection, 'IntervalType', 0);
|
||||
AppRecArray[iArrayElement].IntervalDate :=
|
||||
INI.ReadInteger(szSection, 'IntervalDate', 1);
|
||||
AppRecArray[iArrayElement].IntervalDay :=
|
||||
INI.ReadInteger(szSection, 'IntervalDay', 0);
|
||||
AppRecArray[iArrayElement].IntervalHour :=
|
||||
INI.ReadInteger(szSection, 'IntervalHour', 9);
|
||||
AppRecArray[iArrayElement].Update :=
|
||||
INI.ReadBool(szSection, 'Update', False);
|
||||
AppRecArray[iArrayElement].LastCheckDateTime :=
|
||||
UT_StrToDate(INI.ReadString(szSection, 'LastCheckDateTime',
|
||||
UT_DateTimeToStr(Now)));
|
||||
end;
|
||||
end;
|
||||
except
|
||||
if DebugMode then
|
||||
EventLog1.Error('Failed to read AppRecArray from %s', [INI.Filename])
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(SectionStringList);
|
||||
end;
|
||||
// Low(AppRecArray) to High(AppRecArray) iterates the whole array
|
||||
end;
|
||||
|
||||
procedure Tmainform.PopulateOwnProfile;
|
||||
// Only called when app is first run
|
||||
var
|
||||
szSection, szOSsuffix : string;
|
||||
begin
|
||||
szSection := Application.Title;
|
||||
szOSsuffix := LowerCase(
|
||||
{$I %FPCTARGETOS%}
|
||||
);
|
||||
szSection += szOSsuffix;
|
||||
with INI do
|
||||
begin
|
||||
WriteString(szSection, 'AppPrettyName', szSection);
|
||||
WriteString(szSection, 'AppPath', ParamStr(0));
|
||||
WriteString(szSection, 'Location', ProgramDirectory);
|
||||
WriteString(szSection, 'INIPath', 'lautraynotify' + szOSsuffix + '.ini');
|
||||
WriteString(szSection, 'ZipPath', 'lautraynotify' + szOSsuffix + '.zip');
|
||||
WriteString(szSection, 'AppVersion', LazAutoUpdate1.AppVersion);
|
||||
WriteString(szSection, 'SFProjectName', 'lazautoupdate');
|
||||
WriteString(szSection, 'SFUpdatesDirectory', 'updates');
|
||||
WriteInteger(szSection, 'IntervalType', 0); // lt1Daily
|
||||
WriteInteger(szSection, 'IntervalDay', 0); // lt1Monday (dummy)
|
||||
WriteInteger(szSection, 'IntervalDate', 1); // 1st Month (dummy)
|
||||
WriteInteger(szSection, 'IntervalHour', 9); // 9am
|
||||
WriteBool(szSection, 'Update', False); // Dont autoupdate the default profile!
|
||||
WriteString(szSection, 'LastCheckDateTime', UT_DateTimeToStr(Now));
|
||||
WriteBool('ProgramInfo', 'IsVirgin', False);
|
||||
UpdateFile;
|
||||
end;
|
||||
with LazAutoUpdate1 do
|
||||
begin
|
||||
VersionsININame := 'lautraynotify' + szOSsuffix + '.ini';
|
||||
ZipFileName := 'lautraynotify' + szOSsuffix + '.zip';
|
||||
UpdatesFolder := 'updates';
|
||||
SFProjectName := 'lazautoupdate';
|
||||
end;
|
||||
DoReadINIIntoAppRecArray;
|
||||
if not FileExistsUTF8(C_LAUTRayINI) then
|
||||
LazAutoUpdate1.CreateLocalLauImportFile;
|
||||
LazAutoUpdate1.RelocateLauImportFile;
|
||||
end;
|
||||
|
||||
function Tmainform.ImportINIFile: boolean;
|
||||
// Copies ini info from shared AppData directory
|
||||
// Appends Location info to the AppPath entry
|
||||
// Sets Update=TRUE
|
||||
// into C_INIFilename then deletes source ini
|
||||
var
|
||||
ImportINI : TIniFile;
|
||||
SectionStringList, SectionContents : TStringList;
|
||||
i : integer;
|
||||
szSection, szKey, szLocation, szAppPath : string;
|
||||
begin
|
||||
{TODO: Preserve user Logtimer settings?}
|
||||
Result := False;
|
||||
if not FileExists(szImportINIPath) then
|
||||
Exit;
|
||||
ImportINI := TIniFile.Create(szImportINIPath);
|
||||
SectionStringList := TStringList.Create;
|
||||
SectionContents := TStringList.Create;
|
||||
try
|
||||
ImportINI.ReadSections(SectionStringList);
|
||||
if SectionStringList.Count > 0 then
|
||||
begin
|
||||
szSection := SectionStringList[0];
|
||||
ImportINI.ReadSection(szSection, SectionContents);
|
||||
for i := 0 to SectionContents.Count - 1 do
|
||||
begin
|
||||
szKey := SectionContents[i];
|
||||
if szKey = 'Location' then
|
||||
szLocation := ImportINI.ReadString(szSection, szKey, '');
|
||||
if szKey = 'AppPath' then
|
||||
szAppPath := ImportINI.ReadString(szSection, szKey, '');
|
||||
INI.WriteString(szSection, szKey, ImportINI.ReadString(
|
||||
szSection, szKey, ''));
|
||||
end;
|
||||
// Append Location to AppPath
|
||||
if ((szAppPath <> '') and (szLocation <> '')) then
|
||||
INI.WriteString(szSection, 'AppPath', AppendPathDelim(szLocation) +
|
||||
ExtractFilename(szAppPath));
|
||||
INI.WriteBool(szSection, 'Update', True);
|
||||
INI.WriteString(szSection, 'LastCheckDateTime',
|
||||
UT_DateTimeToStr(Now));
|
||||
INI.UpdateFile;
|
||||
Result := True;
|
||||
end;
|
||||
finally
|
||||
FreeAndNil(SectionContents);
|
||||
FreeAndNil(SectionStringList);
|
||||
FreeAndNil(ImportINI);
|
||||
end;
|
||||
if (Result = True) then
|
||||
begin
|
||||
if DebugMode then
|
||||
EventLog1.Log('%s: Imported %s into %s',
|
||||
[Application.Title, szImportINIPath, INI.Filename]);
|
||||
DoReadINIIntoAppRecArray;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tmainform.DoAlert(aAppname, aVersion: string);
|
||||
begin
|
||||
TrayIcon1.BalloonHint := Format(rs_newversionavailable, [aAppname, aVersion]);
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
end;
|
||||
|
||||
|
||||
procedure Tmainform.FormWindowStateChange(Sender: TObject);
|
||||
begin
|
||||
if mainform.WindowState = wsMinimized then
|
||||
begin
|
||||
// 2 lines below are ineffective at hiding the main form
|
||||
// Replaced with Application.ShowMainForm := false; in the lpr
|
||||
// mainform.WindowState := wsNormal;
|
||||
// mainform.Hide;
|
||||
mainform.ShowInTaskBar := stNever;
|
||||
// Log a successful startup
|
||||
if DebugMode then
|
||||
EventLog1.Active := True;
|
||||
if DebugMode then
|
||||
EventLog1.Log('%s version %s started OK',
|
||||
[Application.Title, LazAutoUpdate1.AppVersion]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tmainform.idleReminderTimer(Sender: TObject);
|
||||
// IdleTimer checks for any new C_LAUTRayINI in the AppData folder
|
||||
// If found, it is imported then deleted.
|
||||
begin
|
||||
if LazAutoUpdate1.DownloadInprogress then
|
||||
begin
|
||||
TrayIcon1.BalloonHint := 'Download in progress';
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
Exit;
|
||||
end;
|
||||
if FileExists(szImportINIPath) then
|
||||
begin
|
||||
if DebugMode then
|
||||
EventLog1.Log('%s: Import file %s discovered',
|
||||
[Application.Title, szImportINIPath]);
|
||||
if ImportINIFile then
|
||||
begin
|
||||
if DebugMode then
|
||||
EventLog1.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',
|
||||
[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]);
|
||||
end;
|
||||
|
||||
procedure Tmainform.mnu_AboutClick(Sender: TObject);
|
||||
var
|
||||
sz : string;
|
||||
begin
|
||||
LazAutoUpdate1.ResetAppVersion;
|
||||
sz := Application.Title + ' system tray application' + LineEnding;
|
||||
sz += Format('Version %s', [LazAutoUpdate1.AppVersion]) + LineEnding;
|
||||
sz += 'License: LGPLv2' + LineEnding + LineEnding;
|
||||
sz += Format('Using LazAutoUpdate v%s', [LazAutoUpdate1.AutoUpdateVersion]) +
|
||||
LineEnding;
|
||||
sz += Format('%s %s', [LazAutoUpdate1.LCLVersion, LazAutoUpdate1.FPCVersion]) +
|
||||
LineEnding;
|
||||
sz += Format('Compiled %s', [LazAutoUpdate1.LastCompiled]) + LineEnding;
|
||||
MessageDlg('About ' + Application.Title,
|
||||
sz, mtInformation, [mbOK], 0);
|
||||
end;
|
||||
|
||||
procedure Tmainform.mnu_configureClick(Sender: TObject);
|
||||
begin
|
||||
DoReadINIIntoAppRecArray;
|
||||
LazAutoUpdate1.ShowWhatsNewIfAvailable;
|
||||
configform.ShowModal;
|
||||
// may alter AppRecArray
|
||||
DoSetupLongTimerArray;
|
||||
DoWriteAppRecArrayIntoINI;
|
||||
end;
|
||||
|
||||
procedure Tmainform.mnu_fileExitClick(Sender: TObject);
|
||||
begin
|
||||
DoWriteAppRecArrayIntoINI;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure Tmainform.mnu_startAtOSStartUpClick(Sender: TObject);
|
||||
{$IFDEF WINDOWS}
|
||||
var
|
||||
Reg : TRegistry;
|
||||
{$ENDIF}
|
||||
begin
|
||||
{$IFDEF WINDOWS}
|
||||
Reg := TRegistry.Create(KEY_ALL_ACCESS);
|
||||
try
|
||||
Reg.RootKey := HKEY_CURRENT_USER;
|
||||
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run', False);
|
||||
if mnu_startAtOSStartUp.Checked then
|
||||
begin
|
||||
Reg.WriteString(Application.Title, ParamStr(0));
|
||||
INI.WriteBool('ProgramInfo', 'RunAtStartUp', True);
|
||||
if DebugMode then
|
||||
EventLog1.Log('Run at OS startup Activated');
|
||||
MessageDlg(Application.Title,
|
||||
'Run at OS startup activated OK', mtInformation, [mbOK], 0);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Reg.DeleteValue(Application.Title);
|
||||
INI.WriteBool('ProgramInfo', 'RunAtStartUp', False);
|
||||
if DebugMode then
|
||||
EventLog1.Log('Run at OS startup Deactivated');
|
||||
MessageDlg(Application.Title,
|
||||
'Run at OS startup deactivated OK', mtInformation, [mbOK], 0);
|
||||
end;
|
||||
Reg.CloseKey;
|
||||
finally
|
||||
FreeAndNil(Reg);
|
||||
end;
|
||||
{$ELSE}
|
||||
if mnu_startAtOSStartUp.Checked then
|
||||
begin
|
||||
ShowMessage('Sorry - not implemented in Linux in this version');
|
||||
mnu_startAtOSStartUp.Checked := False;
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TmainForm.CheckAndUpdate(ARecIndex: integer);
|
||||
begin
|
||||
if LazAutoUpdate1.DownloadInprogress then
|
||||
begin
|
||||
if DebugMode then
|
||||
EventLog1.Error(
|
||||
'Tried to update whilst download in progress. Exiting CheckAndUpdate routine');
|
||||
Exit;
|
||||
end;
|
||||
with AppRecArray[ARecIndex] do
|
||||
begin
|
||||
LazAutoUpdate1.AppFileWithPath := AppPath;
|
||||
LazAutoUpdate1.AppVersion := AppVersion;
|
||||
LazAutoUpdate1.ZipfileName := ZipPath;
|
||||
LazAutoUpdate1.SFProjectName := SFProjectName;
|
||||
LazAutoUpdate1.UpdatesFolder := SFUpdatesDirectory;
|
||||
LazAutoUpdate1.VersionsININame := INIPath;
|
||||
LazAutoUpdate1.CopyTree := True;
|
||||
TrayIcon1.BalloonHint :=
|
||||
Format('Checking %s for updates', [AppPrettyName]);
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
// Debugging line
|
||||
LazAutoUpdate1.DebugMode := True; // Logs everyting
|
||||
if LazAutoUpdate1.NewVersionAvailable then
|
||||
begin
|
||||
TrayIcon1.BalloonHint :=
|
||||
Format('Found newer version %s. Downloading...',
|
||||
[LazAutoUpdate1.GUIOnlineVersion]);
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
if LazAutoUpdate1.DownloadNewVersion then
|
||||
if LazAutoUpdate1.SilentUpdate then
|
||||
begin
|
||||
TrayIcon1.BalloonHint :=
|
||||
Format('Successfully updated %s to version %s',
|
||||
[AppPrettyName, LazAutoUpdate1.GUIOnlineVersion]);
|
||||
LastCheckDateTime := Now;
|
||||
end
|
||||
else
|
||||
TrayIcon1.BalloonHint := Format('Failed to update %s', [AppPrettyName]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
TrayIcon1.BalloonHint := AppPrettyName + ' is up-to-date';
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
end;
|
||||
LazAutoUpdate1.ResetAppVersion;
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tmainform.mnu_SelfCheckClick(Sender: TObject);
|
||||
// iCurrentRecIndex is the selected profile
|
||||
begin
|
||||
// Production line
|
||||
//CheckAndUpdate(0); // Default profile (self)
|
||||
|
||||
//Debugging line
|
||||
if DebugMode then
|
||||
EventLog1.Active := True;
|
||||
|
||||
ShowMessageFmt('Update %s', [AppRecArray[iCurrentRecIndex].AppPrettyName]);
|
||||
CheckAndUpdate(iCurrentRecIndex);
|
||||
end;
|
||||
|
||||
procedure Tmainform.TrayIcon1Click(Sender: TObject);
|
||||
begin
|
||||
if LazAutoUpdate1.DownloadInprogress then
|
||||
begin
|
||||
TrayIcon1.BalloonHint := 'Currently downloading...';
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure Tmainform.FormCreate(Sender: TObject);
|
||||
begin
|
||||
if LowerCase(ParamStr(1)) = 'debug' then
|
||||
DebugMode := True
|
||||
else
|
||||
DebugMode := False;
|
||||
// Initialise the App's main INI file
|
||||
Try
|
||||
INI := TIniFile.Create(GetAppConfigDir(False) + C_INIFilename);
|
||||
Except
|
||||
sleep(4000);
|
||||
If (INI = Nil) then
|
||||
INI := TIniFile.Create(GetAppConfigDir(False) + C_INIFilename);
|
||||
end;
|
||||
INI.CacheUpdates := False;
|
||||
INI.WriteString('ProgramInfo', 'AppName', Application.Title);
|
||||
INI.WriteString('ProgramInfo', 'Location', LazAutoUpdate1.AppFileWithPath);
|
||||
INI.WriteString('ProgramInfo', 'Version', LazAutoUpdate1.AppVersion);
|
||||
INI.WriteString('ProgramInfo', 'LastStarted',
|
||||
FormatDateTime(shortdateformat, Now));
|
||||
mnu_startAtOSStartUp.Checked := INI.ReadBool('ProgramInfo', 'RunAtStartUp', False);
|
||||
// Is this a first-time run?
|
||||
if INI.ReadBool('ProgramInfo', 'IsVirgin', True) then
|
||||
PopulateOwnProfile;
|
||||
// Start up a system Event Log
|
||||
if DebugMode then
|
||||
EventLog1.LogType := ltFile;
|
||||
if DebugMode then
|
||||
EventLog1.Filename := ExtractFileNameWithoutExt(ParamStr(0)) + '.log';
|
||||
// New logfile every time
|
||||
if DebugMode then
|
||||
if FileExistsUTF8(EventLog1.Filename) then
|
||||
DeleteFile(EventLog1.Filename);
|
||||
if DebugMode then
|
||||
EventLog1.AppendContent := True;
|
||||
if DebugMode then
|
||||
EventLog1.DefaultEventType := etInfo;
|
||||
if DebugMode then
|
||||
EventLog1.RaiseExceptionOnError := False;
|
||||
// EventLog1.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 := AppendPathDelim(szImportINIPath) + C_LAUTRayINI;
|
||||
// Initialise the AppRecArray
|
||||
DoReadINIIntoAppRecArray;
|
||||
// Use last saved Profile at startup
|
||||
iCurrentRecIndex := mainform.INI.ReadInteger('ProgramInfo',
|
||||
'CurrentProfileIndex', 0);
|
||||
DoSetupLongTimerArray;
|
||||
// Sort out the TrayIcon stuff
|
||||
TrayIcon1.Icon := Application.Icon;
|
||||
TrayIcon1.BalloonTitle := Format(rs_balloontitle, [Application.Title]);
|
||||
TrayIcon1.Hint := Application.Title;
|
||||
TrayIcon1.ShowIcon := True;
|
||||
TrayIcon1.Show;
|
||||
TrayIcon1.BalloonHint := Format(rs_trayloaded, [Application.Title]);
|
||||
TrayIcon1.ShowBalloonHint;
|
||||
LazAutoUpdate1.DebugMode := DebugMode;
|
||||
mnu_SelfCheck.Visible := DebugMode;
|
||||
end;
|
||||
|
||||
procedure Tmainform.FormShow(Sender: TObject);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure Tmainform.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
if LazAutoUpdate1.DownloadInprogress then
|
||||
begin
|
||||
ShowMessage('Please wait. Update in progress');
|
||||
CanClose := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if DebugMode then
|
||||
EventLog1.Log('User closed application');
|
||||
if DebugMode then
|
||||
EventLog1.Active := False;
|
||||
CanClose := True;
|
||||
end;
|
||||
if CanClose then
|
||||
begin
|
||||
// Clean up any LongTimers
|
||||
for i := Low(LongTimerArray) to High(LongTimerArray) do
|
||||
if LongTimerArray[i] <> nil then
|
||||
begin
|
||||
LongTimerArray[i].Enabled := False;
|
||||
FreeAndNil(LongTimerArray[i]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user