Installing executables with Powershell DSC
Asked Answered
A

4

8

I am trying to install Visual Studio 2013 using PowerShell DSC but I'm running into a few issues and hoping that you guys could clear it up for me. Is DSC capable for rebooting the node and then resuming an installation of VS? Does anyone know what this error means? "vs_ultimate.exe was installed, but the specified ProductId and/or Name does not match package details"

Does anyone have any more specific examples of trying to install .exe with this method?

How does someone find out the ProductID?

Does anyone know the exact syntax of the ReturnCode?

Any help would be great!

Arlyne answered 19/12, 2013 at 17:47 Comment(1)
I'm interested in all of your questions, but they should be each a separate post. Each post ideally should concentrate on a single objective question.Indelible
C
9

If you have a system where the software was already installed you can find the ProductID using:

Get-WmiObject -Class Win32_Product | fl Name,Version,InstallDate,InstallSource,PackageName,IdentifyingNumber

Example output:

Name              : Dell OpenManage Systems Management Software (64-Bit)
Version           : 7.3.0
InstallDate       : 20131009
InstallSource     : c:\Installs\OMSA\
PackageName       : SysMgmtx64.msi
IdentifyingNumber : {7CB08DC5-EA02-4076-BA7D-AD7736A3DE71}

Name              : Microsoft ASP.NET MVC 4 Runtime
Version           : 4.0.40804.0
InstallDate       : 20141111
InstallSource     : C:\windows\TEMP\IXP000.TMP\
PackageName       : AspNetMVC4.msi
IdentifyingNumber : {3FE312D5-B862-40CE-8E4E-A6D8ABF62736}

Where IdentifyingNumber is the GUID you should use in the package resource. Example for the above Dell software:

package OMSA
{
        Name = 'Dell OpenManage Systems Management Software (64-Bit)'
        ...
        ProductId = '7CB08DC5-EA02-4076-BA7D-AD7736A3DE71'
        Arguments = ...
}
Coessential answered 19/5, 2015 at 1:47 Comment(1)
You can also use ft instead of fl so you get a table like outputWesting
B
3

The error means you have a mismatch in the Name or the ProductId of your Package resource against the msi content.

Easiest way in my experience to find both value is to use the Carbon powershell module.

Install-Module Carbon

Then simply run from powershell console:

msi "[path to your msi]"

Note: msi is an alias for Get-Msi

Example:

PS C:\Users\gigi\Downloads> msi .\node-v6.10.0-x64.msi

ProductName ProductVersion Manufacturer       ProductCode                         
----------- -------------- ------------       -----------                         
Node.js     6.10.0         Node.js Foundation 84f68739-3b44-4d36-abdb-2151a23c9c3d

Copy and paste ProductName and ProductCode to your DSC package configuration and you are done.

Brose answered 22/3, 2017 at 13:25 Comment(0)
E
2

Quoting Heath Stewart's comment:

the ProductId is the ProductCode of the MSI, which you can get by opening the MSI in Orca (part of the Windows SDK) or you can install my module from http://psmsi.codeplex.com and get it like so:

get-msitable <yourmsi.msi> -table Property | where { $_.Property -eq "ProductCode" }
Epidermis answered 2/7, 2014 at 4:48 Comment(1)
Install-Module MSI is the way to go these daysVining
L
0

I wrote a PowerShell function to find the product information

Function Get-InstallerProductProperty
{
    # Define parameters
    Param($installerFilePath,
    $PropertyName)

    # Verify file exists
    if((Test-Path -Path $installerFilePath) -eq $true)
    {
        $path = $installerFilePath

        $comObjWI = New-Object -ComObject WindowsInstaller.Installer
        $MSIDatabase = $comObjWI.GetType().InvokeMember("OpenDatabase","InvokeMethod",$Null,$comObjWI,@($Path,0))
        $Query = "SELECT Value FROM Property WHERE Property = '$PropertyName'"
        $results = $View = $MSIDatabase.GetType().InvokeMember("OpenView","InvokeMethod",$null,$MSIDatabase,($Query))
        $View.GetType().InvokeMember("Execute", "InvokeMethod", $null, $View, $null)
        $Record = $View.GetType().InvokeMember("Fetch","InvokeMethod",$null,$View,$null)
        $Value = $Record.GetType().InvokeMember("StringData","GetProperty",$null,$Record,1)

        # Return the product id
        return $Value.Replace("{", "").Replace("}", "")
    }
}
Licensee answered 19/2, 2020 at 18:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.