Installing an exe with Powershell DSC Package resource gets return code 16389

I too am trying to install an .exe using the Package resource. In this case it is .NET 4.5.1. I boiled this down to single resource in a configuration and use “Push” mode. I also have the .exe located on the server to avoid any UNC security issues. The configuration is as follows:

Configuration TestPackageNET451Config
{
Node “SERVERNAME”
{
Package Microsoft_.NET_Framework_4.5.1
{
Ensure =“Present”
Name = “Microsoft .NET Framework 4.5.1”
Path = “D:\Temp\NDP451-KB2858728-x86-x64-AllOS-ENU.exe”
ProductId = “7DEBE4EB-6B40-3766-BB35-5CBBC385DA37”
Arguments = “/q /norestart”
}
}
}

The error states:

VERBOSE: [SERVERNAME]: LCM: [ End Set ] [[Package]Microsoft_.NET_Framework_4.5.1] in 1.7790 seconds.
PowerShell provider Package failed to execute Set-TargetResource functionality with error message: The return code 16389 was not expected. Configuration is likely not correct
+ CategoryInfo : InvalidOperation: (:slight_smile: , CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure

If I execute the Set-TargetResource function directly from the PowerShell command line, it works fine. I have been fighting this for about a day now and about to give up.

This may be a problem specific to the .NET 4.5.1 installer; I found another thread on this over at .NET 4.5.1 Install only works when running on a UI session . They were using SCCM instead of DSC, but otherwise got the same error code from the installer. This might shed a bit more light on exactly what’s going wrong (but not why):

[1/7/2014, 10:28:1] Error 0x80004005: Failed to extract all files out of box container #0.
[1/7/2014, 10:28:1] Error 0x80004005: Failed to extract
[1/7/2014, 10:28:1] Exiting with result code: 0x80004005

0x4005, in decimal, is 16389.

Jeff,

I would like to try to reproduce the issue. Which Windows OS version are you running? If you are running Win2008 R2 please also specify if you have .NET 4.0 or 4.5.0 already installed.

Thanks
Daniel

Couple of things I would try, in troubleshooting this, are extracting the exe file and just installing the MSI directly (which might just work), or running the command as LocalSystem with psexec’s -s option (which might help figure out why it’s failing.)

I agree. I find “psexec.exe -sdi cmd.exe” and running ProcMon with processname filters quite handy as well to troubleshoot LocalSystem install issues.

Dave: I’ll try and give this a try at some point today and report back. I am in the middle of writing a custom DSC resource I can use to create SMB shares given the xSmbShare resource doesn’t work for me on Win2008 R2.

Dan: I am trying to do this on Win2008 R2 with .NET 4.5 already installed.

I extracted the files contained in NDP451-KB2858728-x86-x64-AllOS-ENU.exe, and then defined the configuration as follows. There isn’t a single .msi, but instead setup.exe:

>>>
Package Microsoft_.NET_Framework_4.5.1
{
Ensure =“Present”
Name = “Microsoft .NET Framework 4.5.1”
Path = “D:\Temp\NET4.5.1\Setup.exe”
ProductId = “7DEBE4EB-6B40-3766-BB35-5CBBC385DA37”
Arguments = “/q /norestart”
}
<<<

I am now getting a different ExitCode (5100):

>>>
Job {A6F13332-7E3D-4839-B0D1-F267ADFB1A65} :
This event indicates that failure happens when LCM is processing the configuration. ErrorId is 0x1. ErrorDetail is The SendConfigurationApply function did not succeed… ResourceId is [Package]Microsoft_.NET_Framework_4.5.1 and SourceInfo is D:\Temp\TestPackageNET451Config.ps1::13::9::Package. ErrorMessage is PowerShell provider MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 5100 was not expected. Configuration is likely not correct .
<<<

I have yet to try psexec.exe…

Jeff,

I haven’t been able to reproduce the issue on a lab machine so far but I’ve discovered that the .NET Framework 4.5.1 Setup supports the /log parameter. Please run your configuration again with the /log parameter and check out the detailed HTML and MSI logs for errors.

Package Microsoft_.NET_Framework_4.5.1
{
Ensure =”Present”
Name = “Microsoft .NET Framework 4.5.1″
Path = “D:\Temp\NET4.5.1\Setup.exe”
ProductId = “7DEBE4EB-6B40-3766-BB35-5CBBC385DA37″
Arguments = “/q /norestart /log c:\ndp451”
}

Update…

I ran “psexec.exe -s D:\Temp\NET4.5.1\NDP451-KB2858728-x86-x64-AllOS-ENU.exe /q /norestart /log d:\temp\ndp451-1” and was able to install .NET 4.5.1. I looked at the .html log produced, and noticed that when it calls setup.exe, it does so as follows: “Setup.exe /q /norestart /log d:\temp\ndp451-1 /x86 /x64 /redist”. So I tried the following, which did work using DSC:

>>>
Package Microsoft_.NET_Framework_4.5.1
{
Ensure =”Present”
Name = “Microsoft .NET Framework 4.5.1″
Path = “D:\Temp\NET4.5.1\Setup.exe”
ProductId = “7DEBE4EB-6B40-3766-BB35-5CBBC385DA37″
Arguments = “/q /norestart /log D:\Temp\ndp451-3 /x86 /x64 /redist”
}
<<<

So for some reason, running NDP451-KB2858728-x86-x64-AllOS-ENU.exe as System by using “psexec.exe -s” works, whereas running NDP451-KB2858728-x86-x64-AllOS-ENU.exe from DSC as System doesn’t. The failure seems to be when extracting the files, one of which is Setup.exe.

Just wanted to mention I had something very similar happen when trying to install VS 2013 via DSC. Running the installer outside of DSC with the same command-line arguments worked, so I’m curious what kind of magic DSC is using to run things…

Here is the error I received when it failed via DSC…

MSI (s) (7C:08) [17:07:27:460]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7D33.tmp, Entrypoint: CreateUser
CreateUser:  Entering CreateUser in C:\Windows\Installer\MSI7D33.tmp, version 3.7.1701.0
CreateUser:  Failed to add user: SYSTEM, domain SPRINGFIELD to group: Performance Log Users, domain:  with error 0x8007056b.  Attempting to use Active Directory
CreateUser:  Error 0x80005000: Failed to add user SPRINGFIELD/SYSTEM to group 'WinNT://Localhost/Performance Log Users'.
CreateUser:  Error 0x80005000: failed to add user: SYSTEM to group Performance Log Users
MSI (s) (7C!D8) [17:07:27:741]: Product: Microsoft Visual Studio Professional 2013 -- Error 26403.Failed to add user to group.  (-2147463168   SYSTEM   Performance Log Users   )
 
Error 26403.Failed to add user to group.  (-2147463168   SYSTEM   Performance Log Users   )
CustomAction CreateUser returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

Based on that log output, I suspect that the VS2013 installer would also fail if you manually executed it as System (via psexec /s ). The system account’s domain is “NT AUTHORITY”, not the local computer name or domain name. It looks like that’s a bug in the installer package for VS2013, and people have run into the same problem trying to deploy it via SCCM (see deploying vs 2013 test professional with sccm 2012 ). Looks like you can get it working by fiddling with the MSI package and making it skip that “CreateUser” action.

I recently had a similar problem with another MSI. What worked was first copying the MSI locally using the File resource, and then installing the local copy. I haven’t tried it with the VS 2013 MSI in my previous thread, so YMMV.

Jason

Hello All,

Recently started to play about with DSC. Plan to standardize an entire chain of Web/App servers across our enterprise infrastructure.
Thus far can install certain .EXE executables but not .net 4.5.1

My setup is very much the same as Jeff’s above from the first post. Cannot seem to get around this either.