This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Installscript: Getting results back from dism.exe
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 01, 2015
03:02 PM
Installscript: Getting results back from dism.exe
I am working with Installshield 2014 in an Installscript project
I am wanting to sue dism.exe to first check if IIS components are installed. If they are not then install them via the dism.exe command line. I can perform both things via installscript BUT i cannot read the dism results that come back to the console. The return code is always 0 because LaunchAppAndWait only returns a success or failure of the console window, not the application running within it. Is there any way to do this?
I am wanting to sue dism.exe to first check if IIS components are installed. If they are not then install them via the dism.exe command line. I can perform both things via installscript BUT i cannot read the dism results that come back to the console. The return code is always 0 because LaunchAppAndWait only returns a success or failure of the console window, not the application running within it. Is there any way to do this?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 02, 2015
03:40 AM
PlinyElder wrote:
I am working with Installshield 2014 in an Installscript project
I am wanting to sue dism.exe to first check if IIS components are installed. If they are not then install them via the dism.exe command line. I can perform both things via installscript BUT i cannot read the dism results that come back to the console. The return code is always 0 because LaunchAppAndWait only returns a success or failure of the console window, not the application running within it. Is there any way to do this?
It seems like a waste of effort to first see if the IIS features are installed. DISM returns 0 if you ask it to install a feature that already is installed, and it's fast...so I don't see a disadvantage to using LaunchAppAndWait a bunch of times for each IIS feature that you want to install. The only time it will return a non-zero return code is if it fails to install the feature (or if the feature name specified is invalid). BTW, point LaunchAppAndWait to dism.exe, not cmd.exe.
But overall, I think it might be easier to add your InstallScript package to a Suite and allow the Suite to handle installing the IIS feature installations:
If you insist on first checking to see if a feature is installed, I guess you could use LaunchAppAndWait on cmd.exe and have it pipe out the output to a text file that you then use the FileGrep InstallScript function on to search for the desired text. Seems unnecessary, though.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 02, 2015
11:38 PM
I see that you want to get the return code of dism.exe when launched from InstallScript.
I would recommend using "LaunchApplication" instead which has can help you find out the return code of the launched app (dism.exe in this case)
InstallShield Help on LaunchApplication
Note: If the application cannot be launched, the LAAW_PARAMETERS system variable’s nLaunchResult member contains the result of calling the Windows API function GetLastError after the CreateProcess or ShellExecuteEx call. If the function is successful and the LAAW_OPTION_WAIT option was specified, the LAAW_PARAMETERS system variable’s nLaunchResult member contains the return code of the launched application.
I would recommend using "LaunchApplication" instead which has can help you find out the return code of the launched app (dism.exe in this case)
InstallShield Help on LaunchApplication
Note: If the application cannot be launched, the LAAW_PARAMETERS system variable’s nLaunchResult member contains the result of calling the Windows API function GetLastError after the CreateProcess or ShellExecuteEx call. If the function is successful and the LAAW_OPTION_WAIT option was specified, the LAAW_PARAMETERS system variable’s nLaunchResult member contains the return code of the launched application.