I am trying to write an action script that reads the value from the Registry and puts that in a parameter.
I tried the below logic but all are getting failed, Please suggest
1st Method Failed appendfile {Preceding text of first “Remotely Anyconnect” of( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))}
move __appendfile C:\info.txt
parameter “path” = {line 1 of file “C:\info.txt”}
2nd Method Failed parameter “path” = {Preceding text of first “Remotely Anyconnect” of( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))}
You need to test your relevance in the debugger to ensure it always returns a single value that is either explicitly cast as a string or something that the debugger can cast to string by default.
Then you can plug the working relevance into your actionscript.
Agreed, it is very unlikely this would work in the Fixlet Debugger. Let’s break this apart.
( unique values of (it as string as trimmed string) of values “InstallLocation” of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))
This returns every “InstallLocation” value as a trimmer string. Multiple results, one for each “Uninstall” key.
Preceding text of first “Remotely Anyconnect” of
From each of those InstallLocation values, this pulls the substring before “Remotely Anyconnect”.
This relevance could only work if there is only one InstallLocation value under all of those registry keys, and that one value contains “Remotely Anyconnect”.
In short, your query for registry keys needs a whose() filter to limit to only those containing “Remotely Anyconnect”.
Try
preceding text of first "Remotely Anyconnect" of( unique values of (it as string as trimmed string) of values "InstallLocation" whose (it as string contains "Remotely Anyconnect") of keys of keys “HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall” of (native registry))
(This could still have an issue of there are more than one “Remotely Anyconnect” registry values)