The Run Program command, either standard or elevated, currently captures the launched process's exit code in a variable provided by the user. But Run Program would be very efficient if it also had place holders for two user defined variables to capture the process's STDOUT and STDERR streams. Currently, one must reconfigure the command line argument to include a redirection to a local file and after the Run Program command returns, one must open and read that file to acquire the process's STDOUT / STDERR output. However, this does not always work correctly.
The Run Program As (in this example) inputs to capture the output from running the Windows utility fsutil.exe (to enable the 8.3 name generation ability of drive C:) would be:
Program = cmd.exe;
Command line argument = /c fsutil.exe 8dot3name set C: 0>{SOME_LOCAL_FILE}.
Wait for program exit checked.
This fails with an exit code of 1 (Incorrect program) but running from a Windows Admin Command Prompt:
fsutil.exe 8dot3name set C: 0>{SOME_LOCAL_FILE} returns exit code 0 with data returned on STDOUT.
If I remove the file redirection from the Run Program As command line argument (i.e. /c fsutil.exe 8dot3name set C: 0), it returns error code 0, but I have no way to read the output from fsutil's STDOUT stream.
Run Program (As) STDOUT, STDERR capture variables
-
- Posts: 32
- Joined: Mon Oct 29, 2012 2:27 pm
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Run Program (As) STDOUT, STDERR capture variables
Dear Erich,
did you try to place the "fsutil.exe 8dot3name set C: 0>{SOME_LOCAL_FILE}" in a bat file and then to call it as Run Program parameter?
It should work.
For what concerns your suggestions about to capture the process's STDOUT and STDERR streams, I'll send a note to our dev team.
Hope this helps you.
Regards
did you try to place the "fsutil.exe 8dot3name set C: 0>{SOME_LOCAL_FILE}" in a bat file and then to call it as Run Program parameter?
It should work.
For what concerns your suggestions about to capture the process's STDOUT and STDERR streams, I'll send a note to our dev team.
Hope this helps you.
Regards
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
-
- Posts: 32
- Joined: Mon Oct 29, 2012 2:27 pm
Re: Run Program (As) STDOUT, STDERR capture variables
We hadn't because we didn't want to have to install yet another file, regardless of how simple or small, just to do something that the Run Program As plugin is documented as being able to do.
We would then have to add other code to the installer to delete this batch file after it runs because we don't want the user to have access to executable files (i.e. -- this batch file) other than what is necessary to run the installed application. 


-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Run Program (As) STDOUT, STDERR capture variables
Dear Erich,
if you add the bat file to SUPPORTDIR, you don't have to install any additional file and the same gets automatically deleted once the setup completes.
The SUPPORTDIR is a special temporary location used at Runtime by the installer.
To find out how to use the SUPPORTDIR, please search for "Modifying Support Files" in the IA documentation (just press F1 in IA IDE).
Once you added the "BAT" to SUPPORTDIR, you can execute it from the main script at any time using the RUN PROGRAM command (example; $SUPPORTDIR$\myfile.bat).
Regards
if you add the bat file to SUPPORTDIR, you don't have to install any additional file and the same gets automatically deleted once the setup completes.
The SUPPORTDIR is a special temporary location used at Runtime by the installer.
To find out how to use the SUPPORTDIR, please search for "Modifying Support Files" in the IA documentation (just press F1 in IA IDE).
Once you added the "BAT" to SUPPORTDIR, you can execute it from the main script at any time using the RUN PROGRAM command (example; $SUPPORTDIR$\myfile.bat).
Regards
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
Who is online
Users browsing this forum: Bing [Bot] and 218 guests