You can see some of the differences in the Fixlet debugger…
32-bit per-machine applications:
q: (values "DisplayName" of it, pathname of it) of keys of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of x32 registries
A: Visual Studio Build Tools 2019, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\6fd5460c
A: Cisco WebEx Meetings, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\ActiveTouchMeetingClient
A: AnyDesk, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\AnyDesk
64-bit Per-Machine Applications:
q: (values "DisplayName" of it, pathname of it) of keys of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of x64 registries
A: 7-Zip 19.00 (x64), HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\7-Zip
A: Windows Driver Package - Lenovo Monitor (11/09/2018 6.10.0.0), HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\B757445117C6A0C55D3FFFC6CF7A9C05A6A5D74E
A: Git, HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1
A: Notepad++ (64-bit x64), HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++
Where it gets tricky is that there is no 32-bit redirection when looking at a per-user registry, there’s no built-in ‘x32 keys of logged on users’, only ‘user keys of logged on users’. So we have to detect the OS architecture and reflect “64-bit” on a 64-bit machine or 32-bit on a 32-bit machine when checking the “normal” Uninstall key
q: ((if x64 of operating system then "64-bit" else if x32 of operating system then "32-bit" else "Unknown"), values "DisplayName" of it, pathname of it) of keys of keys "Software\Microsoft\Windows\CurrentVersion\Uninstall" of user keys of logged on users
A: 64-bit, Atom, HKEY_USERS\S-1-5-21-474380057-1838352999-1581317240-10427\Software\Microsoft\Windows\CurrentVersion\Uninstall\atom
A: 64-bit, GitHub Desktop, HKEY_USERS\S-1-5-21-474380057-1838352999-1581317240-10427\Software\Microsoft\Windows\CurrentVersion\Uninstall\GitHubDesktop
A: 64-bit, GoToMeeting 10.19.0.19950, HKEY_USERS\S-1-5-21-474380057-1838352999-1581317240-10427\Software\Microsoft\Windows\CurrentVersion\Uninstall\GoToMeeting
A: 64-bit, Insomnia, HKEY_USERS\S-1-5-21-474380057-1838352999-1581317240-10427\Software\Microsoft\Windows\CurrentVersion\Uninstall\insomnia
And for 32-bit, we can check for the keys under the Wow6432Node key. If entries exist here, it’s definitely a 32-bit app (the Wow6432Node key should not exist on a 32-bit Windows machine)
q: ("32-bit", values "DisplayName" of it, pathname of it) of keys of keys "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of user keys of logged on users
T: 0.000 ms
So, you can add some filters to find the five cases: Teams installed x32 System-Wide, x64 System-Wide, x32 Per-User on x32 system, x64 Per-User on x64 system, or x32 Per-User on x64 System:
// x32 System-Wide Teams Exists
q: exists keys whose (value "DisplayName" of it = "Microsoft Teams") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of x32 registries
A: False
T: 0.035 ms
// x64 System-Wide Teams Exists
q: exists keys whose (value "DisplayName" of it = "Microsoft Teams") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of x64 registries
A: False
T: 0.036 ms
// x64 Per-User Teams Exists
q: x64 of operating system and exists keys whose (value "DisplayName" of it = "Microsoft Teams") of keys "Software\Microsoft\Windows\CurrentVersion\Uninstall" of user keys of logged on users
A: True
T: 0.043 ms
// x32 Per-User Teams Exists on x32 Operating System
q: x32 of operating system and exists keys whose (value "DisplayName" of it = "Microsoft Teams") of keys "Software\Microsoft\Windows\CurrentVersion\Uninstall" of user keys of logged on users
A: False
T: 0.045 ms
// x32 Per-User Teams Exists on x64 Operating System
q: exists keys whose (value "DisplayName" of it = "Microsoft Teams") of keys "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of user keys of logged on users
A: False
T: 0.038 ms