Jump to content

Condition if Win 2k/xp/2k3 not found


Recommended Posts

I wish to blank all installations if Windows 2000/XP/2003 is not found.

I was reading an old thread about using GetOSver to disable an installation though Condition. I was wondering weather this has been implemented in v5.1 and if so how to use it.

I'm a complete n00b when it comes to java scripting :wacko: so please be precise.

Thanks

Link to comment
Share on other sites


Ok, I've been trying to get this to work using this:

gcond[pn]=['(getOSver()=="2K" || getOSver()=="XP" || getOSver()=="03")'];

But it's greying out the selections in XP, what am I doing wrong?

If I use a combination I get no problem.

gcond[pn]=['(getOSver()=="2K" || getOSver()=="XP" || getOSver()=="03") && !FileExists(\'%Systemroot%\\system32\\drivers\\sptd.sys\')'];

I am sorry but I really don't know what I'm doing wrong :( , help pleeeeeeeeeeeeeeaaaaaaaaaaaaaaase.

Edited by kof94
Link to comment
Share on other sites

Well, as you put it, the condition means:

"if OS is 2K, XP or 03, THEN grey it out".

Your item is greyed out in XP BECAUSE the condition is met!

In facts it's working the other way around what you're thinking it is.

Good news, tho, you just have to reverse it! :thumbup :

gcond[pn]=['!(getOSver()=="2K" || getOSver()=="XP" || getOSver()=="03")'];

or

gcond[pn]=['!(getOSver()=="2K" || getOSver()=="XP" || getOSver()=="03") || !FileExists(\'%Systemroot%\\system32\\drivers\\sptd.sys\')'];

Link to comment
Share on other sites

for me, for your need , the simply way is to use cond (vs gcond)

if cond is false , WPI do not show the entry ,

so if you do not see it , you cannot check it ...

sample here, for a critical hotfix for XP

cond[pn]=['getOSver()=="XP" && FileExists("%wpipath%\\_WPIapp\\_XP32\\Hotfixes_Critical\\KB873339.exe") && FileExists("%windir%\\Debug\\KB873339.log")'];

if os is DIFFERENT THAN XP , WPI hide this entry .

for me gcond is good to know if the entry is already installed.

gcond only change the color for me (good thing also) .

maybe you must look for the operators :

== equal

!= not equal

&& and

|| or

! not .... those i use

i dont know all of them , maybe this kind of list can be helpful for all of us

...? kel ? i am sure you can help us with this ? a complet list of operators , variables..

(some of us are not friends with applets,scripts... java, html.....)

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