Jump to content

Problem with isLogOnServer


Recommended Posts

This time my problem is with "isLogOnServer", i cant make do what I want.

If I push Alt-G in WPI and check for isLogOnServer it says: isLogOnServer("\\DC-A")

but if i do: cond[pn]=['isLogOnServer("\\DC-A")']; My app. is not shown !

if I do: cond[pn]=['!isLogOnServer("\\DC-A")']; the entry is shown, and I can write whatever I want as servername with no difference.

My goal is to have this:

cond[pn]=['isLogOnServer("\\DC-A") || isLogOnServer("\\DC-B")'];

meaning, Only if your logon server is ether DC-A or DC-B, show this app.

(servernames is not actual names, just ex.)

what am i doing wrong?

Link to comment
Share on other sites


Nothing. You are doing it right. Conditions are a little hard to grasp at first.

Conditions are meant to hide things. Grayed conditions are meant to show but disable things.

Look at it like this: if the condition is met, I am going to hide the item.

You may want to use Grayed Conditions, and use "If grayed condition is true, disable the checkbox" option.

Link to comment
Share on other sites

HI mritter, your the developer so i guess you must know. :-)

but from your answer i get that this: cond[pn]=['getbits()==32']; - should hide my app if OS is 32 bit !? thats not the case. the line is meaning, "show only this app if OS is 32 bit"

so in my opion this line: cond[pn]=['isLogOnServer("\\DC-A")']; - should also be positive and mean "show only this app if LogOnServer is DC-A".

it gets quite confusing if Cond[] ,is ether positive or negative depending of what function you want to run. and still we have the ! sign to make it negative (meaning "if this is NOT true, do this")

just sharing my thoughts :-)

Link to comment
Share on other sites

I totally agree it is backwards, but I didn't make it that way. The original person who wrote it only intended for simple checks like FileExists(), and didn't look ahead to the future. So back when it was first written

!FileExists("C:WPI\Install\MyInstaller.exe") hide item becaue doesn't exist

and

FileExists("C:\Program Files\Adobe\Adobe.exe") hide item because already installed

made perfect sense.

Then more items slowly got added, never got straightened out, I came along, added more, people didn't want to change their configs, so it was always left that way. I hate it, too.

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