cancel
Showing results for 
Search instead for 
Did you mean: 
PlinyElder
Pilgrim

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?
Labels (1)
0 Kudos
2 Replies
Evan_Border
Pilgrim

Re: Installscript: Getting results back from dism.exe

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.
0 Kudos
Highlighted
rrinblue22
Pilgrim

Re: Installscript: Getting results back from dism.exe

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.
0 Kudos