xPSDesiredStateConfiguration icon indicating copy to clipboard operation
xPSDesiredStateConfiguration copied to clipboard

xPackage Issue with ProductIDs that are null

Open GamerLivingWill opened this issue 8 years ago • 5 comments

I'm using xPackage to install vcredist_x64.exe (Microsoft Visual C++ 2010 x64 Redistributable - 12.0.40649). The application, once installed, returns a null value for ProductID. The problem is the following:

  1. I am unable to input $null as a value in the required field of ProductId
  2. If I use empty quotes in the ProductId value, it returns the following error: PowerShell DSC resource MSFT_xPackageResource failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: Package from C:\Installers\VCRedist\vcredist_x64.exe was installed, but the specified ProductId and/or Name does not match package details. I was able to validate that this is the case in a manual installation scenario as well.

My question I guess is why is the ProductId a required input for the DSC Resource Provider? And if it's totally necessary, is there a good way to handle a null value that I'm not thinking of?

GamerLivingWill avatar Sep 06 '17 14:09 GamerLivingWill

@GamerLivingWill - I use the InstalledCheckRegKey* parameters in this scenario. Find a consistent REG_SZ value and use that in conjunction with an empty ProductId. Hope it helps 😃!

iainbrighton avatar Sep 06 '17 14:09 iainbrighton

Hey there @iainbrighton ! I see that input is requesting string. Is it looking for true/false on a string? I'm not seeing anything in the documentation.

GamerLivingWill avatar Sep 06 '17 14:09 GamerLivingWill

When the readme.md got reformatted (auto-generated?), it looks like it was dropped?! Here's what I use to install Citrix Receiver from a composite resource, but I'm sure you'll get the gist 😉..

    xPackage 'CitrixReceiver' {
        Name = $ProductName;
        ProductId = '';
        Path = $Path;
        Arguments = [System.String]::Join(' ', $arguments);
        ReturnCode = 0;
        InstalledCheckRegKey = 'Software\Citrix\Install\ICA Client';
        InstalledCheckRegValueName = 'InstallFolder';
        InstalledCheckRegValueData = 'C:\Program Files (x86)\Citrix\ICA Client\';
    }

iainbrighton avatar Sep 06 '17 14:09 iainbrighton

Ahhh. Thanks!

Also, Citrix? I might have to pick your brain some more. ;)

GamerLivingWill avatar Sep 06 '17 15:09 GamerLivingWill

When the readme.md got reformatted (auto-generated?), it looks like it was dropped?! Here's what I use to install Citrix Receiver from a composite resource, but I'm sure you'll get the gist 😉..

    xPackage 'CitrixReceiver' {
        Name = $ProductName;
        ProductId = '';
        Path = $Path;
        Arguments = [System.String]::Join(' ', $arguments);
        ReturnCode = 0;
        InstalledCheckRegKey = 'Software\Citrix\Install\ICA Client';
        InstalledCheckRegValueName = 'InstallFolder';
        InstalledCheckRegValueData = 'C:\Program Files (x86)\Citrix\ICA Client\';
    }

Ok so a very important note that seems to be omitted here is that: CreateCheckRegValue = $true; needs to be added for:

InstalledCheckRegKey = 'Software\Citrix\Install\ICA Client';
InstalledCheckRegValueName = 'InstallFolder';
InstalledCheckRegValueData = 'C:\Program Files (x86)\Citrix\ICA Client\';

to work.

I just spent a good half hour going through the master code to confirm this.

seriousscripts avatar Mar 30 '20 12:03 seriousscripts