STDOUT/STRERR to PROGRESSTEXT
STDOUT/STRERR to PROGRESSTEXT
Hi,
Is there a way to capture the messages to STDOUT/STRERR and display them to the user, via PROGRESSTEXT? I'm talking about a very long running operation, that displays its progress in the console.
Thanks,
Mihai
PS: I'm talking about the raw output that some installers display when you press "Show Details".
Is there a way to capture the messages to STDOUT/STRERR and display them to the user, via PROGRESSTEXT? I'm talking about a very long running operation, that displays its progress in the console.
Thanks,
Mihai
PS: I'm talking about the raw output that some installers display when you press "Show Details".
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
Unfortunately there isn't a built-in method capable to redirect the console output.
However, it's surely possible to release a custom plug-in at such purpose.
However, it's surely possible to release a custom plug-in at such purpose.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
Unfortunately there isn't a built-in method capable to redirect the console output.
Understood.
However, it's surely possible to release a custom plug-in at such purpose.
What exactly does that entail?
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
https://www.installaware.com/scripting-plug-in-extensibility.htm
https://www.installaware.com/mh52/desktop/pluginauthoringoverview.htm
Hope this helps you.
https://www.installaware.com/mh52/desktop/pluginauthoringoverview.htm
Hope this helps you.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
So say a plugin that executes the given command through _popen/CreateProcess?
If that's the case, how do I periodically update the PROGRESSTEXT variable? Is that what the 2nd parameter of the lpPlugProgressIndicator is for? The documentation is unclear, although I guess I could just try it out and see what happens:
PS: That's what it does, I just tested.
If that's the case, how do I periodically update the PROGRESSTEXT variable? Is that what the 2nd parameter of the lpPlugProgressIndicator is for? The documentation is unclear, although I guess I could just try it out and see what happens:
This parameter should contain a textual description of the currently executing task.
PS: That's what it does, I just tested.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
That's exactly the purpose of the LpPlugProgressIndicator.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
Thanks for the confirmation and the guidance so far.
However, if I read back the PROGRESSTEXT variable after lpPlugProgressIndicatorW has updated the text in the UI, the value of the variable is still the one set previously through MSI Code. What's going on? I need a way to get the actual value in the UI.
However, if I read back the PROGRESSTEXT variable after lpPlugProgressIndicatorW has updated the text in the UI, the value of the variable is still the one set previously through MSI Code. What's going on? I need a way to get the actual value in the UI.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
Please keep in mind that "PlugInProgressIndicator" points to the address of a callback function.
So, this callback should be defined as follow in your code:
Then from the plugin process, for example:
Finally, in your script code you can test the progress as follow:
(*)The "Progress Dialog" will receive the plugin progress notifications.
Hope this helps you.
So, this callback should be defined as follow in your code:
Code: Select all
typedef BOOL(WINAPI* lpPlugProgressIndicatorW)(int, const WCHAR*);
Then from the plugin process, for example:
Code: Select all
int WINAPI RunTimeExecuteW(int Window, const wchar* Variables, const wchar* State, lpPlugProgressIndicatorW Progress, int* Return, wchar* NewVariables);
{
/******************/
std::wstring sMyString(_T("Hello..."));
BOOL bUserCancelled = Progress(50, sMyString.c_str());
/*****************/
}
Finally, in your script code you can test the progress as follow:
Code: Select all
Display Dialog: progress, use as progress dialog (non-modal)
MyPlugin
Hide Dialog
(*)The "Progress Dialog" will receive the plugin progress notifications.
Hope this helps you.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
Thanks for the reply. But how can it be an error in the plugin if I can see the text it sends through the callback? Please re-read what I wrote previously.
To reiterate, the text makes it just fine from the plugin into the progress text control, but if I then want to show a dialog using MSI Code to contain the $PROGRESSTEXT$, it shows the value before the plugin used the callback.
In other words, does the plugin callback only update the UI, but not the PROGRESSTEXT variable?
PS: I see you have edited your previous message making some of what I replied here appear out of context.
To reiterate, the text makes it just fine from the plugin into the progress text control, but if I then want to show a dialog using MSI Code to contain the $PROGRESSTEXT$, it shows the value before the plugin used the callback.
In other words, does the plugin callback only update the UI, but not the PROGRESSTEXT variable?
PS: I see you have edited your previous message making some of what I replied here appear out of context.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
No, the "PlugInProgressIndicator" callback doesn't set the value of the PROGRESSTEXT pre-defined variable.
In all honesty, I don't understand the reason why you need to set such variable. It's just enough to use a modeless dialog to display all notifications the plugin routes through the callback.
At any rate, from the plugin there is no limitation to set the value of any script variable (including PROGRESSTEXT).
The "RunTimeExecute" has a "wchar* NewVariables" parameter specifacally for that.
Hope this helps you.
In all honesty, I don't understand the reason why you need to set such variable. It's just enough to use a modeless dialog to display all notifications the plugin routes through the callback.
At any rate, from the plugin there is no limitation to set the value of any script variable (including PROGRESSTEXT).
The "RunTimeExecute" has a "wchar* NewVariables" parameter specifacally for that.
Hope this helps you.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
In all honesty, I don't understand the reason why you need to set such variable.
One might want to parse the very last console line - that's already on screen - to extract additional details on the execution outcome.
At any rate, from the plugin there is no limitation to set the value of any script variable (including PROGRESSTEXT).
Ah, right. I actually did that for another variable.
OK then, one last question please, to come back to the original "Show Details" idea: is there a way to access the history of the progress text control? In other words, I'd like to display a listbox or a multi-line static text control with everything that was / is displayed there. As is now clear from your last confirmation, this would be a combination of the values of %PROGRESSTEXT$ and the texts that come from the plugin callbacks. Please keep in mind that for the lengthy duration of the plugin execution I'd like to see the multi-line control update dynamically, just as the progress text control is.
Thanks!
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
No, it doesn't exist a method to access the history of the progress text control.
If you want such kind of customization, the only solution it's to implement a Customized Progress Dialog with the plugin itself. So, in place of displaying the IA Progress Dialog, your plugin should display its own progress.
Hope this helps you.
<THIS POST HAS BEEN MOVED TO THE MORE APPROPRIATE "Plug-In Development" section of the forum>
<THIS POST WILL BE SUCCESSIVELY REMOVED from the "Technical Support" section of the forum>
If you want such kind of customization, the only solution it's to implement a Customized Progress Dialog with the plugin itself. So, in place of displaying the IA Progress Dialog, your plugin should display its own progress.
Hope this helps you.
<THIS POST HAS BEEN MOVED TO THE MORE APPROPRIATE "Plug-In Development" section of the forum>
<THIS POST WILL BE SUCCESSIVELY REMOVED from the "Technical Support" section of the forum>
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
Understood, thanks for the confirmation & suggestion. Thanks!
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: STDOUT/STRERR to PROGRESSTEXT
Btw, you can even try with implementing a multi-line progress text, which displays the content of a dedicated "console" custom variable using the $NEWLINE$ variable to split each new line.
For example;
<TEXT1>$NEWLINE$<TEXT2>$NEWLINE$<TEXT3>$NEWLINE$ ...and so on.
For example;
<TEXT1>$NEWLINE$<TEXT2>$NEWLINE$<TEXT3>$NEWLINE$ ...and so on.
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: STDOUT/STRERR to PROGRESSTEXT
Thanks for the suggestion. What exactly do you mean by 'a dedicated "console" custom variable'? If I recall correctly, the normal variables only update when the execution of the command completes. Or would it involve developing a UI control that would monitor variables for hot changes?
Return to “Plug-In Development”
Who is online
Users browsing this forum: No registered users and 23 guests