Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Datei "update.dfm" nicht gefunden??? (https://www.delphipraxis.net/38517-datei-update-dfm-nicht-gefunden.html)

bjacke 20. Jan 2005 12:24


Datei "update.dfm" nicht gefunden???
 
Hi@all,
ich wollte mir Mal selber eine Unit zusammenschstern, aber bekomme diese Meldung. Da ich nciht weiß, ob das am Quelltext leigt, habe ich den gleich Mal mitgepostet.

Delphi-Quellcode:
unit update_unit;

interface

uses Windows, SysUtils, Classes, Forms, Controls, StdCtrls,
  Buttons, ExtCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdHTTP,Dialogs,MSXML2_TLB,ShellApi,IniFiles;


    procedure load ;
    procedure readxml;
    procedure ini;

var
  xmlDoc: IXMLDOMDocument2;
  close_upd :boolean;
  URL,version:string;

implementation
uses unit1;
{$R *.dfm}

procedure readxml;
Var ivers,url_xml,force_update:IXMLDOMnode; internet_addr:string;
Begin
  xmlDoc:=CoDomDocument40.Create;

 xmlDoc.setProperty('NewParser',true);                        //Laden der XML
 xmlDoc.load('http://de.geocities.com/boincobserver/update.xml') ;

   if xmlDoc.parseError.errorCode = 0 then
   Begin
   ivers:= xmldoc.selectSingleNode('BOINC-Observer/files/actual_version/version') ;
   version:= ivers.text;
     if Form1.versnum.Caption=ivers.text then Begin Form1.check_upd.Caption:='no update alivable';close_upd:=true;End
     else
      Begin
      force_update:= xmldoc.selectSingleNode('BOINC-Observer/files/actual_version/force_update') ;
      URL_xml:=xmldoc.selectSingleNode('BOINC-Observer/files/actual_version/force_update_url') ;
      if force_update.text='yes' then URL:=url_xml.text
       else
        Begin
        url_xml:= xmldoc.selectSingleNode('BOINC-Observer/files/actual_version/progam_url') ;
        URL:=url_xml.text;
        End;
    close_upd:=false;
      End;
  End
  else close_upd:=true;

End;

procedure ini;
var Ini: TIniFile;
Begin
  try
    Ini:=TIniFile.Create(ExtractFileDir(Application.ExeName)+'\BOINC-OBSERVER.ini');
    Begin
    Ini.WriteString('update','to version',version);
    Ini.WriteBool('update','to do',true);
    End;
  except
  Ini.Free
  End;
End;


procedure load ;
Var stream:Tstream; file_size:string; IdHttp:TIdHttp;
Begin

  IdHttp := IdHttp.Create(nil);


Form1.check_upd.Caption:='try to connect' ;

readxml;
if close_upd=false then
Begin
Form1.check_upd.Caption:='got data' ;
IdHTTP.Head(URL);
  if MessageDlg('Download the files now? ['+IntToStr(round(IdHTTP.Response.ContentLength /1048576))+' MB]', mtInformation, [mbYes, mbNo], 0)=mrYes then
 Begin
 stream := TFileStream.Create((ExtractFileDir(Application.ExeName)+'\update.zip'), fmCreate);
 Form1.check_upd.Caption:='downloading' ;
 try
   IdHTTP.Get(URL, stream);
  except
  on e: exception do
  ShowMessage('Error: ' + e.Message);
 end;
 stream.Free;
 Form1.check_upd.Caption:='updated';
 ini;
     if MessageDlg('Install the new version know or during the next start? (NOTE:BOINC-Observer will be short close!)', mtInformation, [mbYes, mbNo], 0)=mrYes then
       Begin

       Form1.Close;
       End

 End

 else Form1.check_upd.Caption:='aborted' ;

end

 else Form1.check_upd.Caption:='error' ;



end;

end.

sakura 20. Jan 2005 12:30

Re: Datei "update.dfm" nicht gefunden???
 
Entferne das {$R *.dfm} (Zeile 21)

...:cat:...

bjacke 20. Jan 2005 13:18

Re: Datei "update.dfm" nicht gefunden???
 
:oops: Danke.

Steve 20. Jan 2005 13:23

Re: Datei "update.dfm" nicht gefunden???
 
Hi,

kannst Du evtl. die "Offene Frage" als beantwortet markieren? Danke ;)

Gruß
Stephan :dance:


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:52 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz