Jump to content

Newbie gcond question


Recommended Posts

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 gcond

What I've done wrong ??

Link to comment
Share on other sites


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

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 :wacko: .

Happy scripting.

Link to comment
Share on other sites

  • 2 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...