Tip: Getting the ProdID for Package / xPackage modules

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Ryan Young Ryan Young 1 year, 12 months ago.

  • Author
    Posts
  • #21173
    Profile photo of Ryan Young
    Ryan Young
    Participant

    Hi folks, I've seen some people post about how they're trying to use the Package or xPackage modules to install things. Often (and rightly so) the responses to these questions are along the lines of "It sucks to have to use a product ID, so we typically install it someway else". Still, for those of us who wanna be stubborn (like me haha), I figured out an easy and somewhat reliable way of getting the product ID you need in order to install via the modules, regardless of whether the source installer was an EXE or was an MSI.

    Step 1: Install the product on a test machine. This will ensure that the registry is updated with the info about the product.

    Step 2: Download and install the PSMSI module for powershell: http://psmsi.codeplex.com/

    Step 3: Find the "uninstaller" file/path for your product. In my example I'm using SQL 2014.

    Step 4: Use this information to enumerate the GUID like so :

    PS C:\Windows\system32> get-msicomponentinfo | where { $_.Path -eq "C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\SQLServer2014\x64\SetupARP.exe" } | get-msiproductinfo
    
    ProductCode                            ProductVersion      ProductName                                                                                                                                                             
    -----------                            --------------      -----------                                                                                                                                                             
    {0EEBDCCA-EF5D-4896-9FEA-D7D410A57E8A} 12.0.2000.8         Microsoft SQL Server 2014 Setup (English)   

    (Source = http://psmsi.codeplex.com/wikipage?title=Examples.Components&referringTitle=Examples)

    Step 5: Profit! Add this GUID as your product ID, you're good to go!

    Bonus: I know that the GUID does exist in the registry and you can find it there (under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\), however SQL is a perfect example of "This is an installer that installs multiple MSI's and identifying which exact one is the 'right one' can be difficult. This sort of just makes it easy to spot.

    Happy I could contribute something for once! 🙂

  • #21184
    Profile photo of Craig Martin
    Craig Martin
    Member

    Thanks for posting Ryan! Next time can you post a couple weeks earlier? 😉 I just had to do this about twenty times using regedit, getting my DSC document ready for FIM.

  • #21185
    Profile photo of Ryan Young
    Ryan Young
    Participant

    Hehe I only figured it out within the last 24 hours! Sorry couldn't help sooner, but it'll be good for the future! 🙂

You must be logged in to reply to this topic.