Page 1 of 1

[SOLVED] Problem with multiple 'Key' entries related to a software

Published: January 14, 2019 - 2:57 PM
by Patrice_minagri
Good morning,

When I run the line installed_softwares('BIG-IP Edge Client'), I get the following result:

Code: Select all

[{'install_date': '',
  'install_location': u'C:\\Windows\\Downloaded Program Files',
  'key': u'F5 Networks Client Components',
  'name': u'BIG-IP Edge Client Components (All Users)',
  'publisher': u'F5 Networks, Inc.',
  'system_component': 0,
  'uninstall_string': u'"C:\\ProgramData\\F5 Networks\\f5unistall.exe" /uninstall',
  'version': u'71.2018.0808.2011'},
 {'install_date': u'20190114',
  'install_location': u'',
  'key': u'{6D4839CB-28B4-4070-8CA7-612CA92CA3D0}',
  'name': u'BIG-IP Edge Client',
  'publisher': u'F5 Networks, Inc.',
  'system_component': 0,
  'uninstall_string': u'MsiExec.exe /X{6D4839CB-28B4-4070-8CA7-612CA92CA3D0}',
  'version': u'71.2018.0808.2011'}]
In fact, this is quite normal because the name 'BIG-IP Edge Client' is mentioned twice in the list of software installed on Windows, namely:
- 'BIG-IP Edge Client'
- 'BIG-IP Edge Client Components (All Users)'

When I run the following code:

Code: Select all

for soft in installed_softwares('BIG-IP Edge Client'):
           key_uninst = soft['key']
The result is: F5 Networks Client Components

What I'm interested in retrieving is the second reference key, which is: {6D4839CB-28B4-4070-8CA7-612CA92CA3D0}

How can I retrieve it? Is it possible to limit the search to the mention of 'BIG-IP Edge Client'?

THANKS.

Patrice

Re: Problem with several 'Key' entries related to a software

Published: January 14, 2019 - 3:05 PM
by htouvet

Code: Select all

installed_softwares(uninstallkey=u'{6D4839CB-28B4-4070-8CA7-612CA92CA3D0}')

Re: Problem with several 'Key' entries related to a software

Published: January 14, 2019 - 3:13 PM
by Patrice_minagri
And assuming the key isn't known and we want to use the registry variable instead.

Because in my case, the code `installed_softwares('BIG-IP Edge Client')` will always return two results? Is that correct? Is

n't there anything that can search specifically for 'BIG-IP Edge Client' without retrieving the properties of 'BIG-IP Edge Client Components (All Users)'?

Re: Problem with several 'Key' entries related to a software

Published: January 14, 2019 - 4:10 PM
by htouvet
There's a small bug in the function... to work around it, uninstallkey=''

Code: Select all

installed_softwares(uninstallkey='',name=r'BIG-IP Edge Client')