Autor Beitrag
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 03.09.06 15:03 
Gibt es eine möglichkeit eine .EXE in meinem programm zu tun und nur von dort aus zu starten?
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: So 03.09.06 15:07 
Meinst Du sowas wie eine Sandbox - wäre mir neu, es sei denn, Du wolltest ein Betriebssystem programmieren :?
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: So 03.09.06 15:23 
Oder meinst du ne Exe als Ressource einbinden und bei Bedarf extrahieren und ausführen?

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 03.09.06 15:34 
Zitat:
Oder meinst du ne Exe als Ressource einbinden und bei Bedarf extrahieren und ausführen?

Ja oder sowas ^^
Also so z.b. Hat man 2 exen Die eine soll man nur ausführen die adnere soll erst gar nicht sichtbar sein und von der ersten exe aus gestartet werden
Ob man die nun dafür extrahiert ist egal wäre auch ok :)
Nur wie ich das anstellen soll weiß ich nicht also das einbinden und extrahieren (ausführen geht ja mit ShellExecute )
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: So 03.09.06 16:25 
Mit ShellExecuteAndWait kannst Du die andere (zu startende Anwendung unsichtbar im Hintergrund ausführen lassen):

ausblenden volle Höhe 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:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
Uses ... tlhelp32

var
  Form1: TForm1;
  function ShellExecuteAndWait(FileName: string; ShowCmd: DWORD): Longword;

implementation

{$R *.DFM}

...

function ShellExecuteAndWait(FileName: string; ShowCmd: DWORD): Longword;
var
  StartupInfo: TStartupInfo;
  ProcessInfo: TProcessInformation;
  wait: Boolean;
  ProcID: PDWORD;
begin
  wait:=true;
  ProcID:=nil;

  FillChar(StartupInfo, SizeOf(StartupInfo), #0);
  StartupInfo.cb := SizeOf(StartupInfo);
  StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
  StartupInfo.wShowWindow := ShowCmd;
  if not CreateProcess(nil,@Filename[1], nil, nil, False, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil,  StartupInfo, ProcessInfo)
    then
    Result := WAIT_FAILED
  else
  begin
    if wait = FALSE then
    begin
      if ProcID <> nil then
        ProcID^ := ProcessInfo.dwProcessId;
      result := WAIT_FAILED;
      exit;
    end;
    WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
    GetExitCodeProcess(ProcessInfo.hProcess, Result);
  end;
  if ProcessInfo.hProcess <> 0 then
    CloseHandle(ProcessInfo.hProcess);
  if ProcessInfo.hThread <> 0 then
    CloseHandle(ProcessInfo.hThread);
end;

//nun ausführen (ohne sichtbares Fenster) und auf Ausführung warten

ShellExecuteAndWait(meinPfad+meinProgramm,SW_HIDE);
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: So 03.09.06 19:07 
ne ich glaub das haste falsch verstanden ^^

2 exe eine ist sichtbar die adnere soll in der ersten exe drinne stecken und von dort auch nur ausgeführt werden ?!
Ist das möglich?
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 03.09.06 19:42 
Wie meinst du "nur von da drinnen ausgeführt werden"? DAs versteh ich nicht. Wenn du procedures und functions aus einer externen Datei ausführen willst, nimm ne dll. Das Betriebssystem ist die einzigste Instanz, die Programme letztendlich ausführt.

Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: So 03.09.06 19:55 
Suchen ist schin schwierig oder?

www.delphi-forum.de/...hlight=exe+einbinden

"Exe einbinden"

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Di 05.09.06 09:48 
Das ist ja schön und gut aber da brauche ich trozdem die exe bzw die file irgendwo.
Das ist doof :( ich wollte ja mal den ganzen inhalt der exe ins memo oder sonstwo reintun das problem ist das es zu viele zeicen sind (3,8 mb große exe).
Also gibt es keine adnere möglichkeit ja? nagut ich werde mir was einfallen lassen ...
Grendel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 443

Gentoo Linux, MacOS X, Win 2000
D5 Ent, D7 Ent, Lazarus, Anjuta, MonoDevelop
BeitragVerfasst: Di 05.09.06 10:36 
Leg die exe doch einfach ins %TEMP% Verzeichnis und führe sie dort aus.

Bis neulich ...
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 05.09.06 12:04 
user profile iconSimak hat folgendes geschrieben:
die adnere soll in der ersten exe drinne stecken und von dort auch nur ausgeführt werden ?!
Ist das möglich?

Nein. Pack sie in die Ressource der Exe, entpacke sie zur Laufzeit auf die Festplatte und starte sie von da. Alles andere ist blödsinn.

Wozu soll das eigentlich gut sein? Was hast du vor?