|
From: Jens F. <jfu...@us...> - 2004-12-19 23:59:09
|
Update of /cvsroot/jvcl/dev/Jens/JvProgramVersionCheck/Example In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24156/Jens/JvProgramVersionCheck/Example Modified Files: Main.dfm Main.pas Log Message: Updated Version Index: Main.pas =================================================================== RCS file: /cvsroot/jvcl/dev/Jens/JvProgramVersionCheck/Example/Main.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.pas 18 Dec 2004 02:18:57 -0000 1.2 --- Main.pas 19 Dec 2004 23:58:24 -0000 1.3 *************** *** 14,21 **** Label1: TLabel; Label2: TLabel; ! JvHttpUrlGrabber1: TJvHttpUrlGrabber; ! IdHTTP1: TIdHTTP; ProgramVersionCheck: TJvProgramVersionCheck; ! ImageList1: TImageList; procedure FormShow(Sender: TObject); private --- 14,31 ---- Label1: TLabel; Label2: TLabel; ! JvHttpUrlGrabber: TJvHttpUrlGrabber; ! IdHTTP: TIdHTTP; ProgramVersionCheck: TJvProgramVersionCheck; ! JvProgramVersionNetworkLocation1: TJvProgramVersionNetworkLocation; ! JvProgramVersionHTTPLocation1: TJvProgramVersionHTTPLocation; ! JvProgramVersionFTPLocation1: TJvProgramVersionFTPLocation; ! JvProgramVersionDatabaseLocation1: TJvProgramVersionDatabaseLocation; ! JvFtpUrlGrabber: TJvFtpUrlGrabber; ! function JvProgramVersionFTPLocation1LoadFileFromRemote( ! iProgramVersionLocation: TJvProgramVersionFTPLocation; const iRemotePath, ! iRemoteFileName, iLocalPath, iLocalFileName: string): string; ! function JvProgramVersionHTTPLocation1LoadFileFromRemote( ! iProgramVersionLocation: TJvProgramVersionHTTPLocation; const iRemotePath, ! iRemoteFileName, iLocalPath, iLocalFileName: string): string; procedure FormShow(Sender: TObject); private *************** *** 33,45 **** {$R *.dfm} procedure TForm1.VersionCheck; begin with ProgramVersionCheck do begin - // ProgramVersionCheckOptions.SupportedLocationTypes := [pvltNetwork, pvltHTTP, pvltFTP, pvltDatabase]; - // ProgramVersionCheckOptions.NetworkLocation.LocationPathVersion := GetCurrentDir+'\Version Check\Remote'; - // ProgramVersionCheckOptions.HTTPLocation.LocationPathVersion := 'www.oratool.de/test/ProjektVersions_http.ini'; - // ProgramVersionCheckOptions.LocalVersionInfoFileName := 'ProjektVersions.ini'; - // ProgramVersionCheckOptions.LocalDirectory := GetCurrentDir+'\Version Check'; Execute ; end; --- 43,52 ---- {$R *.dfm} + Uses JclFileUtils, JvTypes; + procedure TForm1.VersionCheck; begin with ProgramVersionCheck do begin Execute ; end; *************** *** 52,54 **** --- 59,96 ---- end; + function TForm1.JvProgramVersionHTTPLocation1LoadFileFromRemote( + iProgramVersionLocation: TJvProgramVersionHTTPLocation; const iRemotePath, + iRemoteFileName, iLocalPath, iLocalFileName: string): string; + begin + With JvHttpUrlGrabber do + begin + FileName := PathAppend(iLocalPath, iLocalFileName); + url := iRemotePath + iRemoteFilename; + OutputMode := omFile; + Start; + sleep (1000); + while Status <> gsStopped do + Application.HandleMessage; + Result := FileName; + end; + end; + + function TForm1.JvProgramVersionFTPLocation1LoadFileFromRemote( + iProgramVersionLocation: TJvProgramVersionFTPLocation; const iRemotePath, + iRemoteFileName, iLocalPath, iLocalFileName: string): string; + begin + With JvFtpUrlGrabber do + begin + FileName := PathAppend(iLocalPath, iLocalFileName); + url := iRemotePath + iRemoteFilename; + OutputMode := omFile; + Mode := hmBinary; + + Start; + while Status <> gsStopped do + Application.HandleMessage; + Result := FileName; + end; + end; + end. Index: Main.dfm =================================================================== RCS file: /cvsroot/jvcl/dev/Jens/JvProgramVersionCheck/Example/Main.dfm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.dfm 18 Dec 2004 02:18:57 -0000 1.2 --- Main.dfm 19 Dec 2004 23:58:24 -0000 1.3 *************** *** 55,66 **** Top = 15 end ! object JvHttpUrlGrabber1: TJvHttpUrlGrabber FileName = 'output.txt' Agent = 'JEDI-VCL' Port = 0 ! Left = 225 ! Top = 190 end ! object IdHTTP1: TIdHTTP AuthRetries = 0 AuthProxyRetries = 0 --- 55,66 ---- Top = 15 end ! object JvHttpUrlGrabber: TJvHttpUrlGrabber FileName = 'output.txt' Agent = 'JEDI-VCL' Port = 0 ! Left = 75 ! Top = 150 end ! object IdHTTP: TIdHTTP AuthRetries = 0 AuthProxyRetries = 0 *************** *** 75,100 **** Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)' HTTPOptions = [hoForceEncodeParams] ! Left = 255 ! Top = 310 end object ProgramVersionCheck: TJvProgramVersionCheck - SupportedLocationTypes = [pvltNetwork, pvltDatabase, pvltFTP, pvltHTTP] AllowedReleaseType = prtBeta CheckFrequency = 0 - LocationType = pvltNetwork LocalDirectory = 'Version Check' LocalVersionInfoFileName = 'ProgramVersionCheckLocal.Ini' ! Locations.Network.DownloadThreaded = False ! Locations.Network.VersionInfoLocationPath = 'Version Check\Remote' ! Locations.Network.VersionInfoFilename = 'ProjektVersions.ini' ! Locations.HTTP.DownloadThreaded = False ! Locations.HTTP.VersionInfoLocationPath = 'http://www.oratool.de/test' ! Locations.HTTP.VersionInfoFilename = 'ProjektVersions_http.ini' ! Locations.HTTP.ProxySettings.Port = 0 ! Locations.HTTP.PasswordRequired = False ! Locations.FTP.DownloadThreaded = False ! Locations.FTP.ProxySettings.Port = 0 ! Locations.FTP.PasswordRequired = False ! Locations.Database.DownloadThreaded = False AppStorage = JvAppIniFileStorageVersionCheck AppStoragePath = 'Local' --- 75,91 ---- Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)' HTTPOptions = [hoForceEncodeParams] ! Left = 350 ! Top = 260 end object ProgramVersionCheck: TJvProgramVersionCheck AllowedReleaseType = prtBeta CheckFrequency = 0 LocalDirectory = 'Version Check' LocalVersionInfoFileName = 'ProgramVersionCheckLocal.Ini' ! LocationTypeSelected = pvltNetwork ! LocationNetwork = JvProgramVersionNetworkLocation1 ! LocationHTTP = JvProgramVersionHTTPLocation1 ! LocationFTP = JvProgramVersionFTPLocation1 ! LocationDatabase = JvProgramVersionDatabaseLocation1 AppStorage = JvAppIniFileStorageVersionCheck AppStoragePath = 'Local' *************** *** 102,108 **** Top = 205 end ! object ImageList1: TImageList ! Left = 385 ! Top = 330 end end --- 93,125 ---- Top = 205 end ! object JvProgramVersionNetworkLocation1: TJvProgramVersionNetworkLocation ! VersionInfoLocationPath = 'Version Check\Remote' ! VersionInfoFilename = 'ProjektVersions.ini' ! Left = 105 ! Top = 200 ! end ! object JvProgramVersionHTTPLocation1: TJvProgramVersionHTTPLocation ! VersionInfoLocationPath = 'www.oratool.de/test' ! VersionInfoFilename = 'ProjektVersions_http.ini' ! PasswordRequired = False ! OnLoadFileFromRemote = JvProgramVersionHTTPLocation1LoadFileFromRemote ! Left = 105 ! Top = 240 ! end ! object JvProgramVersionFTPLocation1: TJvProgramVersionFTPLocation ! PasswordRequired = False ! OnLoadFileFromRemote = JvProgramVersionFTPLocation1LoadFileFromRemote ! Left = 105 ! Top = 280 ! end ! object JvProgramVersionDatabaseLocation1: TJvProgramVersionDatabaseLocation ! Left = 105 ! Top = 320 ! end ! object JvFtpUrlGrabber: TJvFtpUrlGrabber ! FileName = 'output.txt' ! Agent = 'JEDI-VCL' ! Left = 225 ! Top = 190 end end |