MDT: Install application returns error code 2

Greg 0 Reputation points
2023-07-20T09:25:35.3933333+00:00

I have currently created an offline media ISO to deploy a windows image and then install applications on to it e.g. Notepad++. When I run the task to install each individual application I get the error code 2.

My settings for the application are:

User's image

The BDDLog shows:

<![LOG[Language/Locale Identified (in order of precedence): 2057,0809,0x0809,9,0009,0x0009]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Mandatory Single Application install indicated. Guid: {9145c5fb-b669-44ad-b727-3cc2cc8533de}]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[################]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Entry: {9145c5fb-b669-44ad-b727-3cc2cc8533de}]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Name: NotepadPlusPlus 8.5.4]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[################]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Using a local or mapped drive, no connection is required.]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[ Change directory: D:\Deploy\Applications\NotepadPlusPlus_8.5.4]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[ Run Command: D:\Deploy\Tools\X64\bddrun.exe start-process -FilePath ".\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[ZTI installing application ]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[About to run command: D:\Deploy\Tools\X64\bddrun.exe start-process -FilePath ".\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Command has been started (process ID 1920)]LOG]!><time="08:42:13.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Return code from command = 2]LOG]!><time="08:42:14.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[Application NotepadPlusPlus 8.5.4 returned an unexpected return code: 2]LOG]!><time="08:42:14.000+000" date="07-20-2023" component="ZTIApplications" context="" type="3" thread="" file="ZTIApplications">

<![LOG[Property InstalledApplications001 is now = {9145c5fb-b669-44ad-b727-3cc2cc8533de}]LOG]!><time="08:42:14.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

<![LOG[ZTIApplications processing completed successfully.]LOG]!><time="08:42:14.000+000" date="07-20-2023" component="ZTIApplications" context="" type="1" thread="" file="ZTIApplications">

When I run the commands below in powershell on the computer I do not get any output:

cd D:\Deploy\Applications\NotepadPlusPlus_8.5.4

D:\Deploy\Tools\X64\bddrun.exe start-process -FilePath ".\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait

If I run the commands below then notepad++ will install correctly as expected:

cd D:\Deploy\Applications\NotepadPlusPlus_8.5.4

start-process -FilePath ".\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait

Running the command below did not resolve the issue either:

D:\Deploy\Tools\X64\bddrun.exe start-process -FilePath "D:\Deploy\Applications\NotepadPlusPlus_8.5.4\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait

there are multiple applications with this same issue

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
859 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Greg 0 Reputation points
    2023-07-20T12:14:26.0233333+00:00

    I have bypassed this problem by placing the command that works into a bat file, and calling the bat file using .\Install.bat in the install commands options.

    Powershell.exe start-process -FilePath ".\npp.8.5.4.Installer.x64.exe" -ArgumentList '/S' -Verb runas -Wait

    0 comments No comments

  2. Simon Ren-MSFT 32,221 Reputation points Microsoft Vendor
    2023-07-21T07:45:27.38+00:00

    Hi,

    Thanks very much for your feedback and sharing. We're glad that the issue is gone now. It's appreciated that you could click "Accept Answer" to the helpful reply, this will help other users to search for useful information more quickly. Here's a short summary for the problem.

    Problem/Symptom:

    Install application during OSD in MDT returns error code 2.

    Solution/Workaround:

    Have bypassed this problem by placing the command that works into a bat file, and calling the bat file using .\Install.bat in the install commands options.

    Thanks again for your time. Have a nice day!

    Best regards,

    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments