Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 30-04-2023, 17:36
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 688
Thanks: 481
Thanked 2,547 Times in 561 Posts
BLACKFIRE69 is on a distinguished road
Arrow CmdOut - Capture Cmd Output in Realtime [InnoSetup/Delphi]

CmdOut - Capture Cmd Output in Realtime

Code:
* Author:  Ele
* Modified by BLACKFIRE69.
Code:
1. Fixed several minor bugs.
2. Optimized performance.
3. Reduced the file size. [ 52.5 KB >> 31.5 KB ]

* Recommended Compiler:  InnoSetup v5 - Enhanced.

.
Attached Images
File Type: png 3.png (55.9 KB, 125 views)
File Type: png 0.png (97.9 KB, 125 views)
File Type: png 1.png (98.9 KB, 127 views)
File Type: png 2.png (94.3 KB, 125 views)

Last edited by BLACKFIRE69; 08-04-2026 at 13:22.
Reply With Quote
The Following 7 Users Say Thank You to BLACKFIRE69 For This Useful Post:
audiofeel (03-05-2023), Cesar82 (30-04-2023), Ele (26-06-2023), Gehrman (30-04-2023), LeVx (02-06-2023), ScOOt3r (30-04-2023), shazzla (01-05-2023)
Sponsored Links
  #2  
Old 08-04-2026, 13:22
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 688
Thanks: 481
Thanked 2,547 Times in 561 Posts
BLACKFIRE69 is on a distinguished road
Arrow Update - CmdOut v2.0

CmdOut - High-Performance Real-time CMD Capture API for Inno Setup
=============================================

Code:
> Overview:
CmdOut is a powerful, low-latency library designed to capture and display 
standard output (STDOUT) from command-line processes directly within Inno 
Setup. Re-written in Nim for maximum efficiency, it allows developers to 
integrate external tools (like 7-Zip, SREP, XTool, or custom batch files) 
into their installers with real-time feedback, progress tracking, and full 
process control.

> Specifications:
- Version	: v2.0.0.0
- Author	: BLACKFIRE (Original by Ele)
- Language	: Nim (v2.2.8)
- Compatibility	: Inno Setup v5.x, v6.x or later
- License       : Proprietary (See LICENSE file for details)
Code:
> Key Features:
- Real-time Capture: Blazing fast STDOUT capturing with persistent 
  buffer allocation to eliminate GC overhead and flickering.
- Smart UI Integration: Direct updates to TMemo handles with optimized 
  scrolling and redraw logic.
- Process Management: Full control to Suspend, Resume, or Stop the main 
  process and all its child processes.
- Auto-Progress Detection: Built-in logic to extract progress percentages 
  (e.g., "50%", "30.37%") or fractions (e.g., "5/10") from the console output.
- Advanced Targeting: Control specific sub-processes by name using 
  ISCmdCustomPause/Resume/Stop (e.g., target 'srep.exe' specifically).
- Windows Message Support: Control the console via SendMessage for 
  decoupled architecture.
- Performance Metrics: Retrieve Exit Codes, PIDs, and Elapsed Time (ms) 
  for precise post-execution logic.
- Visual Customization: Experimental support for changing console fonts 
  and adding custom header text to outputs.

> What's New in v2.0 (Nim Rewrite):
- Ported from Delphi to Nim: Significant reduction in DLL size and 
  improved performance.
- O(n) String Operations: Replaced repeated concatenations with 
  pre-calculated memory moves for large output handling.
- Modern API: Standardized buffer patterns for string returns and 
  Unicode (UTF-16) support throughout.
- Fixed UI Glitches: Resolved TMemo flickering and improved performance.
Code:
> Builds: optimized for speed, not size.

1. cmdout_clang.dll
    Size: 81 KB, Clang backend: v22.1.2

2. cmdout_gcc.dll
    Size: 99 KB, GCC backend  : v15.2.0

3. cmdout_msvc.dll
    Size: 143 KB, MSVC backend : v18.4.3

> Distribution Files:
- CmdOut.dll	— Core API Library.
- CmdOut.iss 	— Header for Inno Setup integration.
- Examples 	— 6 comprehensive .iss templates covering Common usage, 
		  Percentage tracking, Multi-handles, and Win-Messages.
- Quick Start Example -

[CODE]
Code:
#include "CmdOut.iss"

procedure InitializeWizard();
begin
  // Initialize with WizardForm handle and a Memo handle
  ISCmdInit(WizardForm.Handle, MyMemo.Handle, False, True);
end;

procedure DeinitializeSetup();
begin
  // if ISCmdRun is still running.
  bCmdOutAbort := True; // or ISCmdStop;
  ISCmdCleanup;
end;

procedure StartInstallation();
var
  Exe, Params, Dir: String;
begin
  Exe := ExpandConstant('{src}\tools\arc.exe');
  Params := 'a -m=lzma data.bin "_Pack\*"';
  Dir := ExpandConstant('{src}');

  // Run with real-time callback
  if ISCmdRun(Exe, Params, Dir, CreateCallback(@UpdateMemo)) then
    MsgBox('Process finished with code: ' + IntToStr(ISCmdGetExitCode), mbInformation, MB_OK);
end;

function UpdateMemo(const ACaption, AText: WideString; const hMemo: HWND): Boolean;
begin
  // Update UI and return True if you want to abort
  ISCmdUpdateMemo(hMemo, AText);
  Result := UserAborted; 
end;

.
Attached Images
File Type: png 1.png (33.2 KB, 39 views)
File Type: png 2.png (28.6 KB, 39 views)
File Type: png 3.png (35.2 KB, 39 views)
File Type: png 4.png (15.0 KB, 39 views)
File Type: png 5.png (25.0 KB, 39 views)
Attached Files
File Type: 7z CmdOut v2.0 + Examples.7z (2.61 MB, 12 views)
Reply With Quote
The Following 4 Users Say Thank You to BLACKFIRE69 For This Useful Post:
Cesar82 (08-04-2026), Dunnowho69 (10-04-2026), Ele (09-04-2026), Razor12911 (09-04-2026)
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CLS-ZStd Razor12911 Conversion Tutorials 19 26-06-2017 06:23
weird error.... sheykh PC Games 5 07-05-2006 20:23



All times are GMT -7. The time now is 15:23.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com