DanielMM
9th November 2005 14:41 UTC
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)
goldy1064
9th November 2005 18:56 UTC
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.
DanielMM
10th November 2005 09:18 UTC
Yes, but how get "value of progress"?
Afrow UK
10th November 2005 10:14 UTC
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
Takhir
10th November 2005 10:42 UTC
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?
onad
13th November 2005 01:44 UTC
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 ;)
Takhir
13th November 2005 09:02 UTC
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.
onad
13th November 2005 21:50 UTC
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!