Archive: how to get information about progress


how to get information about progress
hi
1. I prepared nsis installer "installprogram.exe"
2. I run this installer form another program "MyProgram" in "silent mode"
3. how can I get the information about instalation progress ( I want to display progress in MyProgram)


You could write to a text file that has progress=x% and then read it from the main installer. Don't forget to use a mutex on this file when reading/writing, though.


Yes, but how get "value of progress"?


If you mean % complete, then you can't unless you write the % complete to the registry or an INI file between each instruction in your installer.
In other words, if you only have 4 File instructions you can only have 3 instructions writing "25%".

-Stu


If MyProgram can get window handle for installer's progress bar, so it can get ProgressBar range and position every 500 ms (while handle is valid - IsWindow()). This case you don't need any script updates. The problem is $HWNDPARENT is 0. Can yow run installer in the Windows hidden mode (SW_HIDE), but not in NSIS silent mode?


You could make it not silent but move the dialog offscreen.(See sendmessages and search this forum) You still can have a handle that way.

BTW this would not be MY preferred way of doing it, but he if it helps you it's fine ;)


Installer button still presents on the TaskBar even if it's window is out of screen. And, of course, message hooking is better way for progress bar position tracking, but this require a bit more complex code.


Yes, that takes effort, but if the requested features are better for the enduser, the more energy it takes.
Sad, but a reality specific when talking about programming.

Be persistant, success!