Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Delphi Exit Codes from 7-Zip ? (https://www.delphipraxis.net/172753-exit-codes-7-zip.html)

Stefanie 21. Jan 2013 10:27

Exit Codes from 7-Zip ?
 
Hallo

wie komme ich an die Exit Codes von 7z nach der Ausführung.
Möchte wissen ob fehlerfrei gepackt wurde oder ein Fehler aufgetreten ist(Code 0 = No error ).

mein bisheriger Aufruf:
Delphi-Quellcode:
ZipCommand := 'a -t7z "' + ZipDestin + '" "' + ZipSource + '"';
ShellExecute(0, Nil, PChar('C:\Programme\7-Zip\7zG.exe'), Pchar(ZipCommand), Pchar(ZipDestin), SW_SHOWNORMAL);
Beschreibung in der 7z Hilfe

Exit Codes from 7-Zip
7-Zip returns the following exit codes:

Code Meaning
0 No error
1 Warning (Non fatal error(s)). For example, one or more files were locked by some other application, so they were not compressed.
2 Fatal error
7 Command line error
8 Not enough memory for operation
255 User stopped the process

WM_CLOSE 21. Jan 2013 10:34

AW: Exit Codes from 7-Zip ?
 
<del>

sahimba 21. Jan 2013 10:35

AW: Exit Codes from 7-Zip ?
 
Dann wirst Du CreateProcess verwenden und auf Beendigung warten müssen.
Beispiele finden sich hier im Forum sicher reichlich.

CCRDude 21. Jan 2013 10:36

AW: Exit Codes from 7-Zip ?
 
1. Mit CreateProcess starten.
2. Auf Ende des Prozesses warten (WaitForSingleObject(processinfo.hProcess).
3. ExitCode auswerten (GetExitCodeProcess(processinfo.hProcess, FExitCode)).

WM_CLOSE 21. Jan 2013 10:45

AW: Exit Codes from 7-Zip ?
 
Das oben Nicht beachten, mein Fehler.

http://www.entwickler-ecke.de/topic_...n_82439,0.html

Stefanie 21. Jan 2013 11:12

AW: Exit Codes from 7-Zip ?
 
Danke,

mit CreateProcess klappts.


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:46 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