You could have a script that runs when Opus starts, tests if it's installed, and sets a variable which the button checks. That would also avoid hitting the filesystem every time the toolbar is refreshed, which can happen frequently.
Rather old post, nevertheless, I'm currently trying to hide/show a button if a path does not exists on my Windows installation.
Perhaps this feature already exists, running the latest (beta) of DO?
Edit: According to this thread,
I've now set up a global var "winmerge_installed" that is set to true or false in an OnInit script:
function OnInit(initData) {
...
initData.config_desc = DOpus.Create.Map();
var configName = "";
configName = "winmerge_installed";
initData.Config[configName] = DOpus.FSUtil.Exists("/programfilesx86\\WinMerge");
The button, that I want to show or hide has this code:
@hideif:!$glob:winmerge_installed
However, this does not work as expected. May I assume that the code above does just check if the var itself is available and not check it's value, likewise true or false?
The variable looks like it's just an on/off thing ("is WinMerge installed or not?") so why do you need a value here? Just delete the variable if it isn't installed, and create it if it is installed. You don't need a third value here, do you?
Out of interest: Shouldn't @hideif:!$glob:winmerge_installed work either? Pls. note the !
IMO this should hide the button if the var "winmerge_installed" is not available? I've read this in an old release note document of DO.
Now, that you mentioned it, yes of course, you are correct!
I do use a script to set up global vars, found here on the forums, however this script has got a GUI to set those vars and I must set them by code, while checking for installed programs.
At the end, this is a working solution, however, it requires additional coding to set up a global var.
It would be more convenient if hideif or any similar commands would support user defined logical expressions based on e.g. existing paths or files, as required above.