Refactored win_pkg to get all installed software as well as remove the win32* 3rd party module dependencies

Motivation:
I was not be able to get all installed software on both the 32bit and Wow64 registries. The problem is that the win32api module automatically redirects to the registry hive of the platform being run (Wow64 or 32 bit).
There was no way that I was able to find a way to prevent this from happening.

More information can be found here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa384232(v=vs.85).aspx

Furthermore, depending on if a program is 64 bit or 32 bit, when it is installed the program will be entered
in the appropriate registry hive. Thus, the win32api module will not get all installed software.

Implemantation/Fix:
The built in _winreg module allows for opening either the 64 or 32 bit hive, thus allowing for all installed software to be reported.
Furtheremore, using _winreg allows for the removal of third party dependencies as it is a built-in module for python.

Change-Id: I89cd2ba20d2539ce44fcc51e192b38c07ad6a961
This commit is contained in:
Dennis Harper 2015-09-29 09:32:12 -05:00 committed by rallytime
parent ae4d30b90a
commit b603e35754

View File

@ -382,6 +382,7 @@ def _get_product_information(reg_hive, reg_key, reg_handle):
except WindowsError: except WindowsError:
pass pass
return products
def refresh_db(saltenv='base'): def refresh_db(saltenv='base'):
''' '''