Dynaletik Posted February 7, 2005 Share Posted February 7, 2005 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 More sharing options...
Dynaletik Posted February 8, 2005 Author Share Posted February 8, 2005 There must be someone who knows how to handle the condition statements. What about hasi? I didn't hear anything from him for a quite long time now...is he working or on holiday? Link to comment Share on other sites More sharing options...
djbe Posted February 8, 2005 Share Posted February 8, 2005 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 Link to comment Share on other sites More sharing options...
Dynaletik Posted February 8, 2005 Author Share Posted February 8, 2005 Thank you man....I only need one per program. Link to comment Share on other sites More sharing options...
singk Posted February 11, 2005 Share Posted February 11, 2005 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 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?ThanksSing Link to comment Share on other sites More sharing options...
djbe Posted February 11, 2005 Share Posted February 11, 2005 I think just putting a ! in front of the Fileexist will do it (aka negation in programming):cond[pn]=['!FileExists("%SystemRoot%\\System32\\ctaud2k.sys")'] Link to comment Share on other sites More sharing options...
singk Posted February 11, 2005 Share Posted February 11, 2005 cond[pn]=['!FileExists("%SystemRoot%\\System32\\ctaud2k.sys")']Thanks. It works great..... Link to comment Share on other sites More sharing options...
singk Posted February 11, 2005 Share Posted February 11, 2005 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 JavascriptThanksSing Link to comment Share on other sites More sharing options...
djbe Posted February 11, 2005 Share Posted February 11, 2005 I could do that, but it's 00:15 and I'm tired... Maybe when I have some spare time 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now