none
How to Prevent or Supress Unexpected Return or Exit Codes in Successfully Installed Applications? RRS feed

  • Question

  • We have some Intel and HP application installation task sequences that are successful, but the end of the deployment there is always a yellow screen warning about unexpected return codes such as "14".

    I think most of these are because the applications are looking for a interactive restart that is not done until the MDT task sequence does a reboot.  For instance, a task sequence that installs Intel AMT software and drivers pops up a dialog box asking the user to click to restart now or restart later even though the command is run as "setup.exe -s."  Since no one clicks on this pop up and the machine reboots via the task sequence, it creates this unexpected return code. 

    Are there additional command line switches that can be added to the task sequences to suppress the reboot prompts and make these applications exit gracefully without causing these warnings at the end of the deployment?

    Wednesday, August 6, 2014 3:20 PM

Answers

  • you can supress these codes easily....

    if it is "14" then, go to task sequence and select this application....on the right pane, you would see success codes (at bottom)....just add 14 there with a "space" like below.

    0 3010 14

    let me know if it helps...

    • Marked as answer by MyGposts Thursday, August 7, 2014 4:04 PM
    Thursday, August 7, 2014 10:20 AM
  • I usually create a powershell wrapper for applications that exit funny. An example would be -

    #GET CURRENT DIR $mydir = Split-Path -parent $MyInvocation.MyCommand.Path #SET VARAIBLE TO PASS INSTALL COMMAND WITH SPACES $command = @" setup.exe /s

    "@ #MOVE TO INSTALL DIR Set-Location C:\Install\Folder\ #RUN INSTALL cmd.exe /c ""$command | out-null #EXIT CLEANLY exit 0



    Save this script inside where your Application is located, and then create an application that runs the script inside of the Deployment Workbench.  The only problem with this is you need to be sure your install works, as you're basically just ignoring any errors the application has.  Down at the bottom, you can see the exit being passed back to MDT to continue cleanly.  Good luck.



    • Edited by MrBrooks Wednesday, August 6, 2014 3:52 PM
    • Marked as answer by MyGposts Thursday, August 7, 2014 4:05 PM
    Wednesday, August 6, 2014 3:45 PM

