I’m trying to retrieve the registry key for specific application from the uninstall key. It works fine from QnA debugger but running it in Action script it fails.
Example below - working
parameter “_Result3” = “{name of key whose (value “DisplayName” of it as string as lowercase starts with “citrix workspace 2409”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string}”
parameter “_Result2” = “{name of key whose (value “DisplayName” of it as string as lowercase starts with “windows iot”) of key “HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string}”
Command failed (Relevance substitution failed) parameter “_Result2” = “{name of key whose (value “DisplayName” of it as string as lowercase starts with “windows iot”) of key “HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string}”
If I run this from the QnA result is fine
Q: name of key whose (value “DisplayName” of it as string as lowercase starts with “windows iot”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” of native registry
A: {084094EF-6AC9-480A-7CC1-04199047BBDD}
I guess some escape/substitution needs to happen so any idea/suggestion Thx!
There could be a few reasons why the relevance fails during action script execution:
The DisplayName is incorrect or doesn’t match exactly.
The DisplayName matches multiple entries, which causes ambiguity.
The DisplayName doesn’t exist at all in the registry.
While the QnA debugger is more forgiving and can handle empty or multiple results, action script requires the relevance to return a single valid result. If it doesn’t, the parameter substitution will fail.
Safer approach:
if {exists key whose (exists value "DisplayName" of it AND value "DisplayName" of it as string as lowercase = "windows iot" as lowercase) of key "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of native registry}
parameter "_Result2" = "{name of key whose (value "DisplayName" of it as string as lowercase = "windows iot 123" as lowercase) of key "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of native registry as string}"
endif
Fallback approach using | "None"
parameter "_Result2" = "{name of key whose (value "DisplayName" of it as string as lowercase = "windows iot 123" as lowercase) of key "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of native registry as string | "None"}"
names of keys whose (value "DisplayName" of it as string as lowercase starts with "windows iot") of keys "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" of native registry as string