June 15, 2015 at 10:32 am #26472
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?
Ensure =“Present” # You can also set Ensure to “Absent”
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
June 15, 2015 at 10:51 am #26473
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.
June 15, 2015 at 11:30 am #26474
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.
June 16, 2015 at 1:36 pm #26521
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?
June 16, 2015 at 1:39 pm #26523
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.
June 16, 2015 at 2:21 pm #26524
I will have to look further into Script resource. Right now it seems confusing to me. Thanks for the help to this point.
June 16, 2015 at 3:06 pm #26527
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:
# Other stuff
Arguments = 'prov_only=host prov_key=xxxxx-xxxxxx-xxxxx-xxxxx'
You must be logged in to reply to this topic.