|
From: Jens F. <jfu...@us...> - 2004-12-19 23:59:13
|
Update of /cvsroot/jvcl/dev/Jens/JvProgramVersionCheck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24156/Jens/JvProgramVersionCheck Modified Files: JvProgramVersionCheck.pas Log Message: Updated Version Index: JvProgramVersionCheck.pas =================================================================== RCS file: /cvsroot/jvcl/dev/Jens/JvProgramVersionCheck/JvProgramVersionCheck.pas,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JvProgramVersionCheck.pas 18 Dec 2004 02:18:58 -0000 1.2 --- JvProgramVersionCheck.pas 19 Dec 2004 23:58:25 -0000 1.3 *************** *** 102,119 **** end; ! TJvProgramVersionCustomLocation = class(tPersistent) private ! FOwner: TComponent; FDownloadStatus : string; FDownloadThreaded: Boolean; protected procedure SetDownloadStatus (Value : string); ! property Owner: TComponent read FOwner; public ! constructor Create (AOwner : TComponent); virtual; ! function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; virtual; property DownloadStatus : string read FDownloadStatus write FDownloadStatus; published ! property DownloadThreaded: Boolean read FDownloadThreaded write FDownloadThreaded; end; --- 102,122 ---- end; ! TJvProgramVersionCustomLocation = class(tJvCustomPropertyStore) private ! // FOwner: TComponent; FDownloadStatus : string; FDownloadThreaded: Boolean; protected procedure SetDownloadStatus (Value : string); ! // property Owner: TComponent read FOwner; ! function LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; virtual; public ! // constructor Create (AOwner : TComponent); virtual; ! constructor Create (AOwner : TComponent); override; ! function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; ! function LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; virtual; property DownloadStatus : string read FDownloadStatus write FDownloadStatus; published ! property DownloadThreaded: Boolean read FDownloadThreaded write FDownloadThreaded default false; end; *************** *** 124,127 **** --- 127,131 ---- protected public + function LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; override; published property VersionInfoLocationPath : string read FVersionInfoLocationPath write FVersionInfoLocationPath; *************** *** 132,137 **** private protected public - function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; published end; --- 136,141 ---- private protected + function LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; public published end; *************** *** 160,164 **** destructor Destroy; override; published ! property ProxySettings: TJvProgramVersionProxySettings read FProxySettings write FProxySettings; property PasswordRequired: Boolean read FPasswordRequired write FPasswordRequired; end; --- 164,168 ---- destructor Destroy; override; published ! property ProxySettings: TJvProgramVersionProxySettings read FProxySettings ; property PasswordRequired: Boolean read FPasswordRequired write FPasswordRequired; end; *************** *** 171,176 **** FOnLoadFileFromRemote: TJvLoadFileFromRemoteHTTPEvent; protected public - function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; published property OnLoadFileFromRemote: TJvLoadFileFromRemoteHTTPEvent read FOnLoadFileFromRemote write FOnLoadFileFromRemote; --- 175,180 ---- FOnLoadFileFromRemote: TJvLoadFileFromRemoteHTTPEvent; protected + function LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; public published property OnLoadFileFromRemote: TJvLoadFileFromRemoteHTTPEvent read FOnLoadFileFromRemote write FOnLoadFileFromRemote; *************** *** 183,188 **** FOnLoadFileFromRemote: TJvLoadFileFromRemoteFTPEvent; protected public - function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; published property OnLoadFileFromRemote: TJvLoadFileFromRemoteFTPEvent read FOnLoadFileFromRemote write FOnLoadFileFromRemote; --- 187,192 ---- FOnLoadFileFromRemote: TJvLoadFileFromRemoteFTPEvent; protected + function LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; public published property OnLoadFileFromRemote: TJvLoadFileFromRemoteFTPEvent read FOnLoadFileFromRemote write FOnLoadFileFromRemote; *************** *** 199,204 **** FOnLoadFileFromRemote: TJvLoadFileFromRemoteDatabaseEvent; protected public ! function LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; published property ServerName : string read FServerName write FServerName; --- 203,209 ---- FOnLoadFileFromRemote: TJvLoadFileFromRemoteDatabaseEvent; protected + function LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; override; public ! function LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; override; published property ServerName : string read FServerName write FServerName; *************** *** 213,217 **** TJvProgramVersionLocationTypes = set of TJvProgramVersionLocationType; ! TJvProgramVersionLocations = class(TPersistent) private FNetwork : TJvProgramVersionNetworkLocation; --- 218,222 ---- TJvProgramVersionLocationTypes = set of TJvProgramVersionLocationType; ! TJvProgramVersionLocations = class(tJvCustomPropertyStore) private FNetwork : TJvProgramVersionNetworkLocation; *************** *** 219,230 **** FFTP : TJvProgramVersionFTPLocation; FDatabase : TJvProgramVersionDatabaseLocation; public ! constructor Create (AOwner : TComponent); virtual; destructor Destroy; override; published ! property Network : TJvProgramVersionNetworkLocation read FNetwork write FNetwork; ! property HTTP : TJvProgramVersionHTTPLocation read FHTTP write FHTTP; ! property FTP : TJvProgramVersionFTPLocation read FFTP write FFTP; ! property Database : TJvProgramVersionDatabaseLocation read FDatabase write FDatabase; end; --- 224,238 ---- FFTP : TJvProgramVersionFTPLocation; FDatabase : TJvProgramVersionDatabaseLocation; + protected + procedure Loaded; override; public ! // constructor Create (AOwner : TComponent); virtual; ! constructor Create (AOwner : TComponent); override; destructor Destroy; override; published ! property Network : TJvProgramVersionNetworkLocation read FNetwork ; ! property HTTP : TJvProgramVersionHTTPLocation read FHTTP ; ! property FTP : TJvProgramVersionFTPLocation read FFTP ; ! property Database : TJvProgramVersionDatabaseLocation read FDatabase ; end; *************** *** 241,257 **** //Property Variables FRemoteProgramVersionHistory : TJvProgramVersionHistory; ! FLocations: TJvProgramVersionLocations; FAllowedReleaseType : TJvProgramReleaseType; fLastCheck : tDateTime; fCheckFrequency : Integer; - fLocationType : TJvProgramVersionLocationType; fLocalDirectory : string; fLocalInstallerFileName : string; fLocalVersionInfoFileName : string; ! FSupportedLocationTypes : TJvProgramVersionLocationTypes; protected procedure StoreData; override; procedure LoadData; override; - procedure SetLocations (Value : TJvProgramVersionLocations); procedure Notification(AComponent: TComponent; Operation: TOperation); override; function GetAllowedRemoteProgramVersion : string; --- 249,270 ---- //Property Variables FRemoteProgramVersionHistory : TJvProgramVersionHistory; ! // FLocations: TJvProgramVersionLocations; FAllowedReleaseType : TJvProgramReleaseType; fLastCheck : tDateTime; fCheckFrequency : Integer; fLocalDirectory : string; fLocalInstallerFileName : string; fLocalVersionInfoFileName : string; ! FLocationTypeSelected: TJvProgramVersionLocationType; ! FLocationNetwork : TJvProgramVersionNetworkLocation; ! FLocationHTTP : TJvProgramVersionHTTPLocation; ! FLocationFTP : TJvProgramVersionFTPLocation; ! FLocationDatabase : TJvProgramVersionDatabaseLocation; protected + function GetLocationTypesSupported : TJvProgramVersionLocationTypes ; + + procedure Loaded; override; procedure StoreData; override; procedure LoadData; override; procedure Notification(AComponent: TComponent; Operation: TOperation); override; function GetAllowedRemoteProgramVersion : string; *************** *** 268,273 **** property RemoteAppStorage : TJvAppIniFileStorage read FRemoteAppStorage; procedure CheckLocalDirectory; ! function LoadRemoteVersionInfoFile : String; ! function LoadRemoteInstallerFile (iProgramVersionInfo : TJvProgramVersionInfo;iBaseThread : TJvBaseThread) : string; public constructor Create (AOwner : TComponent); override; --- 281,286 ---- property RemoteAppStorage : TJvAppIniFileStorage read FRemoteAppStorage; procedure CheckLocalDirectory; ! function LoadRemoteVersionInfoFile (const iLocalDirectory, iLocalVersionInfoFileName: string): String; ! function LoadRemoteInstallerFile (const iLocalDirectory, iLocalInstallerFileName: string;iProgramVersionInfo : TJvProgramVersionInfo;iBaseThread : TJvBaseThread) : string; public constructor Create (AOwner : TComponent); override; *************** *** 277,291 **** procedure ShowProgramVersionsDescription (const iFromVersion, iToVersion : string); function GetRemoteVersionOperation (Var ReleaseType : TJvProgramReleaseType) : TJvRemoteVersionOperation; property RemoteProgramVersionHistory : TJvProgramVersionHistory read FRemoteProgramVersionHistory write FRemoteProgramVersionHistory; property LastCheck : tDateTime read fLastCheck write fLastCheck; published - property SupportedLocationTypes : TJvProgramVersionLocationTypes read FSupportedLocationTypes write FSupportedLocationTypes default [pvltNetwork]; property AllowedReleaseType : TJvProgramReleaseType read FAllowedReleaseType write FAllowedReleaseType default prtProduction; property CheckFrequency : Integer read fCheckFrequency write fCheckFrequency; - property LocationType : TJvProgramVersionLocationType read fLocationType write fLocationType; property LocalDirectory : string read fLocalDirectory write fLocalDirectory; property LocalInstallerFileName : string read fLocalInstallerFileName write fLocalInstallerFileName; property LocalVersionInfoFileName : string read fLocalVersionInfoFileName write fLocalVersionInfoFileName; ! property Locations: TJvProgramVersionLocations read FLocations write SetLocations; property AboutJVCL; property AppStorage; --- 290,309 ---- procedure ShowProgramVersionsDescription (const iFromVersion, iToVersion : string); function GetRemoteVersionOperation (Var ReleaseType : TJvProgramReleaseType) : TJvRemoteVersionOperation; + function SelectedLocation : TJvProgramVersionCustomLocation; property RemoteProgramVersionHistory : TJvProgramVersionHistory read FRemoteProgramVersionHistory write FRemoteProgramVersionHistory; property LastCheck : tDateTime read fLastCheck write fLastCheck; + property LocationTypesSupported : TJvProgramVersionLocationTypes read GetLocationTypesSupported ; published property AllowedReleaseType : TJvProgramReleaseType read FAllowedReleaseType write FAllowedReleaseType default prtProduction; property CheckFrequency : Integer read fCheckFrequency write fCheckFrequency; property LocalDirectory : string read fLocalDirectory write fLocalDirectory; property LocalInstallerFileName : string read fLocalInstallerFileName write fLocalInstallerFileName; property LocalVersionInfoFileName : string read fLocalVersionInfoFileName write fLocalVersionInfoFileName; ! // property Locations: TJvProgramVersionLocations read FLocations ; ! property LocationTypeSelected : TJvProgramVersionLocationType read FLocationTypeSelected write FLocationTypeSelected; ! property LocationNetwork : TJvProgramVersionNetworkLocation read FLocationNetwork write FLocationNetwork; ! property LocationHTTP : TJvProgramVersionHTTPLocation read FLocationHTTP write FLocationHTTP; ! property LocationFTP : TJvProgramVersionFTPLocation read FLocationFTP write FLocationFTP; ! property LocationDatabase : TJvProgramVersionDatabaseLocation read FLocationDatabase write FLocationDatabase; property AboutJVCL; property AppStorage; *************** *** 583,608 **** constructor TJvProgramVersionCustomLocation.create (AOwner : TComponent); begin ! inherited create; ! FOwner := AOwner; FDownloadStatus := ''; ! // IgnoreLastLoadTime := True; end; ! function TJvProgramVersionCustomLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin DownloadStatus := RsPVCDownloading; end; procedure TJvProgramVersionCustomLocation.SetDownloadStatus (Value : string); begin FDownloadStatus := Value; ! if Assigned(Owner) and ! (Owner is TJvProgramVersionCheck) then ! TJvProgramVersionCheck(Owner).SetThreadInfo(Value); end; //=== { tJvProgramVersionNetworkLocation } ========================================= ! function TJvProgramVersionNetworkLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; Function FileExistsNoDir (iFilename : string) : boolean; --- 601,645 ---- constructor TJvProgramVersionCustomLocation.create (AOwner : TComponent); begin ! // inherited create; ! inherited create(AOwner); ! // SetSubComponent(True); ! // FOwner := AOwner; ! FDownloadThreaded := False; FDownloadStatus := ''; ! IgnoreLastLoadTime := True; ! IgnoreProperties.Add('DownloadThreaded'); end; ! function TJvProgramVersionCustomLocation.LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin DownloadStatus := RsPVCDownloading; end; + function TJvProgramVersionCustomLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; + begin + Result := LoadFileFromRemoteInt (iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName,iBaseThread); + end; + + function TJvProgramVersionCustomLocation.LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; + begin + end; + procedure TJvProgramVersionCustomLocation.SetDownloadStatus (Value : string); begin FDownloadStatus := Value; ! // if Assigned(Owner.Owner) and ! // (Owner.Owner is TJvProgramVersionCheck) then ! // TJvProgramVersionCheck(Owner.Owner).SetThreadInfo(Value); ! end; ! ! //=== { TJvProgramVersionCustomFileBasedLocation } ========================================= ! function TJvProgramVersionCustomFileBasedLocation.LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; ! begin ! Result := LoadFileFromRemote (VersionInfoLocationPath, VersionInfoFilename, iLocalDirectory, iLocalVersionInfoFileName, iBaseThread); end; //=== { tJvProgramVersionNetworkLocation } ========================================= ! function TJvProgramVersionNetworkLocation.LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; Function FileExistsNoDir (iFilename : string) : boolean; *************** *** 648,652 **** //=== { tJvProgramVersionHTTPLocation } ========================================= ! function TJvProgramVersionHTTPLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; --- 685,689 ---- //=== { tJvProgramVersionHTTPLocation } ========================================= ! function TJvProgramVersionHTTPLocation.LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; *************** *** 657,661 **** //=== { tJvProgramVersionFTPLocation } ========================================= ! function TJvProgramVersionFTPLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; --- 694,698 ---- //=== { tJvProgramVersionFTPLocation } ========================================= ! function TJvProgramVersionFTPLocation.LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; *************** *** 666,670 **** //=== { tJvProgramVersionDatabaseLocation } ========================================= ! function TJvProgramVersionDatabaseLocation.LoadFileFromRemote (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; --- 703,707 ---- //=== { tJvProgramVersionDatabaseLocation } ========================================= ! function TJvProgramVersionDatabaseLocation.LoadFileFromRemoteInt (const iRemotePath, iRemoteFileName, iLocalPath, iLocalFileName: string; iBaseThread : TJvBaseThread) : string; begin Result := ''; *************** *** 673,685 **** end; //=== { TJvProgramVersionLocations } ========================================= constructor TJvProgramVersionLocations.create (AOwner : TComponent); begin ! inherited create; ! FNetwork := TJvProgramVersionNetworkLocation.Create(AOwner); ! FHTTP := TJvProgramVersionHTTPLocation.Create(AOwner); ! FFTP := TJvProgramVersionFTPLocation.Create(AOwner); ! FDatabase := TJvProgramVersionDatabaseLocation.Create(AOwner); end; --- 710,733 ---- end; + function TJvProgramVersionDatabaseLocation.LoadVersionInfoFromRemote (const iLocalDirectory, iLocalVersionInfoFileName: string; iBaseThread : TJvBaseThread) : string; + begin + Result := LoadFileFromRemote (SelectStatementVersion, '', iLocalDirectory, iLocalVersionInfoFileName, iBaseThread); + end; + //=== { TJvProgramVersionLocations } ========================================= constructor TJvProgramVersionLocations.create (AOwner : TComponent); begin ! inherited create(AOwner); ! SetSubComponent(True); ! IgnoreLastLoadTime := True; ! // FNetwork := TJvProgramVersionNetworkLocation.Create(AOwner); ! // FHTTP := TJvProgramVersionHTTPLocation.Create(AOwner); ! // FFTP := TJvProgramVersionFTPLocation.Create(AOwner); ! // FDatabase := TJvProgramVersionDatabaseLocation.Create(AOwner); ! FNetwork := TJvProgramVersionNetworkLocation.Create(Self); ! FHTTP := TJvProgramVersionHTTPLocation.Create(Self); ! FFTP := TJvProgramVersionFTPLocation.Create(Self); ! FDatabase := TJvProgramVersionDatabaseLocation.Create(Self); end; *************** *** 693,696 **** --- 741,749 ---- end; + procedure TJvProgramVersionLocations.Loaded; + begin + inherited Loaded; + end; + //=== { tJvProgramVersionCheck } ========================================= *************** *** 729,747 **** IgnoreProperties.Add('LocalInstallerFileName'); IgnoreProperties.Add('LocalVersionInfoFileName'); - IgnoreProperties.Add('SupportedLocationTypes'); IgnoreProperties.Add('RemoteAppStorage'); ! FSupportedLocationTypes := [pvltNetwork]; ! FLocations:= TJvProgramVersionLocations.Create(self); ! fLocationType := pvltNetWork; FAllowedReleaseType := prtProduction; fLocalInstallerFileName := ''; fLocalVersionInfoFileName := 'versioninfo.ini'; ! end; destructor TJvProgramVersionCheck.destroy; begin ! FreeAndNil(FLocations); FreeAndNil(FThreadDialog); FreeAndNil(FThread); --- 782,797 ---- IgnoreProperties.Add('LocalInstallerFileName'); IgnoreProperties.Add('LocalVersionInfoFileName'); IgnoreProperties.Add('RemoteAppStorage'); ! // FLocations:= TJvProgramVersionLocations.Create(self); FAllowedReleaseType := prtProduction; fLocalInstallerFileName := ''; fLocalVersionInfoFileName := 'versioninfo.ini'; ! FLocationTypeSelected := pvltNetWork; end; destructor TJvProgramVersionCheck.destroy; begin ! // FreeAndNil(FLocations); FreeAndNil(FThreadDialog); FreeAndNil(FThread); *************** *** 750,759 **** end; ! procedure TJvProgramVersionCheck.SetLocations (Value : TJvProgramVersionLocations); begin ! FLocations.Network.Assign(Value.Network); ! FLocations.HTTP.Assign(Value.HTTP); ! FLocations.FTP.Assign(Value.FTP); ! FLocations.Database.Assign(Value.Database); end; --- 800,819 ---- end; ! procedure TJvProgramVersionCheck.Loaded; begin ! inherited Loaded; ! end; ! ! function TJvProgramVersionCheck.GetLocationTypesSupported : TJvProgramVersionLocationTypes ; ! begin ! Result := []; ! if Assigned(FLocationNetwork) then ! Result := Result + [pvltNetWork]; ! if Assigned(FLocationDatabase) then ! Result := Result + [pvltDatabase]; ! if Assigned(FLocationHTTP) then ! Result := Result + [pvltHTTP]; ! if Assigned(FLocationFTP) then ! Result := Result + [pvltFTP]; end; *************** *** 773,776 **** --- 833,848 ---- begin Inherited Notification(AComponent, Operation); + + if Operation = opRemove then + begin + if AComponent = FLocationNetwork then + FLocationNetwork := nil + else if AComponent = FLocationDatabase then + FLocationDatabase := nil + else if AComponent = FLocationHTTP then + FLocationHTTP := nil + else if AComponent = FLocationFTP then + FLocationFTP := nil + end; end; *************** *** 951,955 **** if Assigned(fExecuteVersionInfo) then begin ! fExecuteDownloadInstallFilename := LoadRemoteInstallerFile (fExecuteVersionInfo, FThread.LastThread); if (fExecuteDownloadInstallFilename <> '') and not FileExists(fExecuteDownloadInstallFilename) then --- 1023,1027 ---- if Assigned(fExecuteVersionInfo) then begin ! fExecuteDownloadInstallFilename := LoadRemoteInstallerFile (LocalDirectory, LocalInstallerFileName, fExecuteVersionInfo, FThread.LastThread); if (fExecuteDownloadInstallFilename <> '') and not FileExists(fExecuteDownloadInstallFilename) then *************** *** 1020,1028 **** fExecuteVersionInfo:= nil; LoadProperties; ! if (LastCheck < now-CheckFrequency) then begin - AllowedReleaseType := prtAlpha; LastCheck:= Now; ! RemoteAppStorage.FileName := LoadRemoteVersionInfoFile; if RemoteAppStorage.FileName <> '' then begin --- 1092,1100 ---- fExecuteVersionInfo:= nil; LoadProperties; ! if (LastCheck < now-CheckFrequency) and ! (LocationTypesSupported <> []) then begin LastCheck:= Now; ! RemoteAppStorage.FileName := LoadRemoteVersionInfoFile(LocalDirectory, LocalVersionInfoFileName); if RemoteAppStorage.FileName <> '' then begin *************** *** 1050,1080 **** end; ! function TJvProgramVersionCheck.LoadRemoteVersionInfoFile : String; begin ! Case LocationType of ! pvltDatabase : Result := Locations.Database.LoadFileFromRemote(Locations.Database.SelectStatementVersion, '', LocalDirectory, LocalVersionInfoFileName, nil); ! pvltHTTP : Result := Locations.HTTP.LoadFileFromRemote(Locations.HTTP.VersionInfoLocationPath, Locations.HTTP.VersionInfoFilename, LocalDirectory, LocalVersionInfoFileName, nil); ! pvltFTP : Result := Locations.FTP.LoadFileFromRemote(Locations.FTP.VersionInfoLocationPath, Locations.FTP.VersionInfoFilename, LocalDirectory, LocalVersionInfoFileName, nil); else ! Result := Locations.Network.LoadFileFromRemote(Locations.Network.VersionInfoLocationPath, Locations.Network.VersionInfoFilename, LocalDirectory, LocalVersionInfoFileName, nil); ! end; end; ! function TJvProgramVersionCheck.LoadRemoteInstallerFile (iProgramVersionInfo : TJvProgramVersionInfo;iBaseThread : TJvBaseThread) : String; begin // sleep(5000); ! if Assigned(iProgramVersionInfo) then ! Case LocationType of ! pvltDatabase : Result := Locations.Database.LoadFileFromRemote(iProgramVersionInfo.ProgramLocationPath, iProgramVersionInfo.ProgramLocationFileName, LocalDirectory, LocalInstallerFileName, iBaseThread); ! pvltHTTP : Result := Locations.HTTP.LoadFileFromRemote(iProgramVersionInfo.ProgramLocationPath, iProgramVersionInfo.ProgramLocationFileName, LocalDirectory, LocalInstallerFileName, iBaseThread); ! pvltFTP : Result := Locations.FTP.LoadFileFromRemote(iProgramVersionInfo.ProgramLocationPath, iProgramVersionInfo.ProgramLocationFileName, LocalDirectory, LocalInstallerFileName, iBaseThread); ! else ! Result := Locations.Network.LoadFileFromRemote(iProgramVersionInfo.ProgramLocationPath, iProgramVersionInfo.ProgramLocationFileName, LocalDirectory, LocalInstallerFileName, iBaseThread); ! end else Result := ''; end; ! {$IFDEF UNITVERSIONING} --- 1122,1154 ---- end; ! function TJvProgramVersionCheck.LoadRemoteVersionInfoFile(const iLocalDirectory, iLocalVersionInfoFileName: string) : String; begin ! if SelectedLocation <> nil then ! Result := SelectedLocation.LoadVersionInfoFromRemote(iLocalDirectory, iLocalVersionInfoFileName, nil) else ! Result := ''; end; ! function TJvProgramVersionCheck.LoadRemoteInstallerFile (const iLocalDirectory, iLocalInstallerFileName: string;iProgramVersionInfo : TJvProgramVersionInfo;iBaseThread : TJvBaseThread) : String; begin // sleep(5000); ! if Assigned(iProgramVersionInfo) and ! (SelectedLocation <> nil) then ! Result := SelectedLocation.LoadFileFromRemote(iProgramVersionInfo.ProgramLocationPath, iProgramVersionInfo.ProgramLocationFileName, iLocalDirectory, iLocalInstallerFileName, iBaseThread) else Result := ''; end; ! function TJvProgramVersionCheck.SelectedLocation : TJvProgramVersionCustomLocation; ! begin ! Case LocationTypeSelected of ! pvltDatabase : Result := LocationDatabase; ! pvltHTTP : Result := LocationHTTP; ! pvltFTP : Result := LocationFTP; ! pvltNetwork : Result := LocationNetwork; ! else ! Result := nil; ! end ! end; {$IFDEF UNITVERSIONING} |