How to make Python's winreg see entries in the registry that are visible in the Registry Editor for Adobe CC programs?

988 views Asked by At

I am trying to use the winreg library of python to access the registry keys for Adobe products (Photoshop, After Effects, Ect.), and while i can see the HKEY_LOCAL_MACHINE subkeys in the Registry Editor, Python can't seem to see the same keys. Is there a permission that needs to be changed or am I approaching this the wrong way?

Here is a Screen cap summarizing the results so far

The code I'm running to see this is:

import winreg
i=0
while True:
    try:
        # self.aeKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Adobe\\After Effects\\16.0")
        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Adobe\Setup\Reader")

        printTest = winreg.EnumKey(key, i)
        print(printTest)
        i+=1
    except WindowsError:
        break

Which results in me having the return of

Acrobat Distiller
Acrobat PDFMaker
Adobe AIR
Adobe ARM
CommonFiles
ExtendScript Toolkit
ExtensionManager
PDF Admin Settings
Registration
Repair
Setup

But not

Adobe Bridge, Adobe Acrobat, After Effects, Photoshop, etc.

Edit: I'm Running 32-Bit Python currently.

1

There are 1 answers

2
ApollosAnimation On

@martineau from the comments hit it right on the head! I needed to change the Access key in order to allow 64 bit registries to be found.

import winreg
i=0
while True:
    try:
        # self.aeKey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Adobe\\After Effects\\16.0")
        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Adobe",0, winreg.KEY_READ | winreg.KEY_WOW64_64KEY)
        assert key != None, "Key = None"
        printTest = winreg.EnumKey(key, i)
        print(printTest)
        i+=1
    except WindowsError:
        break

Now produces

Acrobat Distiller
Acrobat PDFMaker
Adobe Acrobat
Adobe Bridge
After Effects
Animate
Character Animator
CommonFiles
Dreamweaver 2020
Dreamweaver CC 2019
Identity
Licensing
Photoshop
Prelude
Premiere Pro

Thanks for all the help!