Package install problem

I am trying to create package with install MSI that requires product key with the MSI install. When I try to run the Package, I keep getting "PowerShell DSC resource MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 1603 was not expected. Configuration is likely not correct.

Is there a way to add the product key with MSI command with DSI?

Current configuration:
Package AlertLogicSoftware
Ensure =“Present” # You can also set Ensure to “Absent”
Path =“C:\CDS\AlertLogic\al_log_agent-LATEST.msi”
Name = “AL Log Agent”
ProductId = “A2A94572-FA27-4769-BF16-7B55303BF2A9"

What I am needing:
Path = "C:\CDS\AlertLogic\al_log_agent-LATEST.msi prov_only=host prov_key=xxxxx-xxxxxx-xxxxx-xxxxx /q

I’m not sure I’m following the question. Let me try and rephrase it - I think you’re using some incorrect terminology - and you can let me know if I understand what you’re asking.

I am trying to create a configuration that will install an MSI. It requires a product key. When I try to run the configuration, I get an error.

Is that correct?

Now, your question may be, “in order for the MSI to install, it has to be given a prov_key. I know how to do that from the command-line, but the DSC Package resource doesn’t seem to offer a prov_key.” That is correct. The Package resource does not support additional parameters. Short of reprogramming it, there is no way to do that.

Instead, you might look at using a Script resource that simply runs your command-line.

Return code 1603 is “Fatal error during installation”. In order to find out exactly what went wrong, I’d recommend setting the LogPath attribute on your Package resource, running the configuration again, and then reviewing the log file.

You may be running into an installer that doesn’t behave well when executed as LocalSystem. That’s been a common problem with DSC and other similar tools (SCCM, etc), since vendors don’t seem to ever test their packages that way. In the xPackage resource of the DSC resource kit, there’s a “RunAsCredential” property that may be helpful here (and more recently, in the latest PowerShell v5 preview, they’ve made a PsDscRunAsCredential common property that can be used for all DSC resources, including Package.)

Alternatively, you can troubleshoot the installer, and possibly figure out how to get it working as LocalSystem. That’s kind of a pain, but can be done.

Don that is correct. I have programs that need additional parameters with MSI install. As far as the Script resource, are you referring to the get, test, set resources?

Well, no - the Script resource is a resource. It has Get, Set, and Test properties, which are each a script block in which you can run anything. So your Set is the msiexec command you already have. Your Test is some way of figuring out if the thing is already installed or not, and returning True/False. Get, you can leave empty.

I will have to look further into Script resource. Right now it seems confusing to me. Thanks for the help to this point.

The Package resource has an Arguments property, btw. You don’t need to worry about /q, because that’s done automatically for MSI packages by the resource, but you should be able to do this:

Package whatever
# Other stuff
Arguments = ‘prov_only=host prov_key=xxxxx-xxxxxx-xxxxx-xxxxx’