All replies

  • I usually create a powershell wrapper for applications that exit funny. An example would be -

    #GET CURRENT DIR $mydir = Split-Path -parent $MyInvocation.MyCommand.Path #SET VARAIBLE TO PASS INSTALL COMMAND WITH SPACES $command = @" setup.exe /s

    "@ #MOVE TO INSTALL DIR Set-Location C:\Install\Folder\ #RUN INSTALL cmd.exe /c ""$command | out-null #EXIT CLEANLY exit 0



    Save this script inside where your Application is located, and then create an application that runs the script inside of the Deployment Workbench.  The only problem with this is you need to be sure your install works, as you're basically just ignoring any errors the application has.  Down at the bottom, you can see the exit being passed back to MDT to continue cleanly.  Good luck.



    • Edited by MrBrooks Wednesday, August 6, 2014 3:52 PM
    • Marked as answer by MyGposts Thursday, August 7, 2014 4:05 PM
    Wednesday, August 6, 2014 3:45 PM
  • Your only problem there is throwing away the real return code. You need to catch that and evaluate it. If its expected, then return 0. If not, then return it as is.
    Wednesday, August 6, 2014 4:13 PM
  • Is there a command line switch that can be added to the setup.exe that is the equivalent to the user clicking "restart later" so that the application exits cleanly?

    This is all it displays when I type setup.exe /?

    • Edited by MyGposts Wednesday, August 6, 2014 4:31 PM
    Wednesday, August 6, 2014 4:28 PM
  • Yeah that's why I said you need to be sure of your application.  A more complete configuration would be a try catch and log errors, this was meant to be more of a jumping off point :)
    Wednesday, August 6, 2014 4:54 PM
  • This is where MDT can get more complex to work in.  You often have to deal with packages that are not meant to push silently, or push through a task sequence.  Unfortunately I do not recognize the packager that uses those switches, but I would guess setup.exe -s as there is an option -b that actually forces a reboot, so an educated guess would say the standard reboot option is reboot later.  Are you unable to import these drivers into MDT?
    Wednesday, August 6, 2014 4:58 PM
  • I usually create a powershell wrapper for applications that exit funny. An example would be -

    #GET CURRENT DIR $mydir = Split-Path -parent $MyInvocation.MyCommand.Path #SET VARAIBLE TO PASS INSTALL COMMAND WITH SPACES $command = @" setup.exe /s

    "@ #MOVE TO INSTALL DIR Set-Location C:\Install\Folder\ #RUN INSTALL cmd.exe /c ""$command | out-null #EXIT CLEANLY exit 0



    Save this script inside where your Application is located, and then create an application that runs the script inside of the Deployment Workbench.  The only problem with this is you need to be sure your install works, as you're basically just ignoring any errors the application has.  Down at the bottom, you can see the exit being passed back to MDT to continue cleanly.  Good luck.



    I don't understand how to do this sine I have never users Powershell in MDT.

    Do I just edit the script changing C:\Install\Folder to the actual local path the application is stored on in the MDT server?

    Do I just name it with a .PS1 extension and run it as a command line or as an application?

     

    Wednesday, August 6, 2014 5:35 PM
  • Are you installing from the Deployroot or are you installing it from the machine itself.  If you're installing it locally on the image, then change Set-Location to where the exe is located.  If you're installing it from the Deployroot, meaning you don't copy the install or embed the install, then change $command to this -

    $command = @"
    $mydir\setup.exe /s
    "@
    
    
    

    What that does is extracts the directory this script is being run from, and finds the setup.exe in that directory with the script.  And yes, save that as a ps1 file, create an application in Deployment Workbench.  For the application command line, it should be a command that calls powershell and runs the script, so something like powershell.exe -executionpolicy unrestricted .\myscriptname.ps1


    Wednesday, August 6, 2014 6:11 PM
  • The installation files are going to run from .\Applications\Application Name on the deployment server.

    Wednesday, August 6, 2014 6:40 PM
  • #GET CURRENT DIR
    
    $mydir = Split-Path -parent $MyInvocation.MyCommand.Path
    
    #SET VARAIBLE TO PASS INSTALL COMMAND WITH SPACES
    
    $command = @"
    $mydir\setup.exe /s
    "@
    
    #RUN INSTALL
    cmd.exe /c ""$command | out-null
    
    #EXIT CLEANLY
    exit 0
    
    

    So then you want to save the above to a script with a .ps1 extension.  Place the saved script in the same folder as your setup.exe.  Then create an application inside of MDT that calls this script.  Your run command line should be powershell.exe -executionpolicy unrestricted .\yourscript.ps1 and your working directory should be .\Applications\Application Name  .  Good luck.  If you're going to be working in MDT regularly, I recommend you learn a scripting language such as Powershell, as it can be downright necessary at times, like now.
    Wednesday, August 6, 2014 7:23 PM
  • Note, if the installation program needs to perform a reboot, then it should return ERROR_SUCCESS_REBOOT_
    REQUIRED --> 3010

    http://support.microsoft.com/kb/290158/en-us

    ZTIApplications.wsf is designed to handle the 3010 error code and conduct a structured reboot within the MDT environment. This is the error code MSIExec.exe returns.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Wednesday, August 6, 2014 7:27 PM
    Moderator
  • Note, if the installation program needs to perform a reboot, then it should return ERROR_SUCCESS_REBOOT_
    REQUIRED --> 3010

    http://support.microsoft.com/kb/290158/en-us

    ZTIApplications.wsf is designed to handle the 3010 error code and conduct a structured reboot within the MDT environment. This is the error code MSIExec.exe returns.


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com

    Intel uses some nonstandard codes.  Intel return code 14 is supposed to mean success, but reboot required.
    Wednesday, August 6, 2014 9:03 PM
  • I'm using an older version of MDT.  Is MDT 2013 updated to handle these codes?

    Wednesday, August 6, 2014 9:27 PM
  • you can supress these codes easily....

    if it is "14" then, go to task sequence and select this application....on the right pane, you would see success codes (at bottom)....just add 14 there with a "space" like below.

    0 3010 14

    let me know if it helps...

    • Marked as answer by MyGposts Thursday, August 7, 2014 4:04 PM
    Thursday, August 7, 2014 10:20 AM
  • you can supress these codes easily....

    if it is "14" then, go to task sequence and select this application....on the right pane, you would see success codes (at bottom)....just add 14 there with a "space" like below.

    0 3010 14

    let me know if it helps...

    It tried adding 14 and it worked.  So, this will be much easier than doing scripts to workaround it.

    Thursday, August 7, 2014 4:04 PM