Fixlet enhacement

(imported topic written by DavidNautilus)

I have created relevance code to identify computers in which two specific files exist in a given folder, but I believe it can me enhanced to a more efficient version, can you propose a better solution? Thanks

This is the relevance code:

if exists folder (value “ProgramFilesDir” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion” of native registry as string & “\sub1\sub2”) then (exists file “exe1.exe” of folder (value “ProgramFilesDir” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion” of native registry as string & “\sub1\sub2”) OR exists file “exe2.exe” of folder (value “ProgramFilesDir” of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion” of native registry as string & “\sub1\sub2”)) else false

(imported comment written by MattPeterson)

I would do this:

(
exist

file

“exe2.exe”

of

it

or

exist

file

“exe1.exe”

of

it
)

of

(folder ((value

of

variable

“ProgramW6432”

of

environment
|
value

of

variable

“ProgramFiles”

of

environment)

as

string

&

“\sub1\sub2”
))

(imported comment written by DavidNautilus)

Hi Matt, thanks for your response.

I have noticed that when trying to evaluate for the files existence in this case \sub1\sub2", if the folder exists, it evalutes ok, but if it doesn´t, it will produce an error in fixlet debugger, saying that singular expression refers to nonexistent object, to avoid this, I evaluate first for the folder existence, if the file doesn´t exist it will evalute to false. Also, for some reason fixlet debugger is showing that “|” is an illegalcharacter.