Installing exe with Powershell package DSC resource gets return code 1619

I am trying to use a Powershell DSC Package resource to install exe ... Perforce P4V to be specific. Here is my code:

Configuration PerforceMachine { Node "SERVERNAME" { Package P4V { Ensure = "Present" Name = "Perforce Visual Components" Path = "\\nas\share\p4vinst64.exe" ProductId = '' Arguments = "/S /V/qn" # args for silent mode LogPath = "$env:ProgramData\p4v_install.log" } } } 

When doing this, this Powershell error gives me:

 PowerShell provider MSFT_PackageResource failed to execute Set-TargetResource functionality with error message: The return code 1619 was not expected. Configuration is likely not correct + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : SERVERNAME 

According to the documentation , a return code of 1619 means that the MSI package cannot be opened. However, when I manually enter the computer and run " \\ nas \ share \ p4vinst64.exe / S / V / qn ", the installation works flawlessly.

Does anyone know why this fails? Alternatively, can someone tell me how to fix this problem? I inserted all the error information received from the terminal, my log file (p4v_install.log) is a 0 byte file, and there are no events in the event viewer. I don’t know how to fix them!

EDIT . I should note that I also tried using the File resource to copy the file locally and then install it there. Unfortunately, this met the same result.

+7
source share
2 answers

Daniel on Powershell.org forums was able to figure this out for me.

The P4V InstallShield installation shell puts the MSI file in the wrong path if you are running as LocalSystem.

I was able to develop a configuration that works, see below. The key here is the / b switch, which places the MSI file in a specific location. I added ALLUSERS=1 so that the shortcuts were visible to all users, and REBOOT=ReallySuppress to avoid a sudden restart (which would happen otherwise).

 Configuration PerforceMachine { Package P4V { Ensure = "Present" Name = "Perforce Visual Components" Path = "C:\My\p4vinst64.exe" ProductId = '' Arguments = '/b"C:\Windows\Temp\PerforceClient" /S /V"/qn ALLUSERS=1 REBOOT=ReallySuppress"' # args for silent mode } } 
+7
source

Well, what happens here is that the package is installed (not yet tested with p4vinst64.exe!), So I'm not sure why it says that the package cannot be opened as an error), but since you did not specify the ProductID value check at the end of the installation fails. This is the error you see. The Package resource is not suitable for installing .exe or even MSI packages without a product identifier represented as a GUID.

Instead, you can use the WindowsProcess resource.

+1
source

Source: https://habr.com/ru/post/970212/


All Articles