Jump to content

Condition question


 Share

Recommended Posts

I am going to use WPI for a multiboot DVD. My question: How does the conditional statement work? I forgot it / don't know it.

As an example, what would I have to put in for the Creative SB Audigy Control panel, if the file ctaud2k.sys in system32 folder must exist for install???

Link to comment
Share on other sites


Add this line:

cond[pn]=['FileExists("%SystemRoot%\\System32\\ctaud2k.sys")']

If that file doesn't exist, the option to select it in wpi will not appear. You can combine multiple tests into one with && (and) and || (or). (dunno about the 'or', havn't tested it, but it should work :rolleyes:

Link to comment
Share on other sites

Add this line:

cond[pn]=['FileExists("%SystemRoot%\\System32\\ctaud2k.sys")']

If that file doesn't exist, the option to select it in wpi will not appear. You can combine multiple tests into one with && (and) and || (or). (dunno about the 'or', havn't tested it, but it should work  :rolleyes:

cond[pn]=['FileExists("%SystemRoot%\\System32\\ctaud2k.sys")']

This works if condition is true (enable if exist), but what if the condition is false. Another word, if exist do not enabled option. Can this be done?

Thanks

Sing

Link to comment
Share on other sites

If that file doesn't exist, the option to select it in wpi will not appear.

Is there any way or how do I modify the boxes.js so that the option appears, but Dimmed out/lock the checkbox instead?

Eventhough the condition is false, I still want it to display the option, but enable to check it so I can tell which applications had installed. If we make it disappears, then we wouldn't know what's available on the CD or what had or had not installed.

NOTE: I have little knownledge of Javascript

Thanks

Sing

Link to comment
Share on other sites

I could do that, but it's 00:15 and I'm tired... Maybe when I have some spare time :D

One part to modify is this:

for (i=1; (prog[i]!=null); i++) // for defined programs do ...
{    
 // We only display things that pass condition tests, unless we are in debug mode.
 //
 if(cond[i] && cond[i][0]) {
 var c = unescape(replpath(cond[i][0]).replace(/\\/g, "\\\\"));
 try {
   if(!eval(c)) {
   debug("Condition failed: " + c + " -- not rendering " + prog[i], 1);
   continue;
   }
 } catch(e) {
   alert("Error in condition statement for " + prog[i] + ":\n\n" + cond[i] + "\n\nTreating as a false condition.");
   continue;
 }
 }

and some parts after it. But now SLEEP :P

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.


×
×
  • Create New...