ozzii Posted November 14, 2006 Share Posted November 14, 2006 I'm a newbie and I've got a little question (probably silly):-I put this into gcond : FileExists('%programfiles%\something')-The directory "%programfiles%\something" doesn't exist-I selected "if grayed condition is true..."-When I launch WPI, I CAN select the item with this gcondWhat I've done wrong ?? Link to comment Share on other sites More sharing options...
kof94 Posted November 15, 2006 Share Posted November 15, 2006 First, cond/gcond will only work when looking for files not dirs.Second, your looking at everything in reverse.Try this:!FileExist('%programfiles%\Somewhere\Something.exe')! basicly means not or doesn't (a negative statement).So the above code would read (in english)If Something.exe does not exist in %programfiles%\Somewhere then set cond/gcond as true.Hope this helps . Link to comment Share on other sites More sharing options...
ozzii Posted November 15, 2006 Author Share Posted November 15, 2006 Thanks for your answer. I will try this tomorrow. Link to comment Share on other sites More sharing options...
kof94 Posted November 16, 2006 Share Posted November 16, 2006 No problem, when I first started configuring WPI it took me a whole weekend to get gcond/cond to work properly. Just wait until you want to set two or three different conditions in the same command, that really messes with your head .Happy scripting. Link to comment Share on other sites More sharing options...
ICANIT Posted November 26, 2006 Share Posted November 26, 2006 Its not exactly true that WPI - gcond only looks for files and not folders. this is what i tested :gcond[pn]=['!FileExists(\'"%PROGRAMFILES%\VMware"\')'];and gcond[pn]=['!FileExists(\'"%PROGRAMFILES%\VMware\VMware Tools\VMwaretray.exe"\')'];ether of those two lines will gray out my "program" even if the folder "VMware Tools" and thereby the file VMwaretray.exe is NOT present.I ran WPI on a computer with only VMware Workstation installed, that means that the folder %ProgramFiles%\VMware is present (not the tools folder) - and it still gets grayed out.i even disovered that on some programs it is needed to have the dubble backslashes Like :gcond[pn]=['!FileExists(\'"%PROGRAMFILES%\\Notepad++\\notepad++.exe"\')'];i havent found out why, yet, but will test further. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now