Autor Beitrag
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 12:01 
Ich hab versucht so etwas wie einen "spiele-launcher" zu machen, und hab jetzt folgendes problem:

der user wählt bei einem Spiel die .exe aus, und dieser Pfad wird in eine Variable vom typ string geschrieben.
Nun möchte ich aber aus bestimmten Gründen auf den Pfad ohne die .exe oder auf eine andere zugreifen.

z.B der user wählt c:\programme\test\test.exe aus, und ich möchte dann diesen string so verändern das er c:\programme\test\test2.exe lautet.

Ist dies möglich?
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Fr 06.05.05 12:09 
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 06.05.05 12:20 
da gabs aber nen befehl für hieß der net: extractfilepath ???

oh habs falsch verstanden, naja strreplace gibts glaube ich auch noch :lol: naja egal

Moderiert:  Müll fabriziert :lol:


Zuletzt bearbeitet von F34r0fTh3D4rk am Fr 06.05.05 12:33, insgesamt 1-mal bearbeitet
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Fr 06.05.05 12:25 
user profile iconF34r0fTh3D4rk hat folgendes geschrieben:
da gabs aber nen befehl für hieß der net: extractfilepath ???

oh habs falsch verstanden, naja strreplace gibts glaube ich auch noch :lol: naja egal


Wenn dann ExtractFileExt würd ich mal sagen. Aber da er ja angibt das immer exen geöffnet werden, weiss er ja wo er kopieren muss. Bin mir aber auch nicht sicher ob ich verstanden habe was der Threadersteller meint.
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 12:39 
hm ich glaub ich hab mich n bissl merkwürdig ausgedrückt :lol:

also noch nen beispiel bei Warcraft 3 Throzen Throne (Zusatzset) gibt es im Warcraft3 Ordner 2 .exen,
Frozen Throne.exe und Warcraft III.exe
Ich möchte das der Benutzer nur Warcraft III.exe auswählen muss, der Pfad wird dann gespeichert:

OpenDialog1.Execute;
w3:=OpenDialog1.FileName;

Nun möchte ich diesen Pfad der in der Variable w3 vom Typ "string" gespeichert ist und der c:\Programme\Warcraft3\Warcraft III.exe lautet irgendwie umändern in c:\Programme\warcraft3\Frozen Throne.exe.

ich hoffe das ist besser beschrieben :?
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 06.05.05 12:43 
ausblenden Delphi-Quelltext
1:
extracfilepath(wc3) + 'Frozen Throne.exe'					
mtin Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Fr 06.05.05 15:05 
DANKE das is echt GENAU was ich brauchte :lol:
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 06.05.05 15:06 
echt jetzt ? LOL :lol: Bitte sehr :mrgreen: (ich dachte ich hätte müll geschrieben)

hab grad noch bissl code von meinem css-manager da:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.changeClick(Sender: TObject);
begin
  if opendialog1.Execute then 
    HL2path := opendialog1.FileName;
  HL2_Path.text:= HL2path;
  CStrikePath:= ExtractFileDir(HL2path)+'\cstrike\';
  GetFilesInDirectory(cstrikepath, '*.dem', demo_Listbox.Items, False, True);
  try
    Ini:=TIniFile.Create('C:\Settings.ini');
    Ini.WriteString('Run','HL2Path',HL2Path);
  finally
    Ini.Free;
  end;
end;