Autor Beitrag
Xadron
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: So 08.04.07 14:42 
Hallo,

Ich möchte ein Installation machen, die natürlich auch die Funktion der Deinstallation hat.
Ich weiß zwar wie man dateien kopiert, doch wie Ordner mit inhalt gelöscht werden weiß ich noch nicht.
Kann mir da mal jemand helfen?
Wie muss der Quellcode dafür heißen?

_________________
|x-32:88x+39-3|+3:21=47-4x
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 08.04.07 15:35 
Schau mal nach TSHFileOpStruct, SHFileOperation.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Xadron Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

XP
C++, D7, HTML
BeitragVerfasst: So 08.04.07 16:56 
Danke, ich beutze jetzt dies:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Program KillDir;
uses Dialogs, ShellAPI;

 procedure DoRemoveDir(Dir : string);
 var sh : TSHFileOpStruct;
 begin
  if Dir <> '' then if Dir[Length(Dir)] = '\' then system.delete(Dir, Length(Dir), 1);
  sh.Wnd := 0;
  sh.wFunc  := FO_DELETE;
  sh.pFrom  := PChar(Dir + #0#0);
  sh.pTo    := #0#0;
  sh.fFlags := FOF_NOERRORUI or FOF_NOCONFIRMMKDIR or FOF_SILENT or FOF_NOCONFIRMATION;
  sh.hNameMappings := NIL;
  sh.lpszProgressTitle := NIL;
  SHFileOperation(sh);
 end;

var Dir : String;

begin
 Dir := 'C:\Windows';
 if InputQuery('Welches Verzeichnis darf ich denn löschen?', 'Zu löschendes Verzeichnis', Dir) then
  DoRemoveDir(Dir);
end.


Es funktioniert auch super

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt

_________________
|x-32:88x+39-3|+3:21=47-4x