Can you provide the full paths you are looking for? I donât mean relevance, I mean the full pathnames.
Are these the correct paths?
C:\Program Files (x86)\Microsoft Office\Office12\WINPROJ.EXE
C:\Program Files\Microsoft Office\Office12\WINPROJ.EXE
Assuming those are the correct paths, then I would do something like this:
if (exists files "C:\Program Files (x86)\Microsoft Office\Office12\WINPROJ.EXE") then "32bit" else ( if exists files "C:\Program Files\Microsoft Office\Office12\WINPROJ.EXE" then (if x64 of operating system then "64bit" else "32bit") else ERROR "not found" )
I would strongly recommend against using Find Files
in most cases as this will search the file system which can be extremely slow and problematic unless used very carefully.
Generally to get this answer, I would actually recommend looking into the Windows Registry Uninstall key to get if the program is 32bit or 64bit. This approach is generally faster and more reliable in cases where the programs are installed to non-default paths, or if on non-English windows where âProgram Filesâ is not the localized pathname.
For the registry version of this relevance, start with getting the DisplayName of all products installed:
(it as string) of values "DisplayName" of keys of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)
In my case, I donât have any office products installed, but here is a working example for 7zip bitness check:
(if (it contains "x64") then "x64" else "x32") of (it as string) whose(it starts with "7-Zip") of values "DisplayName" of keys of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)
If 7zip isnât installed, then this will return <none>
, otherwise it returns either x64
or x32
.
I donât have a way to test this at the moment, but this might work for MS Project:
(if (it contains "x64") then "x64" else "x32") of (it as string) whose(it contains "Microsoft Project") of values "DisplayName" of keys of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of (x64 registries; x32 registries)
But without looking at the registry entries for MS Project myself, then I donât know if it lists itâs bitness or where it lists it, but if you shared a screenshot, then I could adjust the relevance as needed.