# win\_package product\_id

**URL:** <https://forum.ansible.com/t/win-package-product-id/20608>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [February 17, 2016, 11:46pm UTC](https://forum.ansible.com/t/win-package-product-id/20608 "2016-02-17T23:46:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerald\_Spencer1](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@Gerald\_Spencer1](https://forum.ansible.com/u/Gerald_Spencer1)\
**Post date:** [February 17, 2016, 11:46pm UTC](https://forum.ansible.com/t/win-package-product-id/20608/1 "2016-02-17T23:46:50Z")

</div>

I am currently going through and installing all of the various software that is needed to provision our windows 7 machines. Unfortunately, when I attempt to install the latest Anaconda3 from continuum, I am unable to locate that products guid (product\_id). It doesn’t appear in the normal registry locations for 64 or 32 installs, in the wmic.exe get product powershell output or under a Get-ChildItem Win32\_Product powershell output as well.

I generated a guid, but after the program installed it failed since it was unable to locate the product\_id to see if it was installed (the error was basically, the program appeared to install correctly, but it was unable to located the product\_id).

Since the product\_id is required for this module is there anything I can do? I double the win\_msi package would work due to the face that the anaconda3 installer is a installshield exe.

I currently have a version by repackaging the exe as a msi in AdminStudio, but that isn’t ideal.

Cheers

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [February 18, 2016, 9:53am UTC](https://forum.ansible.com/t/win-package-product-id/20608/2 "2016-02-18T09:53:04Z")

</div>

Take a look at your registry path HKLM:\Software\microsoft\windows\currentversion\uninstall.

Each installed package should register there, and I think the idea is that guids should be used, but as you can see from the software installed on my machine some packages just use the package name:

[![](https://lh3.googleusercontent.com/-7gwhNDMPOWA/VsWT6yl8PdI/AAAAAAAAFEM/7eMqkSLP72o/s320/2016-02-18%2B10_49_04-Program%2BManager.png)](https://lh3.googleusercontent.com/-7gwhNDMPOWA/VsWT6yl8PdI/AAAAAAAAFEM/7eMqkSLP72o/s1600/2016-02-18%2B10_49_04-Program%2BManager.png)

So, if I for instances wanted to create an ansible play for installing android studio, I would simply used productId “Android Studio”.

If the software you want to install doesn’t register itself under the uninstall registry path there’s not much you can do with win\_package, as it requires a registry-based lookup to firugre out if the software is already installed or not. You could possibly test of the installed files are already present and then do win\_script to install the package in a more manual way maybe. In any case, win\_package requires that the installed software plays nicely and registers itself in the uninstall path.

---

<div class="post-metadata">

**Author:** ![Gerald\_Spencer1](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@Gerald\_Spencer1](https://forum.ansible.com/u/Gerald_Spencer1)\
**Post date:** [February 19, 2016, 9:10am UTC](https://forum.ansible.com/t/win-package-product-id/20608/3 "2016-02-19T09:10:04Z")

</div>

Interesting. So following your advice, the value in HKLM:\Software\microsoft\windows\currentversion\uninstall is Python 3.5\*.1 (Anaconda3 2.5.0 64-bit)\* and lets say we run:

- name: install conda  
win\_package:  
path: ‘.\Desktop\CondaInstall.exe’  
product\_id: ‘Python 3.5.1 (Anaconda3 2.5.0 64-bit)’  
arguments: “/S /D=…\Anaconda3”

When the package is already installed, the task executes as expected and reports no change in state.  
When the package is _not_ installed, one would expect for the package to be installed. Instead, the module fails and reports the $LocalizedData.PostValidationError

- Package from {0} was installed, but the specified ProductId and/or Name does not match package details

It seems to be failing somewhere around [Line 925](https://github.com/ansible/ansible-modules-extras/blob/devel/windows/win_package.ps1#L925)in win\_package with the Get-ProductEntry in the Set-TargetResource function. The odd thing is, when I pull out Validate-StandardArguments and Get-ProductEntry functions, they act as expected. i.e.

- Validate-StandardArguments ensures that the path exists, reports that the [product\_id is not a guid](https://github.com/ansible/ansible-modules-extras/blob/devel/windows/win_package.ps1#L192) and sets the $identifyingNumber to the product\_id.
- Get-ProductEntry then takes the parsed $identifyingNumber form Validate-StandardArguments and returns the $keyLocation for the product\_id (either 32bit or 64bit uninstall registry keys)
- Set-TargetResource then tests the resource, notices that the [installer is an exe](https://github.com/ansible/ansible-modules-extras/blob/devel/windows/win_package.ps1#L810) and starts the process as requested by the supplied arguments. After install the function should then check if the $Ensure state is set to ‘Present’ (default condition), then it checks to see if the value returned from Get-ProductEntry exists (program was installed.  
Unfortunately, it fails to install the exe. I did notice that the process briefly appears in the task manager, then immediately following the failure notice from ansible, drops away. Perhaps the [process fails](https://github.com/ansible/ansible-modules-extras/blob/devel/windows/win_package.ps1#L840) to correctly start with the correct arguments?

---

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [February 23, 2016, 10:46am UTC](https://forum.ansible.com/t/win-package-product-id/20608/4 "2016-02-23T10:46:30Z")

</div>

Is this a package which is publicly available? I’d like to have a closer look.

---

<div class="post-metadata">

**Author:** ![Gerald\_Spencer1](https://avatars.discourse-cdn.com/v4/letter/g/b782af/32.png) [@Gerald\_Spencer1](https://forum.ansible.com/u/Gerald_Spencer1)\
**Post date:** [February 24, 2016, 2:00am UTC](https://forum.ansible.com/t/win-package-product-id/20608/5 "2016-02-24T02:00:09Z")

</div>

It is:

Python 3.5 64bit  
[https://www.continuum.io/downloads](https://www.continuum.io/downloads)
