Archive: Catch detail from a external application


Catch detail from a external application
Hi

I want to execute some NSIS Setups in batch from my own C# Application. The NSIS Setups represent small AddOns for my application.

Now i want to hide the NSIS Setup completely (unvisible for the user or at least window is minimized). The output text of the detail window sould be display in my C# form.

Is this possibly to 'catch' the data from the setup (e.g. with a API?)


Sure. Firstly add SilentInstall silent (and you don't need any MUI stuff), then you can attach NSIS to STDOUT using this code:

Var /global STDOUT
System::Call `kernel32::GetStdHandle(i -11) i.s`
Pop $STDOUT
System::Call `kernel32::AttachConsole(i -1)`
Unfortunately you'll need to write to $STDOUT yourself; you can't get NSIS to output to it. That means all the standard installation window output will not be output. You will just have to write wrapper macros for all instructions that include:
FileWrite $STDOUT `text$\r$\n`
Stu

Thanks for your reply. Your solution sounds like a little bit complicated. I can't change the setup code of already existing AddOns later. Additionally the informations of standard installation window output is exactly that was i want to show.
So i'am looking for a way to 'read' the detailprint ListView otherwise.


You can use dumplog to export the contents to a txt file. Or you could simply do filewrite instead of detailprint each time.