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

This topic contains 10 replies, has 6 voices, and was last updated by Profile photo of Michael Greene Michael Greene 2 years, 6 months ago.

  • Author
    Posts
  • #15822
    Profile photo of Jay Spang
    Jay Spang
    Participant

    I'm trying to use Powershell DSC's Package resource to install an exe... Perforce's P4V to be specific. Here's 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 running this, this is the error Powershell 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 documentation, return code 1619 means the MSI package couldn't be opened. However, when I manually log in to the machine and run "\\nas\share\p4vinst64.exe /S /V/qn", the install works flawlessly.

    Does anyone know why this is failing? Alternately, can anyone tell me how to troubleshoot this? I pasted all the error information I got 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 troubleshoot it any further!

  • #15837
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Betting this is permissions. Keep in mind that the LCM runs as SYSTEM, so it wouldn't have access to non-local resources. When your package is non-local, you're probably going to need to include a credential.

  • #15838
    Profile photo of Jeff Pflum
    Jeff Pflum
    Participant

    While I can't offer a suggestion as to what the problem might be, I wasn't aware that the Package resource could be used to install .exe's. I assumed it required a .msi file. Given that a ProductId isn't specified, how does the Package resource implement "Test-TargetResource" in order to determine if the package (i.e. .exe) is already installed or not?

  • #15839
    Profile photo of Don Jones
    Don Jones
    Keymaster

    It's supposed to be able to do EXEs, although at present it's a bit undefined. I think the long-term vision is to have it work mainly through OneGet, meaning you'd have a local or remote repo containing your packages, which would also reduce the need for messing with credentials. To be sure, right now, the Package resource is a little sketchy with anything but Windows Installer packages.

  • #15841
    Profile photo of Jacob Benson
    Jacob Benson
    Member

    Did you check the Desired State Configuration – Operational log? Are you trying to run this locally or executing the Configuration through a Pull Server?

  • #15843
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    I believe it will work if you add the computer account of your Perforce server or all "Domain Computers" to have read access on your NAS share.

    Alternatives:
    – Copy the installation files locally onto the server to be configured and specify a local path in your Configuration.
    – Try the xRemoteFile DSC resource from the resource kit to get the file from an anonymous HTTP server in your environment and download locally.

  • #15861
    Profile photo of Jacob Benson
    Jacob Benson
    Member

    Jay –

    You can find the DSC Operational Log under Applications and Services Logs -> Microsoft -> Windows -> Desired State Configuration. Additionally, under View in the Event Viewer Menu Bar there is an option to enable Analytic and Debug logs. After that you can enable Analytic and Debug logs in addition to the Operational DSC log. I am not sure that is necessary because I haven't ever found a use for them but if you want to explore them they may be of assistance to you.

  • #15867
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    Jay,

    We don't use Perforce at work but I've downloaded the latest version and after some fun + games figured out that the InstallShield setup wrapper puts the MSI file into wrong path if you execute as LocalSystem.

    I've managed to develop a Configuration that works, see below. The key is the /b switch here which puts the MSI file into a defined location. I've added ALLUSERS=1 to get the shortcuts visible to all users and REBOOT=ReallySuppress to avoid a sudden restart (which will 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
    }
    }

  • #15868
    Profile photo of Jay Spang
    Jay Spang
    Participant

    That did it! Thanks so much Daniel!

  • #15869
    Profile photo of Michael Greene
    Michael Greene
    Participant

    I've run in to the need to validate behavior running as System quite a lot. I keep these two lines handy.

    Start-BitsTransfer http://live.sysinternals.com/psexec.exe .\
    .\psexec.exe -s PowerShell.exe -command {Insert what I need to test}

  • #15859
    Profile photo of Jay Spang
    Jay Spang
    Participant

    Hey guys, with regards to using the Package resource to install an EXE, I was following the instructions in the comments here – http://technet.microsoft.com/en-us/library/dn282132.aspx – It hasn't been verified if it works or not, but I thought it was worth a try!

    With regards to the permissions, I tried modifying things so that it first copied the file locally and then tried to install it. The file copy worked just fine, but the Package step met with the same error (so I do not believe Permissions are the issue here).

    Where is the 'DSC Operational Log'? I had no idea such a thing existed!

    EDIT: I found the Operational log, but it doesn't really contain any more information than was spewed to my terminal. I see an event with the exact same error I posted above, but no additional information!

    Job {B4A4A5D0-010A-47BB-B44C-94949C24E6E0} :
    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]P4V and SourceInfo is C:\Assert-PerforceMachine.ps1::32::3::Package. ErrorMessage is 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 .

You must be logged in to reply to this topic.