Combine multiple if relevance

For performance reasons, I would try at a slightly different approach. Using separated registry inspections adds more evaluation time so instead of numerous individual inspections, perhaps consider 1 inspection to pull multiple results. I’ll use 3 apps I have installed as an example……note the evaluation times.

3 separated inspections

Q: (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501" and value "DisplayVersion" of it as string = "12.0.30501.0") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries))
A: {050d4fc8-5d48-4b8f-8972-47c82c46020f}
T: 133.906 ms
I: plural string

Q: (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++  Compilers 2010 Standard - enu - x86" and value "DisplayVersion" of it as string = "10.0.40219") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries))
A: {2F8B731A-5F2D-3EA8-8B25-C3E5E43F4BDB}
T: 113.117 ms
I: plural string

Q: (names of keys whose (value "DisplayName" of it as string = "BigFix Client" and value "DisplayVersion" of it as string = "11.0.0.175") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries))
A: {3F9620B8-2C6C-4E21-BE23-8481DA03318B}
T: 86.602 ms
I: plural string

Joined as a single set of 3 separated inspections

Q: (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501" and value "DisplayVersion" of it as string = "12.0.30501.0") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)) ; (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++  Compilers 2010 Standard - enu - x86" and value "DisplayVersion" of it as string = "10.0.40219") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries)) ; (names of keys whose (value "DisplayName" of it as string = "BigFix Client" and value "DisplayVersion" of it as string = "11.0.0.175") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of (x32 registries; x64 registries))
A: {050d4fc8-5d48-4b8f-8972-47c82c46020f}
A: {2F8B731A-5F2D-3EA8-8B25-C3E5E43F4BDB}
A: {3F9620B8-2C6C-4E21-BE23-8481DA03318B}
T: 131.264 ms
I: plural string

As 1 registry inspection to check for the same 3 apps

Q: ((names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501" and value "DisplayVersion" of it as string = "12.0.30501.0") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)  ; (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++  Compilers 2010 Standard - enu - x86" and value "DisplayVersion" of it as string = "10.0.40219") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it) ; (names of keys whose (value "DisplayName" of it as string = "BigFix Client" and value "DisplayVersion" of it as string = "11.0.0.175") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)) of (x32 registries; x64 registries)
A: {050d4fc8-5d48-4b8f-8972-47c82c46020f}
A: {2F8B731A-5F2D-3EA8-8B25-C3E5E43F4BDB}
A: {3F9620B8-2C6C-4E21-BE23-8481DA03318B}
T: 65.828 ms
I: plural string

If you then use that and concatenate the results with a space this could be used as a parameter

Q: concatenation " " of (((names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501" and value "DisplayVersion" of it as string = "12.0.30501.0") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)  ; (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++  Compilers 2010 Standard - enu - x86" and value "DisplayVersion" of it as string = "10.0.40219") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it) ; (names of keys whose (value "DisplayName" of it as string = "BigFix Client" and value "DisplayVersion" of it as string = "11.0.0.175") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)) of (x32 registries; x64 registries))
A: {050d4fc8-5d48-4b8f-8972-47c82c46020f} {2F8B731A-5F2D-3EA8-8B25-C3E5E43F4BDB} {3F9620B8-2C6C-4E21-BE23-8481DA03318B}
T: 66.224 ms
I: singular string

As an action command, this can be sent to a CMD “for” loop so each GUID is passed to msiexec.exe /x to run an uninstall for as many GUIDs where detected, so for building the GUID list and running an uninstall for each

parameter "GUIDS" = {concatenation " " of (((names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.30501" and value "DisplayVersion" of it as string = "12.0.30501.0") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)  ; (names of keys whose (value "DisplayName" of it as string = "Microsoft Visual C++  Compilers 2010 Standard - enu - x86" and value "DisplayVersion" of it as string = "10.0.40219") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it) ; (names of keys whose (value "DisplayName" of it as string = "BigFix Client" and value "DisplayVersion" of it as string = "11.0.0.175") of keys "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall" of it)) of (x32 registries; x64 registries))}
waithidden cmd.exe /c "for %a in ({parameter "GUIDS"}) do (echo msiexec.exe /x %a /qn)" 

While testing in the FixletDebugger you could change the action to a wait command and use cmd.exe /k so you can see the CMD prompt output as it runs. Same method I exampled in Remove CyberArk Agent. This might be a bit more efficient than 20 or so separated inspections and separated uninstalls.

7 Likes